reef-pi :: An opensource reef tank controller based on Raspberry Pi.

eggi55

Community Member
View Badges
Joined
Sep 18, 2022
Messages
63
Reaction score
52
Location
germany
Rating - 0%
0   0   0
I had EG-PM2 running in reefpi via usb, the filedriver, and a scheduled script that called "sispmctl", but the relays in mine stopped working after a while. I can try to dig up that script if you want. Had a delay between pulling the switch in reefpi and the outlet actually switching off though, because of polling.

for the A1T, plug them in, connect to them via wifi and set them up, then figure out what local ip address they have, if you know how to, give them a fixed IP address, and then in reef-pi, add a "tasmota-http" driver per socket with the corresponding ip address. Then outlets from those drivers in the connectors menu.

In the console menu of the plug itself you can do custom programming of the plugs behaviour in addition to the commands it gets from outside, look up the Commands section in the Tasmota Documentation if you want to do that.
thank you for your help driver for the connector strip sounds good, I would test it and you mean the a1t di ip that the router assigns. I'm a beginner and I'm 57 years old. I'm glad if I can still catch up hi. set that in reef-pi in the driver I can still get it but then?
 

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,591
Reaction score
1,590
Rating - 0%
0   0   0
thank you for your help driver for the connector strip sounds good, I would test it and you mean the a1t di ip that the router assigns. I'm a beginner and I'm 57 years old. I'm glad if I can still catch up hi. set that in reef-pi in the driver I can still get it but then?
Yeah, if you got the A1T connected to your router and know their IPs, put those ip adresses in your browser instead of a url, that should get you to their internal menu. Check that they are working.

Then in reefpi, you first need to set up a driver, then a connector, then equipment.

First, in reefpi-->configuration-->drivers add a tasmota-http driver per plug with their respective ip-addresses.
Then, in reefpi-->configuration-->connectors-->Outlets add an outlet for each driver you just created, for pin just use 0.
Then in reefpi-->equipment add a piece of equipment for each outlet you just created.

Then you should get an on off switch per socket.


For the energeenie/silvershield/gembirds you first google "sispmctl" and install it on your pi from sourceforge
then create the following file "script.sh" in /home/pi/outlets/ on your pi
(or whatever your home directory on your pi is instead of /home/pi)

Code:
outD1=$(cat /home/pi/outlets/outD1)
outD2=$(cat /home/pi/outlets/outD2)
outD3=$(cat /home/pi/outlets/outD3)
outD4=$(cat /home/pi/outlets/outD4)

if [ "$outD1" = 1 ]
then
    sispmctl -o 1
else
    sispmctl -f 1
fi

if [ "$outD2" = 1 ]
then
    sispmctl -o 2
else
    sispmctl -f 2
fi

if [ "$outD3" = 1 ]
then
    sispmctl -o 3
else
    sispmctl -f 3
fi

if [ "$outD4" = 1 ]
then
    sispmctl -o 4
else
    sispmctl -f 4
fi

(not the most elegant code, but its simple and works)

then create four filedrivers in reefpi with the /home/pi/outlets/outD1 , outD2, outD3, outD4 files, and again connectors and equipment after that

then type crontab -e in the console of the pi and add the following line at the end and save:

Code:
* * * * * /bin/bash -c ' for i in {1..6}; do /home/pi/outlets/script.sh ; sleep 10; done'


This will run that script every 10 seconds, which is fine on a pi zero w. You can run it more often, then there'll be less delay when switching, but that might bog down the pi, probably not an issue if youve got one of the better ones though.

If youve got more than one of those powerbars, you could make more complicated sispmctl commands as listed on the sourceforge page and run multiple at the same time.
 

eggi55

Community Member
View Badges
Joined
Sep 18, 2022
Messages
63
Reaction score
52
Location
germany
Rating - 0%
0   0   0
Yeah, if you got the A1T connected to your router and know their IPs, put those ip adresses in your browser instead of a url, that should get you to their internal menu. Check that they are working.

Then in reefpi, you first need to set up a driver, then a connector, then equipment.

First, in reefpi-->configuration-->drivers add a tasmota-http driver per plug with their respective ip-addresses.
Then, in reefpi-->configuration-->connectors-->Outlets add an outlet for each driver you just created, for pin just use 0.
Then in reefpi-->equipment add a piece of equipment for each outlet you just created.

Then you should get an on off switch per socket.


For the energeenie/silvershield/gembirds you first google "sispmctl" and install it on your pi from sourceforge
then create the following file "script.sh" in /home/pi/outlets/ on your pi
(or whatever your home directory on your pi is instead of /home/pi)

Code:
outD1=$(cat /home/pi/outlets/outD1)
outD2=$(cat /home/pi/outlets/outD2)
outD3=$(cat /home/pi/outlets/outD3)
outD4=$(cat /home/pi/outlets/outD4)

if [ "$outD1" = 1 ]
then
    sispmctl -o 1
else
    sispmctl -f 1
fi

if [ "$outD2" = 1 ]
then
    sispmctl -o 2
else
    sispmctl -f 2
fi

if [ "$outD3" = 1 ]
then
    sispmctl -o 3
else
    sispmctl -f 3
fi

if [ "$outD4" = 1 ]
then
    sispmctl -o 4
else
    sispmctl -f 4
fi

(not the most elegant code, but its simple and works)

then create four filedrivers in reefpi with the /home/pi/outlets/outD1 , outD2, outD3, outD4 files, and again connectors and equipment after that

then type crontab -e in the console of the pi and add the following line at the end and save:

Code:
* * * * * /bin/bash -c ' for i in {1..6}; do /home/pi/outlets/script.sh ; sleep 10; done'


This will run that script every 10 seconds, which is fine on a pi zero w. You can run it more often, then there'll be less delay when switching, but that might bog down the pi, probably not an issue if youve got one of the better ones though.

If youve got more than one of those powerbars, you could make more complicated sispmctl commands as listed on the sourceforge page and run multiple at the same time.
Thanks for the quick help, I'll try it out one day and report back if it worked.
 

nejohnson

New Member
View Badges
Joined
Feb 26, 2021
Messages
8
Reaction score
17
Location
Delaware, Ohio
Rating - 0%
0   0   0
Updated to 5.3 from 5.1 this morning, after the update, my ph is oscillating between proper value and 0. I've removed the ph entry and the driver, rebooted, and re-added, no change. Ph circuit was fairly reliable before the update. Any tips? Running on Robotank with the ph-ezo driver.

ph1.jpg
 

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,591
Reaction score
1,590
Rating - 0%
0   0   0
Updated to 5.3 from 5.1 this morning, after the update, my ph is oscillating between proper value and 0. I've removed the ph entry and the driver, rebooted, and re-added, no change. Ph circuit was fairly reliable before the update. Any tips? Running on Robotank with the ph-ezo driver.

ph1.jpg
Yeah that's new behavior with 5.3

It means that on 5.1 you had a bunch of missing data points that just vanished for various reasons, like for example intermittent interference and data corruption on the i2c line or somewhere else

If you had looked at the oh calibration menu at the time you would have seen some sort of error message popping up in the corner.
On 5.3 they no longer vanish or show as errors in calibration, but show as 0

Go into calibration menu and see if a 0 pops up from time to time, if so, wiggle your cables and see if you get it to stop

Otherwise, maybe start turning off stuff that has power lines in the vicinity and see if it stops

Also maybe turn down the rate of how often a value is requested, see if that helps
 
Last edited:

eggi55

Community Member
View Badges
Joined
Sep 18, 2022
Messages
63
Reaction score
52
Location
germany
Rating - 0%
0   0   0
hi elysics so I registered the nous a1t and set it up in reef-pi. Thanks a lot for this. I assume that the a1t are only for switching and cannot use the power consumed in the ree-pi?
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Yeah that's new behavior with 5.3

It means that on 5.1 you had a bunch of missing data points that just vanished for various reasons, like for example intermittent interference and data corruption on the i2c line or somewhere else

If you had looked at the oh calibration menu at the time you would have seen some sort of error message popping up in the corner.
On 5.3 they no longer vanish or show as errors in calibration, but show as 0

Go into calibration menu and see if a 0 pops up from time to time, if so, wiggle your cables and see if you get it to stop

Otherwise, maybe start turning off stuff that has power lines in the vicinity and see if it stops

Also maybe turn down the rate of how often a value is requested, see if that helps
ah.. we can address that easily, i think. there might be an graph option (connected dot for missing values)
 

Dan-

New Member
View Badges
Joined
Oct 17, 2022
Messages
3
Reaction score
3
Location
Metro West
Rating - 0%
0   0   0
Hello Everyone
I hope I have the correct thread to ask this question. I'm trying to add a stepper motor dose pump to reef-pi. I have the motor working on another pi with a DRS8825. Problem is whenever I try to add the motor to the Dosers section I get an error " The settings cannot be saved due to violation errors. Please correct the errors and try again.null" .
Has anyone else run into this? Any direction would be appreciated.
 

Attachments

  • Reef-pi stepper error.PNG
    Reef-pi stepper error.PNG
    99.5 KB · Views: 45

JachPot

Active Member
View Badges
Joined
Feb 12, 2022
Messages
444
Reaction score
665
Location
Colorado
Rating - 0%
0   0   0
Oh man, I'm running into an error and I'm not really sure where to gather the correct log.

I've got: https://www.robo-tank.ca/Sensors/Non-Contact-Liquid-Level-Water-Sensor-KXC-Y25-V-Arduino
as my sensor

my float switch:https://www.robo-tank.ca/Sensors/Reversible-Float-Switch

I turn on the ATO setup and turn it to the sensor. I have a DC 12v compatible pump from Amazon someone recommended to me here added to my equipment.


If I start the pi with all of those 3 things plugged in, it won't give me a web gui, it says it's connected to the wifi, but it seems to hang. If I unplug the sensor/motor it allows me to boot as normal. Leaving me without an ATO though.
 
Last edited:

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
985
Reaction score
1,325
Location
Edmonton, Canada
Rating - 0%
0   0   0
Updated to 5.3 from 5.1 this morning, after the update, my ph is oscillating between proper value and 0. I've removed the ph entry and the driver, rebooted, and re-added, no change. Ph circuit was fairly reliable before the update. Any tips? Running on Robotank with the ph-ezo driver.

ph1.jpg

There was a change made in reef-pi in v5.3, that's why you're getting this data. As @elysics mentioned it's from corrupt data over the I2C bus when reef-pi tries to read the pH circuit. My circuit requires I2C clock stretching but the Pi doesn't directly support that so the fix is to slow down the I2C bus a little so clock stretching isn't required, I'm guessing that's the problem.

To fix run the following command to edit the config.txt file.

sudo nano /boot/config.txt

That should have opened up a file. Using the arrow key on your keyboard go down until you see the following line.

dtparam=i2c_arm=on

Under that line type the following line.

dtparam=i2c_arm_baudrate=10000

Then press CTRL + S on the keyboard to save.

Then press CTRL + Z to exit.

Now type in the following command to reboot the Pi, after that it should be fixed going forward.

sudo reboot

@Ranjib something was changed in 5.3, prior to that it seems if an error occurred with an I2C reading it was possibly ignored, at least at the chart level. The first time I came across this I thought it was good as it indicates a problem however it possibly could be a problem if someone is controlling something based on the I2C device. I'm wondering if that happens would it set off an action based on an obvious false reading? I can only speak for my controller but when the I2C speed is set correctly that never seems to happen however with I2C that's always a possibility with any system especially in noisy environments. Not sure if you know what was updated to cause the new results, any chance something was catching I2C errors prior that's no longer doing so?
 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
985
Reaction score
1,325
Location
Edmonton, Canada
Rating - 0%
0   0   0
Oh man, I'm running into an error and I'm not really sure where to gather the correct log.

I've got: https://www.robo-tank.ca/Sensors/Non-Contact-Liquid-Level-Water-Sensor-KXC-Y25-V-Arduino
as my sensor

my float switch:https://www.robo-tank.ca/Sensors/Reversible-Float-Switch

I turn on the ATO setup and turn it to the sensor. I have a DC 12v compatible pump from Amazon someone recommended to me here added to my equipment.


If I start the pi with all of those 3 things plugged in, it won't give me a web gui, it says it's connected to the wifi, but it seems to hang. If I unplug the sensor/motor it allows me to boot as normal. Leaving me without an ATO though.
That's different, almost sounds like something is shorting out, if that happens the controller shuts down, does the power go out on it or just no wifi? Have you tried different combinations of those 3 items being plugged in to see if it's one of them? Do you have the non-contact sensor plugged in the correct port, it would be the one just above the green universal connector.
 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
985
Reaction score
1,325
Location
Edmonton, Canada
Rating - 0%
0   0   0
Hello Everyone
I hope I have the correct thread to ask this question. I'm trying to add a stepper motor dose pump to reef-pi. I have the motor working on another pi with a DRS8825. Problem is whenever I try to add the motor to the Dosers section I get an error " The settings cannot be saved due to violation errors. Please correct the errors and try again.null" .
Has anyone else run into this? Any direction would be appreciated.
That's likely due to an interface bug when it validates the data entered. Before you setup the stepper motor change the motor type option to "DC" and fill out the form as if you were going to use it. Then switch to "stepper" motor and after filling out it should save correctly and use the stepper settings.
 

Sral

Valuable Member
View Badges
Joined
May 2, 2022
Messages
1,006
Reaction score
978
Location
Germany
Rating - 0%
0   0   0
That's different, almost sounds like something is shorting out, if that happens the controller shuts down, does the power go out on it or just no wifi? Have you tried different combinations of those 3 items being plugged in to see if it's one of them? Do you have the non-contact sensor plugged in the correct port, it would be the one just above the green universal connector.
Also sounds similar to the issue I had with my Ethernet connector, which turned out to draw too much power for the PI to operate/boot correctly.

@JachPot What kind of power supply do you have and what equipment is powered by it ?
 

Dan-

New Member
View Badges
Joined
Oct 17, 2022
Messages
3
Reaction score
3
Location
Metro West
Rating - 0%
0   0   0
That's likely due to an interface bug when it validates the data entered. Before you setup the stepper motor change the motor type option to "DC" and fill out the form as if you were going to use it. Then switch to "stepper" motor and after filling out it should save correctly and use the stepper settings.
Thank you @robsworld78
 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
985
Reaction score
1,325
Location
Edmonton, Canada
Rating - 0%
0   0   0
Also sounds similar to the issue I had with my Ethernet connector, which turned out to draw too much power for the PI to operate/boot correctly.

@JachPot What kind of power supply do you have and what equipment is powered by it ?
Yeah good point, I should have thought of the power supply being the problem, I've seen a few issues similar due to weak power supply. @JachPot did you get the power supply from me? I have sent out a couple faulty ones so if I did send one it's certainly possible it's the problem.
 

nejohnson

New Member
View Badges
Joined
Feb 26, 2021
Messages
8
Reaction score
17
Location
Delaware, Ohio
Rating - 0%
0   0   0
There was a change made in reef-pi in v5.3, that's why you're getting this data. As @elysics mentioned it's from corrupt data over the I2C bus when reef-pi tries to read the pH circuit. My circuit requires I2C clock stretching but the Pi doesn't directly support that so the fix is to slow down the I2C bus a little so clock stretching isn't required, I'm guessing that's the problem.

To fix run the following command to edit the config.txt file.

sudo nano /boot/config.txt

That should have opened up a file. Using the arrow key on your keyboard go down until you see the following line.

dtparam=i2c_arm=on

Under that line type the following line.

dtparam=i2c_arm_baudrate=10000

Then press CTRL + S on the keyboard to save.

Then press CTRL + Z to exit.

Now type in the following command to reboot the Pi, after that it should be fixed going forward.

sudo reboot

For anyone else running up against this problem, Rob's suggestion resolved the issue.
 

Dan-

New Member
View Badges
Joined
Oct 17, 2022
Messages
3
Reaction score
3
Location
Metro West
Rating - 0%
0   0   0
Still having problems
I did as you recommended and created a DC pump and then changed it to a stepper and there were no errors.
However I am unable to get the motor to run. I tried calibrating it and selecting run but the motor just sits there idle.
I've looked for instructions on how to make this work but have come up empty. I know I have it electrically connected correctly as I am able to run the motor with a python script on same pi with standard pi image.
What am I missing? :)
 

JachPot

Active Member
View Badges
Joined
Feb 12, 2022
Messages
444
Reaction score
665
Location
Colorado
Rating - 0%
0   0   0
Yeah good point, I should have thought of the power supply being the problem, I've seen a few issues similar due to weak power supply. @JachPot did you get the power supply from me? I have sent out a couple faulty ones so if I did send one it's certainly possible it's the problem.
Yeah PSU was from you, It's been good so far. I was thinking maybe I was drawing too much current with the 12v pump? I wasn't sure how much can actually go out through the pi ports. I had a wedding to rush to this weekend, so I wasn't able to investigate yet.
 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
985
Reaction score
1,325
Location
Edmonton, Canada
Rating - 0%
0   0   0
Still having problems
I did as you recommended and created a DC pump and then changed it to a stepper and there were no errors.
However I am unable to get the motor to run. I tried calibrating it and selecting run but the motor just sits there idle.
I've looked for instructions on how to make this work but have come up empty. I know I have it electrically connected correctly as I am able to run the motor with a python script on same pi with standard pi image.
What am I missing? :)
Sorry I'm not really sure, I haven't used this feature yet. Looking at the picture you posted things look ok however the "delay" field looks to have a large value, not sure what that does though. Maybe @Ranjib can take a look at the settings.
 
Last edited:
Back
Top