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

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,409
Reaction score
1,726
Location
Missouri
Rating - 0%
0   0   0
Just tested the doser, mine comes on every 5min after the hour, I shut down reefpi during its dosing schedule and it kept running when reefpi was shutdown, scramble to get a container to capture output. I then pulled the power to reefpi which also feeds reef-pi, doser stopped. Note to self, pull power in the future when testing, lol.

When applied power back to reef-pi and it booted up the doser module did not resume, it remained off. This is anecdotal testing and I am running v3.3 and not the latest code so take it for what its worth, will have to think about if there is anything additional that could make things more robust but in both cases, timers and dosers appear to behave on power restore.

:)
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Just thought Id throw this here, a raspberry pi 4b 2gb version combined with a tp-link UE300 usb3.0 to ethernet dongle makes on heck of a great router/firewall with a small footprint and low power use.
Im routing gigabit internet with sqm qos, adguard, ban IP and ddns along with wireguard VPN so I can access my network from the outside securely and it doesnt even break a sweat. Now can just use my existing wireless routers as access points and let the raspberry pi handle the routing work. So far its the best router firewall ive used short of a dedicated PF sense box.
Very nice. I’ve been using a pi 3 for ad blocking (pi hole) , and it’s been awesome
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Just tested the doser, mine comes on every 5min after the hour, I shut down reefpi during its dosing schedule and it kept running when reefpi was shutdown, scramble to get a container to capture output. I then pulled the power to reefpi which also feeds reef-pi, doser stopped. Note to self, pull power in the future when testing, lol.

When applied power back to reef-pi and it booted up the doser module did not resume, it remained off. This is anecdotal testing and I am running v3.3 and not the latest code so take it for what its worth, will have to think about if there is anything additional that could make things more robust but in both cases, timers and dosers appear to behave on power restore.

:)
The macro behavior is rooted in the timers. So timers will behave same. I think the outlet will stay on, since at the time of crash it was on,.

I’m thinking of a feature that will disable reef-pi to do the one time sync on boot up, and let individual module take care of things
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Just tested the equipment control with separate timers for on and off, set the timer turn on and then had a timer set 2 min later to turn off. When the first timer fired I shutdown reefpi from the OS, and left it off past the off timer. I restored power and it initially came on when things rebooted but as in the other thread about a minute later ( I didn't time it) the outlet turned off. I was watching journalctl and it stated:

that was the outlet controlling the pump and shut it off. So it appears that it does store the default state and returns it to that state on a reboot. I do not have the dosing module set up on my frag tank so I am unable to test it, but my concern on the dosing module is it pumps out much faster and even if it ran for a minute or so that could spike my PH since I am dosing Kalk. Will be interesting to hear from @Ranjib expected behavior for the dosing module, if it works differently than the outlets I will have to purchase a couple more BRS pumps, they are slow @1.1ml/min but for my small tanks that provides more breathing room for things like this.

:)
The behavior should be same as the timer.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Just tested the doser, mine comes on every 5min after the hour, I shut down reefpi during its dosing schedule and it kept running when reefpi was shutdown, scramble to get a container to capture output. I then pulled the power to reefpi which also feeds reef-pi, doser stopped. Note to self, pull power in the future when testing, lol.

When applied power back to reef-pi and it booted up the doser module did not resume, it remained off. This is anecdotal testing and I am running v3.3 and not the latest code so take it for what its worth, will have to think about if there is anything additional that could make things more robust but in both cases, timers and dosers appear to behave on power restore.

:)
Shutdown and direct power cutoff are two different scenario. In shutdown reef-pi will execute standard life cycle hooks, including stopping timers.
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,409
Reaction score
1,726
Location
Missouri
Rating - 0%
0   0   0
The macro behavior is rooted in the timers. So timers will behave same. I think the outlet will stay on, since at the time of crash it was on,.

I’m thinking of a feature that will disable reef-pi to do the one time sync on boot up, and let individual module take care of things
I tested timers and doser and timer came back on for about a minute then shut off, the doser stayed off. I'd like to feel a little more secure about things and if you say they might not I need to figure out mitigations.
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,409
Reaction score
1,726
Location
Missouri
Rating - 0%
0   0   0
Shutdown and direct power cutoff are two different scenario. In shutdown reef-pi will execute standard life cycle hooks, including stopping timers.
Ah ok, I never just like pulling the plug, so I guess I need to do more testing but based on what you are stating timers/dosing and power outages are not a good thing, ugh.

:)
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
This is a great discussion. I take failsafes very seriously because of frequent power and or internet outtages. Some things that help right now in my case:

1. Adding a Real time clock...this allows the pi to keep time if it reboots when the internet is down.

2. Equipment outlets...i used a relay module so I have normally open and normally closed contacts on each relay. If I want something to fail in the ON position if reef pi is down, I wire the outlet to the normally closed contact. If I want it to fail in the OFF position, I wire the outlet to a normally open contact.

3. Redundancy. Dont rely on one system or sensor for very important systems. This also goes along with what i did for equipment outlets. A great example is heaters. Running a heater without a thermostat with reef pi as exclusive control is asking for trouble. I use heaters with thermostats set for 80. They plug into equipment outlets that are wired on normally closed relay contacts. If reef pi fails, heaters work as normal and keep tank at 80. If reef pi is up and running, it controls my heaters and tank runs at 79.

The problem is that some of the other systems that reef pi can control, need some type of failsafe, or ability to set a default state. Things that can be hardwired to achieve this are best served by doing it that way, thinga that can not need some type of setting for a default state.
+100, this is an awesome topic. I’m taking notes, whatever comes out of it, I’ll translate into software features. As of now , default equipment state on startup is something I’m thinking of.
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,409
Reaction score
1,726
Location
Missouri
Rating - 0%
0   0   0
+100, this is an awesome topic. I’m taking notes, whatever comes out of it, I’ll translate into software features. As of now , default equipment state on startup is something I’m thinking of.
I like the idea of a default state, would be nice for that to work for dosers also. Basically equipment or dosers I would always want to default to off on a reboot etc...making me nervous now knowing how it works not sure what I can do to minimize the risk, UPS is only good for a period of time unless I tie it in somehow and do a shutdown of reefpi but then I would also have to have it cut the power to the outlet. I didnt want to go down the route with adding Kalk to my ATO and was using a dosing pump to control it, more defined but the power outage concerns me, it only runs for 14sec per hour but it would be my luck that it happens in that window, lol.

:)
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,409
Reaction score
1,726
Location
Missouri
Rating - 0%
0   0   0
Just tested the doser again by pulling the power, my doser power is also the same power that feeds my PI and is connected to an always on outlet on the DJ strip. I pulled the power while it was dosing, left it off for a couple of minutes and restored power. Doser module did not come back online and dose, lights came back online etc. I will also test this with my frag tank which is using timers and see it exhibits a different behavior. I can see where the timer would come back on a stay on though since the off timer has passed. My initial thought is to set an off timer that runs every minute and is essentially always turning the outlet off outside of the one window(s) that I want to run, ugly but I cannot think of another option right now.

:)
 

Boostable

Active Member
View Badges
Joined
May 17, 2011
Messages
227
Reaction score
136
Location
Lake Mary, FL
Rating - 0%
0   0   0
+100, this is an awesome topic. I’m taking notes, whatever comes out of it, I’ll translate into software features. As of now , default equipment state on startup is something I’m thinking of.
Default state would be ideal in a lot of these scenarios i would think. Fail/Open, Fail/Closed, etc. If I remember correctly that is how APEX did it in the old system, and I assume still do it in the current models.

Just tested the doser again by pulling the power, my doser power is also the same power that feeds my PI and is connected to an always on outlet on the DJ strip. I pulled the power while it was dosing, left it off for a couple of minutes and restored power. Doser module did not come back online and dose, lights came back online etc. I will also test this with my frag tank which is using timers and see it exhibits a different behavior. I can see where the timer would come back on a stay on though since the off timer has passed. My initial thought is to set an off timer that runs every minute and is essentially always turning the outlet off outside of the one window(s) that I want to run, ugly but I cannot think of another option right now.

:)

Tom, Im surprised given the way states are written that it didn't come on, I would of thought it would return to an on condition..hmm I am using the DJ strip as well, I assume you are using the #9 always on outlet? Makes me wonder when the DB learned of the state change of the doser power and when it changed. Question are you pulling the power for the doser from an "outlet" or are you pulling power from the Pi (12v) for the doser?
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,409
Reaction score
1,726
Location
Missouri
Rating - 0%
0   0   0
Default state would be ideal in a lot of these scenarios i would think. Fail/Open, Fail/Closed, etc. If I remember correctly that is how APEX did it in the old system, and I assume still do it in the current models.



Tom, Im surprised given the way states are written that it didn't come on, I would of thought it would return to an on condition..hmm I am using the DJ strip as well, I assume you are using the #9 always on outlet? Makes me wonder when the DB learned of the state change of the doser power and when it changed. Question are you pulling the power for the doser from an "outlet" or are you pulling power from the Pi (12v) for the doser?
I feed my doser module from the same 12v supply that I feed my pi with, it actually is split and I feed multiple things requiring power, pi, doser and the outlet relays. I use a @Michael Lane hat so it requires power for the relays and the pi and then I have the dosing module, all power comes from the same source. I am using the always on outlet for the 12v source.

:)
 

Mikeneedsahobby

Well-Known Member
View Badges
Joined
Sep 16, 2018
Messages
516
Reaction score
916
Rating - 0%
0   0   0
I have not been able to get an ATO to trigger a Macro. I think this is what you are seeing and thinking the system is hanging
I was able to get an ato to trigger a macro today.

the ato is set to trigger the macro. Check frequency is 10 seconds. One shot is disabled.

the macro is set to reverse and written backwards. It is a single step stated to turn off dosing pump. This action actually turns on the dosing pump.

the dosing pump is set to run for 30seconds at 50% speed. I have all schedule parameters set to “*”.

The result is it functions in the manner I desire. When the float sensor is low the dosing pump turns on. It shuts off when the float sensor is high.
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,409
Reaction score
1,726
Location
Missouri
Rating - 0%
0   0   0
Is there any reason that I can't get creative with cron to always turn equipment off, something like this?

doser-Mg.png

Basically the idea would be to have the cron always turn off the outlet outside of the dosing window. I have this setup now but have not tested, I did not get an error when I saved it. Whats the best way to verify that the cron entries are executing, I am watching journalctl but do not see any entry for them.

Thanks :)
 

drbogger

Active Member
View Badges
Joined
Apr 24, 2019
Messages
165
Reaction score
126
Location
Ballston Spa, New York
Rating - 0%
0   0   0
I was able to get an ato to trigger a macro today.

the ato is set to trigger the macro. Check frequency is 10 seconds. One shot is disabled.

the macro is set to reverse and written backwards. It is a single step stated to turn off dosing pump. This action actually turns on the dosing pump.

the dosing pump is set to run for 30seconds at 50% speed. I have all schedule parameters set to “*”.

The result is it functions in the manner I desire. When the float sensor is low the dosing pump turns on. It shuts off when the float sensor is high.

What if you try to use one ATO to turn on another ATO?

I'm trying to make it so my ATO Reservoir is automatically refilled.
The Reservoir has 2 float switch, a low and a high.

Once the water falls below the LOW sensor i want it to turn on a solenoid and turn it off once the water reaches the HIGH float switch.

How do I make this happen???
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,409
Reaction score
1,726
Location
Missouri
Rating - 0%
0   0   0
What if you try to use one ATO to turn on another ATO?

I'm trying to make it so my ATO Reservoir is automatically refilled.
The Reservoir has 2 float switch, a low and a high.

Once the water falls below the LOW sensor i want it to turn on a solenoid and turn it off once the water reaches the HIGH float switch.

How do I make this happen???
There may be some others that have a better answer but if the floats are in series then no way I know how to do it, typically the 2 float setup is for a backup cut off in case the first float gets stuck in the on position, basically either float will turn off the water.

I removed my suggestion I am not sure what the best method is, I would suggest getting a meter and playing with some floats until you get them working how you want them to, keep in mind about fail safes so you don't overflow.
 

drbogger

Active Member
View Badges
Joined
Apr 24, 2019
Messages
165
Reaction score
126
Location
Ballston Spa, New York
Rating - 0%
0   0   0
There may be some others that have a better answer but if the floats are in series then no way I know how to do it, typically the 2 float setup is for a backup cut off in case the first float gets stuck in the on position, basically either float will turn off the water. I think in your case you would need to wire the floats up in parallel mode which would require both of them to cut things off. That is my best guess and only a guess, I'm sure others will chime in but you might want to google float switches parallel vs serial.

No, I have both float switches wired separately to the reef-pi. They run individually.

I just can't figure out how to do this.
 

Mikeneedsahobby

Well-Known Member
View Badges
Joined
Sep 16, 2018
Messages
516
Reaction score
916
Rating - 0%
0   0   0
What if you try to use one ATO to turn on another ATO?

I'm trying to make it so my ATO Reservoir is automatically refilled.
The Reservoir has 2 float switch, a low and a high.

Once the water falls below the LOW sensor i want it to turn on a solenoid and turn it off once the water reaches the HIGH float switch.

How do I make this happen???
First I ask why not the simple solution. Remove the low sensor. Just use the high sensor as a normal ato. This will keep for reservoir always full.

if you need the reservoir to empty before refilling this is what I can think of. Set the low sensor to turn on when water is low. Set an ato to watch the low sensor and trigger a macro. Have the macro turn on a second ato then wait some time and shut the second ato off. The second ato is watching the high sensor and triggering the full pump. The wait time of the macro should be just a little longer than the time required to fill the reservoir.
 

drbogger

Active Member
View Badges
Joined
Apr 24, 2019
Messages
165
Reaction score
126
Location
Ballston Spa, New York
Rating - 0%
0   0   0
First I ask why not the simple solution. Remove the low sensor. Just use the high sensor as a normal ato. This will keep for reservoir always full.

if you need the reservoir to empty before refilling this is what I can think of. Set the low sensor to turn on when water is low. Set an ato to watch the low sensor and trigger a macro. Have the macro turn on a second ato then wait some time and shut the second ato off. The second ato is watching the high sensor and triggering the full pump. The wait time of the macro should be just a little longer than the time required to fill the reservoir.

I can't do that because it will short cycle the RO Filter, causing a lot of TDS Creep.
 

TOP 10 Trending Threads

WHAT AMOUNT OF LIVE ROCK AND SAND SHOULD BE PRIORITIZED FOR OPTIMAL BIODIVERSITY/FILTRATION?

  • 100% live rock + bagged sand

    Votes: 38 26.6%
  • 100% dry rock + 100% live sand

    Votes: 48 33.6%
  • 50/50 live/dry rock, 50/50 live/bagged sand

    Votes: 32 22.4%
  • 75% live rock, 25% live sand

    Votes: 15 10.5%
  • 25% live rock, 75% live sand

    Votes: 10 7.0%
Back
Top