Troubleshooting I/O and Atlas Scientific peristaltic pump control

I’m new to rpi, I have a mechie background so this EE stuff is a little new but I’m making progress. I wanted to build the same system Kyle showed in his wonderful video on hydroponics–so cool and a great opportunity to learn EE skills. So far the major issue I have is being unable to trigger the peristaltic pumps individually, but I was able to get temperature, Ph, and EC readings successfully. There’s other issues but I’d like to focus on the pumps for now. So far I have 4 pumps all wired to the same 12V 5A power supply. I have switched them successfully to blue i2c mode and they all share the same SDA/SCL pins at the rpi. However, when I add the pump object (or 4 of them) to output, and test a duration pulse, it actually fires all four pumps at the same time. What am I missing?

1 Like

Hi Jay,
It looks like you skipped the part in the article about changing the I2C address of each pump to a unique address. Without doing this, all pumps have the same address and cannot be individually controlled.

Well I’m sorry to report I was unable to figure out how to use the List_addr command or the “set i2c address” command successfully from the GUI. Right now I have apparently (through the GUI outputs page) set the pump addresses one by one to 0x30, 0x31, 0x32, and 0x33. I’m getting an error now and none of the pumps fire. “error cannot manipulate output” I tried figuring this out for many hours before writing back.

Is there a more verbose error in the Daemon log?

I have copy/pasted the last 30 lines from the log. My guess is the computer is searching for pumps of the assigned addresses, but the internal address of the pump isn’t matching. Perhaps I’m wrong but that was my thought as I tried to make sense of this.

2022-12-04 02:28:41,130 - INFO - mycodo.daemon - Mycodo daemon v8.14.2 starting
2022-12-04 02:28:41,655 - INFO - mycodo.controllers.controller_output - Activated in 325.1 ms
2022-12-04 02:28:42,156 - INFO - mycodo.daemon - All activated Conditional controllers started
2022-12-04 02:28:42,157 - INFO - mycodo.daemon - All activated Trigger controllers started
2022-12-04 02:28:43,099 - INFO - mycodo.devices.atlas_scientific_i2c_1_102 - Atlas Scientific Board: RTD, Rev: 2, Firmware: 2.11
2022-12-04 02:28:44,614 - INFO - mycodo.controllers.controller_input_c3c1a333 - Activated in 2307.9 ms
2022-12-04 02:28:45,428 - INFO - mycodo.devices.atlas_scientific_i2c_1_100 - Atlas Scientific Board: EC, Rev: 2, Firmware: 2.15
2022-12-04 02:30:08,259 - INFO - mycodo.controllers.controller_input_3f5238d0 - Activated in 4719.5 ms
2022-12-04 02:30:09,054 - INFO - mycodo.devices.atlas_scientific_i2c_1_99 - Atlas Scientific Board: pH, Rev: 2, Firmware: 2.14
2022-12-04 02:30:10,561 - INFO - mycodo.controllers.controller_input_d46fb640 - Activated in 2176.7 ms
2022-12-04 02:30:11,363 - INFO - mycodo.devices.atlas_scientific_i2c_1_104 - Atlas Scientific Board: FLO, Rev: 2, Firmware: 2.05
2022-12-04 02:30:13,408 - INFO - mycodo.controllers.controller_input_0390b23c - Activated in 2708.4 ms
2022-12-04 02:30:13,409 - INFO - mycodo.daemon - All activated Input controllers started
2022-12-04 02:30:13,410 - INFO - mycodo.daemon - All activated PID controllers started
2022-12-04 02:30:13,717 - INFO - mycodo.controllers.controller_function_ce9c6c21 - Activated in 182.5 ms
2022-12-04 02:30:13,717 - INFO - mycodo.daemon - All activated Function controllers started
2022-12-04 02:30:13,883 - INFO - mycodo.controllers.controller_widget - Activated in 165.8 ms
2022-12-04 02:30:14,885 - INFO - mycodo.daemon - Mycodo daemon started in 14.972 seconds
2022-12-04 02:30:14,955 - INFO - mycodo.daemon - 55.12 MB RAM in use
2022-12-04 02:30:50,616 - DEBUG - mycodo.devices.atlas_scientific_i2c_1_103 - AtlasScientificI2C raised an exception when taking a reading: [Errno 121] Remote I/O error
2022-12-04 02:30:50,617 - INFO - mycodo.devices.atlas_scientific_i2c_1_103 - Atlas Scientific Board: None, Rev: 0, Firmware: None
2022-12-04 02:30:50,617 - INFO - mycodo.outputs.pump_atlas_ezo_pmp_cca7ae9b - Initialized in 147.7 ms
2022-12-04 02:31:04,427 - DEBUG - mycodo.devices.atlas_scientific_i2c_1_103 - AtlasScientificI2C raised an exception when taking a reading: [Errno 121] Remote I/O error
2022-12-04 02:31:05,460 - DEBUG - mycodo.devices.atlas_scientific_i2c_1_103 - AtlasScientificI2C raised an exception when taking a reading: [Errno 121] Remote I/O error
2022-12-04 02:31:10,297 - DEBUG - mycodo.devices.atlas_scientific_i2c_1_103 - AtlasScientificI2C raised an exception when taking a reading: [Errno 121] Remote I/O error
2022-12-04 02:31:11,299 - DEBUG - mycodo.devices.atlas_scientific_i2c_1_103 - AtlasScientificI2C raised an exception when taking a reading: [Errno 121] Remote I/O error
2022-12-04 02:31:19,072 - INFO - mycodo.outputs.pump_atlas_ezo_pmp_cca7ae9b - I2C Change command: I2C,48
2022-12-04 02:31:19,073 - DEBUG - mycodo.devices.atlas_scientific_i2c_1_103 - AtlasScientificI2C raised an exception when taking a reading: [Errno 121] Remote I/O error
2022-12-04 02:31:19,074 - INFO - mycodo.outputs.pump_atlas_ezo_pmp_cca7ae9b - Command returned: (‘error’, OSError(121, ‘Remote I/O error’))
2022-12-04 02:31:20,570 - ERROR - mycodo.outputs.pump_atlas_ezo_pmp_cca7ae9b - Cannot manipulate Output cca7ae9b-562c-4739-9b14-1575e6cf451f: Output not set up.

What are the detected addresses (i2cdetect -y 0 or System Information page)? Did you change the I2C address setting in the configuration after changing the address?

Sure, I’ve pasted that below. Secondarily I’ve posted how the original table looked before I used the “set i2C address” button in the GUI for i2c peristaltic atlas pumps. The new table has addresses 30, 31, 32, and 33 that were set one by one by detaching and reattaching the 5v power for the chipset one by one and checking the table once disconnected (finding 67 as the original default address for all of these pumps). I hope that makes sense, not sure if I’m describing what I did properly.

 0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f

00: – – – – – – – –
10: – – – – – – – – – – – – – – – –
20: – – – – – – – 27 – – – – – – – –
30: 30 31 32 33 – – – – – – – – – – – –
40: 40 – – – – – – – 48 – – – – – – –
50: – – – – – – – – – – – – – – – –
60: – – – 63 64 – 66 – 68 – – – – – – –
70: – – – – – – – –

 0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f

00: – – – – – – – –
10: – – – – – – – – – – – – – – – –
20: – – – – – – – 27 – – – – – – – –
30: – – – – – – – – – – – – – – – –
40: 40 – – – – – – – 48 – – – – – – –
50: – – – – – – – – – – – – – – – –
60: – – – 63 64 – 66 67 68 – – – – – – –
70: – – – – – – – –

Did you do this? You need to set the output to the new I2C address.

I attempted accessing the python command script for the atlas i2c devices via the terminal and got stuck at the List_addr command where none of the pumps were being listed or seen by the program. I will attempt this again now and report back with more detail. By the way, once in that mode (beginner question) how do I return to the home terminal? I just did a hard shut down and reset to exit that mode last time.

Good news, mysteriously now the pumps show up in List_addr as numbers 48, 49, 50, and 51. I am currently in the atlas scientific i2c script. I am going to continue now and attempt again to finish the instructions, I will report back again soon.

I would recommend changing the I2C address from the Output itself in the UI. Changing it from the script is not beginner-friendly since the address is using integer values rather than hex, which is used elsewhere.

Is there a need to even change them? Seems they already exist as independent addresses. I will exit this script via hard shut down and proceed to attempting again to run the pumps via the nifty GUI (output screen) you have provided.

No, they do not exist as independent addresses initially. If you think they were, you may be changing other Atlas Scientific device addresses and not your pumps. You may want to disconnect everything and work with one pump at a time if you’re not 100% sure what devices you are sending commands to.

Okay well, so far so good with the pumps, I now have pump1 firing independently! I will proceed with calibration and report back with any issues. Thank you for the assistance and allowing access to such a cool program. I feel like a kid again, discovering something new.

1 Like

Excellent! The rest should be just a repetition of getting that one working. Keep this thread going if you have any other issues/questions about setting up your pumps.

Okay, Kyle, thanks for bearing with me. I have two more problems for today, this time with the function window.

  1. Conditional controller for the peristaltic pumps isn’t working; basically the controller is active but it doesn’t control the pumps. I followed the directions and reviewed the code and everything seems okay. I was a little confused by the IDs. That’s the name string, right? So for the EC it’s “Atlas EC” and for the pump it’s “pump1” for example, these are the strings I’ve put in the NAME field. The Email_ID is just the email address. I think I’ve set these properly. Something just occurred to me–could it be a space in the string that’s the problem? I’ll test that now and report back.
  2. I have a 20x4 LCD screen that turns on but nothing appears on the screen. I checked and it seems to be correctly attached to the i2c SDA and SCL channels. This one is really confusing me since it should be relatively simple to install, given mycodo’s nifty GUI.

Okay so basically changing the name from Atlas pH to Atlast_pH didn’t make it function. I am getting pylint error 18 when I compile by pressing “save.” I can post more info if it helps…I put the script all in the “run” portion. The code all seems to check out, really stumped me. Thanks in advance, really made sure I was following the book and the syntax was correct before I wrote back. Don’t want to rely too much on devs need to solve problems on my own…

The IDs for Conditions are listed under each Condition and the IDs for the Actions are listed under each Action.

Are you providing it the proper voltage? Have you adjusted the contrast potentiometer on the back of the LCD board (if there is one)? Is the LCD I2C address detected?

Are you really receiving an error, or just a warning? What really matters is the actual pylint analysis, which is located at the bottom of the resulting pylint output.

Okay, thank you for clearing up the IDs thing. Such a basic thing I got tripped up on. The conditional controller works fine now, thank you. Troubleshooting the LCD now.

1 Like

I’m getting some odd behavior. When I disconnect the LCD and check the i2c table, number 30 disappears. This would seem to imply that 30 is the LCD.

Yet, 0x30 is programmed to the pump1 (ph down)–I did test this to be sure and the command to pump1 works when set to 0x30.

Edit–Just as an aside I checked the contrast and that seems to be okay

edit: Reset the device, when the LCD is disconnected now 30 and 40 disappear from the table. I find the LCD kind of tricky, going to probably move on. I’ll let you know if I have any other issues but so far so good.

edit edi: Ha I got it working. Somehow both the LCD and the pump shared an i2c address or something was corrupt. by re-defining the pump i2c addresses it became cleared up.