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

Des Westcott

Well-Known Member
View Badges
Joined
May 29, 2018
Messages
646
Reaction score
1,025
Location
Durban - South Africa
Rating - 0%
0   0   0
Also, there is no way to stop a Macro from running once it has been started. Previously, when Macro's were first introduced, this function was there, but was pulled. Personally, I liked the ability to stop a Macro from the Macro UI if I felt there was a problem.
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,811
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.
 

InactiveAcct

Well-Known Member
View Badges
Joined
Dec 2, 2019
Messages
520
Reaction score
501
Rating - 0%
0   0   0
Hey everyone, looking for a little help with the ph setup. When I add it I get an error that an input is missing and the ability to calibrate it is grayed out.

here’s how I’ve been setting it up:
1. Add ezo ph driver with the default 68
2. Add analog ph connector with pin 0
3. Go to ph and add the ph connector

I added my circuit below if you feel that may be the source of the issue. After buying everything I realized I’m not following best practices for noise isolation but I’d still expect it to show up.

Thanks in advance!



A0479318-FF35-4FD0-8B91-61979C1724E7.jpeg
 

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
2,253
Reaction score
3,603
Location
Sacramento, CA area
Rating - 0%
0   0   0
For those using the unofficial Apt sources for Reef-Pi, I've (finally) added Buster as an allowed distro:

Instructions for using here:

The packages shipped are identical to https://github.com/reef-pi/reef-pi/releases, up to 4.1.

The key has also been updated to 8AB22E718C78D3B02792817C91259A65F101BCF3 (rsa4096)
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,409
Reaction score
1,726
Location
Missouri
Rating - 0%
0   0   0
Want to talk dosing and power outages, I've got to scenarios that I am looking at and I want to make sure they are solid or as good as I can get. I have one reefpi running a dosing unit and is configured under the doser tab, runs every hour for about 15sec. I have another reefpi that is controlling BRS dosers that are controlled by a timer or a Macro. I've seen the question ask before but I want to verify that timers with an on/off scheduled behave. If I am running the BRS doser, currently I have one running for 9min, if I loose power during that time frame and it stays off for 30min etc, what will the state be when power is restored? To make sure its clear, I kick off a timer for x minutes, halfway during I loose power, power is off for 30min or more and then restored. Reefpi boots back up, will the timer that had started turn off since the time has passed?

I know if you are running a macro and you have a wait state then it would loose that state, but what about a standard timer? What happens to the state for a doser that was running when a power outage strikes?

I can think of creating a timer that runs every minute outside of your dosing timer to turn the pump back off but that seems like a lot of work, but I'd rather not have a pump that is running constantly after power returns.

Thanks :)
 

zab34

Active Member
View Badges
Joined
Jan 23, 2012
Messages
354
Reaction score
72
Location
Orlando
Rating - 0%
0   0   0
@Michael Lane

Hi.

Just looking for a little guidance here. Recently installed the marsaqua led board in my fixture. When hooked up to the reefpi, I am able to dim the fixture with no issues. But when I get down to zero, neither circuit turns off it still looks the same as about 5-10%. Any thoughts?
@Ranjib

any ideas here?
 

zab34

Active Member
View Badges
Joined
Jan 23, 2012
Messages
354
Reaction score
72
Location
Orlando
Rating - 0%
0   0   0
Not sure if you have read through this thread, but if not it may have some useful information - Mars-Aqua

I have one of the boards but do not have a mars-aqua to test with, hoping it has some information in it that will help.

:)
The only thing I’m seeing is a recommended freq of 1.5 kHz. The default pwm is set to 100, not sure on the unit of measure on that.
 

drbogger

Active Member
View Badges
Joined
Apr 24, 2019
Messages
165
Reaction score
126
Location
Ballston Spa, New York
Rating - 0%
0   0   0
- The check frequency is 120 seconds.

- I tried the macro in reverse, and forward mode.

- it takes about an hour to fill, but it won't start filling unless the macro turns on the other ATO sensor (which it never does).

- how do I get the logs?

- the macro works fine if I run it manually or by using a timer. Seems to be just the ATO controller causing the issue.

- It's not a full system hang, the UI will still load, but it won't let me edit the ATO settings until I delete the Macro & ATO entirely, then I have to reload reef-pi twice (yes, twice).

The macro just never runs. It just hangs until I delete it.

@Ranjib any ideas on my ATO/Macro issue?
 

Boostable

Active Member
View Badges
Joined
May 17, 2011
Messages
227
Reaction score
136
Location
Lake Mary, FL
Rating - 0%
0   0   0
Want to talk dosing and power outages, I've got to scenarios that I am looking at and I want to make sure they are solid or as good as I can get. I have one reefpi running a dosing unit and is configured under the doser tab, runs every hour for about 15sec. I have another reefpi that is controlling BRS dosers that are controlled by a timer or a Macro. I've seen the question ask before but I want to verify that timers with an on/off scheduled behave. If I am running the BRS doser, currently I have one running for 9min, if I loose power during that time frame and it stays off for 30min etc, what will the state be when power is restored? To make sure its clear, I kick off a timer for x minutes, halfway during I loose power, power is off for 30min or more and then restored. Reefpi boots back up, will the timer that had started turn off since the time has passed?

I know if you are running a macro and you have a wait state then it would loose that state, but what about a standard timer? What happens to the state for a doser that was running when a power outage strikes?

I can think of creating a timer that runs every minute outside of your dosing timer to turn the pump back off but that seems like a lot of work, but I'd rather not have a pump that is running constantly after power returns.

Thanks :)
Tom,

I think you are correct in your thinking and unless things have changed in regards to the way states are written to the DB, it will restart in an open or active state and run your dosing pump. Scary stuff...

Really need a default state option to be sure things reset themselves. Perhaps the the timer/macro option could write to a temp table outside of the DB or a simple file while they are running and clean it up after completion.

Perhaps I am wrong but I don't recall seeing any changes to the way or when states are written.
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,409
Reaction score
1,726
Location
Missouri
Rating - 0%
0   0   0
Tom,

I think you are correct in your thinking and unless things have changed in regards to the way states are written to the DB, it will restart in an open or active state and run your dosing pump. Scary stuff...

Really need a default state option to be sure things reset themselves. Perhaps the the timer/macro option could write to a temp table outside of the DB or a simple file while they are running and clean it up after completion.

Perhaps I am wrong but I don't recall seeing any changes to the way or when states are written.
I know macro's are not the way to go but I thought that timers were different, just want to verify how they should operate if a timer kicks off and then you loose power past when the off timer would execute. Kind of wondering about the Doser routines also, the window for my dosers are much smaller since they are much faster.

Yeah automation also comes with pitfalls, just trying to figure out now how to make it as resilient as I can get it, not sure how the Apex would handle the same event. Not sure how the states are written and how it handles a state that was missed like a timer that should have gone off but was powered off. I have a spare PI and some hardware to test but sheesh so little time, lol.

I found this thread from last month and it seems to imply that timers would work properly but just wanting to verify and see how that applies to the dosing section, Timers

And to be clear I have 2 timers, one ON timer at 1200 and an OFF timer at 1209, if I loose power say at 1205 and then power comes back on at 1220, will the equipment keep running or turn off or stay off? I would like to know how that same scenario would apply to a dosing cron job.

Thanks :)
 
Last edited:

Boostable

Active Member
View Badges
Joined
May 17, 2011
Messages
227
Reaction score
136
Location
Lake Mary, FL
Rating - 0%
0   0   0
I know macro's are not the way to go but I thought that timers were different, just want to verify how they should operate if a timer kicks off and then you loose power past when the off timer would execute. Kind of wondering about the Doser routines also, the window for my dosers are much smaller since they are much faster.

Yeah automation also comes with pitfalls, just trying to figure out now how to make it as resilient as I can get it, not sure how the Apex would handle the same event. Not sure how the states are written and how it handles a state that was missed like a timer that should have gone off but was powered off. I have a spare PI and some hardware to test but sheesh so little time, lol.

I found this thread from last month and it seems to imply that timers would work properly but just wanting to verify and see how that applies to the dosing section, Timers

:)
I hear ya... I am the same, I need backups for my backups, lol I run the the Pi on a UPS and was thinking about using a simple relay to monitor power in a hold open state and tie that to an input on the pi and have it trigger a macro to change all my outlets to default states should power fail. I have not tested this yet, but seems like it should work and at least give me the proper conditions once power is restored. Thoughts?
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,409
Reaction score
1,726
Location
Missouri
Rating - 0%
0   0   0
I hear ya... I am the same, I need backups for my backups, lol I run the the Pi on a UPS and was thinking about using a simple relay to monitor power in a hold open state and tie that to an input on the pi and have it trigger a macro to change all my outlets to default states should power fail. I have not tested this yet, but seems like it should work and at least give me the proper conditions once power is restored. Thoughts?

Eh I try to keep things as simple as possible, the more complex you make things the more things can go wrong. What I would like for equipment/outlets would be to have a default state that would be read after a reboot. That way you could set the default state to how you want an outlet set after booting. I guess I can go test and see how it operates...
 

Boostable

Active Member
View Badges
Joined
May 17, 2011
Messages
227
Reaction score
136
Location
Lake Mary, FL
Rating - 0%
0   0   0
Eh I try to keep things as simple as possible, the more complex you make things the more things can go wrong. What I would like for equipment/outlets would be to have a default state that would be read after a reboot. That way you could set the default state to how you want an outlet set after booting. I guess I can go test and see how it operates...
Default state is an absolute must, but we are gonna need some additional fail-safe until then. Simple 1 or 0's right..
 

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 is an absolute must, but we are gonna need some additional fail-safe until then. Simple 1 or 0's right..
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:
Euipment: 6 On: false
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.

:)
 
Last edited:

Des Westcott

Well-Known Member
View Badges
Joined
May 29, 2018
Messages
646
Reaction score
1,025
Location
Durban - South Africa
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.

:)
I'm following this train of discussion with great interest. I have been thinking about this in general for some time now and been wondering how best to address it. Here in South Africa, we have regular power cuts due to power generation shortfalls. Sometimes up to 3 x sessions of 2 hours a day for up to a week. I've had pi's lose their IP address a few times. I've only recently started using the Dosing feature, but feel the risk of something going wrong while a Doser is dispensing is relatively low in my case. I dose small quantities often throughout the day. I also time the dosing so the chance of being caught in the middle of a dose is less (Our schedules run on the hour) so all my doses happen at minute 25, second 45). None of this will help during an unplanned outage of course, but I feel it's a start.

None of my timers run anything that could dose / add any thing that could cause a problem. My kalk is added through my ATO, so as long as my level is stable, that is fine. Timers control feeding / pump scheduling / certain lights.

However, I have been thinking that a UPS on just the Reef-Pi is a very good idea. Just to keep the Pi alive and stable and to not lose track of things like timers / dosers etc. I also had the idea like mentioned above to monitor the state of a relay to tell if power was on or off and take action. Currently this would have to set up as an ATO with the relay acting as a float switch and then Reef-Pi would have to run a Macro which we know it wont do at the moment. With the Alert feature in Macros you would also be able to get notification of power having gone down as well (Provided your router is still online) - Maybe a small GSM module for this?? I recently came across this sim card deal which might be ideal for this kind of thing. GSM Global Sim - Data for Life - Once-Off Fee (robotics.org.za) I'm sure there are other services like that.

Anyway, I'll be interested to see what ideas come out of this discussion and what the best solutions are, but I think the best two options are 1) keeping the Pi alive for as long as feasible and 2) Making sure Reef-Pi has the failsafes built in or configurable.

And, yes. I know making the suggestions is the easy part. I really do appreciate the people that have to take these suggestions and apply the dark art of writing the code to make it work.
 
Last edited:

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,811
Rating - 0%
0   0   0
I'm following this train of discussion with great interest. I have been thinking about this in general for some time now and been wondering how best to address it. Here in South Africa, we have regular power cuts due to power generation shortfalls. Sometimes up to 3 x sessions of 2 hours a day for up to a week. I've had pi's lose their IP address a few times. I've only recently started using the Dosing feature, but feel the risk of something going wrong while a Doser is dispensing is relatively low in my case. I dose small quantities often throughout the day. I also time the dosing so the chance of being caught in the middle of a dose is less (Our schedules run on the hour) so all my doses happen at minute 25, second 45). None of this will help during an unplanned outage of course, but I feel it's a start.

None of my timers run anything that could dose / add any thing that could cause a problem. My kalk is added through my ATO, so as long as my level is stable, that is fine. Timers control feeding / pump scheduling / certain lights.

However, I have been thinking that a UPS on just the Reef-Pi is a very good idea. Just to keep the Pi alive and stable and to not lose track of things like timers / dosers etc. I also had the idea like mentioned above to monitor the state of a relay to tell if power was on or off and take action. Currently this would have to set up as an ATO with the relay acting as a float switch and then Reef-Pi would have to run a Macro which we know it wont do at the moment. With the Alert feature in Macros you would also be able to get notification of power having gone down as well (Provided your router is still online) - Maybe a small GSM module for this?? I recently came across this sim card deal which might be ideal for this kind of thing. GSM Global Sim - Data for Life - Once-Off Fee (robotics.org.za) I'm sure there are other services like that.

Anyway, I'll be interested to see what ideas come out of this discussion and what the best solutions are, but I think the best two options are 1) keeping the Pi alive for as long as feasible and 2) Making sure Reef-Pi has the failsafes built in or configurable.

And, yes. I know making the suggestions is the easy part. I really do appreciate the people that have to take these suggestions and apply the dark art of writing the code to make it work.
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.
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,409
Reaction score
1,726
Location
Missouri
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.
I agree with what both of you are saying and @Bigtrout I am pretty much setup the same way you are, I have 2 strips, one is normally closed and one is normally open, although I am not using a RTC. The problem I have is when outlets are triggered with a timer or the dosing module. So an outlet that is triggered and you loose power after the time has elapsed. When reef-pi comes back online the additional timer will not have fired. Timers appear to work, he must write the default state in the DB and replays them when they come back online, at least that is what my simple one test showed. However I am not sure with the dosing module if it would be the same operation, dosing pump is going, loose power, period of time elapses and power is restored. When reefpi is booted back up will the dosing module continue to dose, I don't want it to but I honestly dont know and I guess I should try and see what happens but i'd have to do it on my main tank and a little leary of doing it, but I guess I should.

:)
 

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.8%
  • 100% dry rock + 100% live sand

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

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

    Votes: 14 9.9%
  • 25% live rock, 75% live sand

    Votes: 10 7.0%
Back
Top