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

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
I’ve been playing with different type of backup power sources for reef-pi this year. Due to climate change and california Wilde fire season , I think every year we’ll have more sever and frequent power outages for foreseeable feature.
i benchmarked a bunch of powerbank , mobile charger etc in the past. They are not bad , can run just the pi along with sensors etc for almost two to three days .

last week , i was thinking why not try out the Ryobi batteries ? I have a handful of those , since I use a whole bunch of Ryobi tools , from lead blower to trim router that runs on them. I have almost 8 batteries and some of them are 4/6 ah should be pretty good.
So I started testing. I have one of these Ryobi light that uses non-led/filament style bulb and the bulb was broken. I didn’t like this light , and got a different led light (ryobi), hence This is perfect for all experiments. I am using it for battery connections (could be easily changed with a 3D printer alternative). I have hooked up an lm2596 converter to step down the 18v coming from battery to 5.21 v.
Results; reef-pi on pi zero without anything else runs almost 2 days with the 3ah batteries . I’m planing to test test out the 6ah batteries next. I’ll be super delighted if they run for several days.
btw, there 3.2 or 5v submersible pump and air stones that could also be used with similar setup. in real life cases I am likely to run both controller as well as pump/air stone..
D1297753-4B1E-47A4-9563-F9504270715B.jpeg


98C55168-A445-42B0-B74F-B1C67376C183.jpeg
Yeah I had a power outage the other day, we don't have them often but makes you think about getting a better backup plan. I saw where @Bigtrout was out for sometime, the problem I have is if it's in the summer I can run a long time on my UPS batteries, I have 2 1400VA APC that I have on my work bench that I can move and power things. But if it happens when its winter I have to run my heaters and even though it's only a 100w it chews through the batteries at a much faster clip. Need to come up with something that I can run my return pump and heater for a long period of time, but all the options I come up with are not cheap. :(
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
Added a PH y probe this evening, what is everyone running for the check frequency for PH, 60secs or something else?

Thanks :)
 
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
Added a PH y probe this evening, what is everyone running for the check frequency for PH, 60secs or something else?

Thanks :)
I run it at at 60s interval. I don’t see any implications even if I run at 300s interval.
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
I run it at at 60s interval. I don’t see any implications even if I run at 300s interval.
Thanks for the reply, thats what I went with and so far this probe appears to be working much better than my last one, hopefully its a keeper.

:)
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
Mine checks every 320 seconds (5 minutes). Previously I had it check every 60 seconds but I don't really see the need.
My only concern about the frequency is I am wanting to use it as a failsafe for my Kalk doser, if PH rises over 8.4 (or whatever I have set) I want it to turn of the doser (in case it never turns off etc) and notifiy me. I have a lot to play with in regards to Kalk dosing so not sure how much dose will raise the PH in a given time. Once I see how it normally acts then I may be able to extend the frequency check.

:)
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
Now that I look at it, is it possible to turn off a doser (not an outlet but a 4 head dosing pump via @Michael Lane dosing module based on a PH reading? I could have sworn I have read that you can do that but right now I'm not sure I see how it can be done.

Thanks :)

Update, looks like the PH can control equipment and a macro which then with the macro I could disable the doser, are there any issues with doing it that way?

Thanks a second time :)
 
Last edited:

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,591
Reaction score
1,590
Rating - 0%
0   0   0
Now that I look at it, is it possible to turn off a doser (not an outlet but a 4 head dosing pump via @Michael Lane dosing module based on a PH reading? I could have sworn I have read that you can do that but right now I'm not sure I see how it can be done.

Thanks :)
If that's run via the dosing pump menu of reef-pi, then you can turn on and off individual dosing channels with macros. When creating a macro select doser, then the channel you want, then whether to turn it on or off. And then use that macro as a response to the ph reading.
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
If that's run via the dosing pump menu of reef-pi, then you can turn on and off individual dosing channels with macros. When creating a macro select doser, then the channel you want, then whether to turn it on or off. And then use that macro as a response to the ph reading.
Yup just saw it when looked at it again, the only downside I see for me using 3.x version is that it requires you to have a low side function also. I'n my case I just want to protect from High PH when dosing Kalk and really do not need a low side function since it will already alert me if its low or high. To solve that issue I just created a dummy macro with a wait input and assigned that, need to do some more testing but think that should work. I know Kalk is very concentrated but not sure if adding 10ml and hour will cause the PH to do much but with a probe I at least can watch and make sure that it plays nice.

:)
 

sfgabe

Active Member
View Badges
Joined
Sep 7, 2018
Messages
172
Reaction score
264
Rating - 0%
0   0   0
Glad I could help confuse you. :D
I'll update my build thread with MQTT info when I update my reef-pi installations.
Hey @Ranjib I'm trying to setup MQTT and getting the following error

Code:
{"error":"json: cannot unmarshal string into Go struct field MQTTConfig.mqtt.retained of type bool"} | HTTP 400

Any clues?
 

sfgabe

Active Member
View Badges
Joined
Sep 7, 2018
Messages
172
Reaction score
264
Rating - 0%
0   0   0
Hey @Ranjib I'm trying to setup MQTT and getting the following error

Code:
{"error":"json: cannot unmarshal string into Go struct field MQTTConfig.mqtt.retained of type bool"} | HTTP 400

Any clues?
For anyone else getting this, the trick is to enable prometheus, save config, reload, refresh, THEN add mqtt details in the telemetry tab. I think it was trying to add parameters before it set them up.

For reference here are some of the topics i am getting - note that they are using the "name" convention and not the api convention:

- "ato_float_sensor_state"
- "equipment_dummy_ato_state"
- "ato_float_sensor_usage"
- "ato_ato_float_state"
- "ato_ato_float_usage"
- "kessil_brightness"
- "kessil_color"
- "refugium_light_refugium_brightness"
- "system_load"
- "system_mem_used"
- "system_under_voltage"
- "water_temperature_reading"

@Ranjib is there a way to add a prefix to this so I can get feeds from both of my reef-pi installations and tell them apart? ie: "tank1/water_temperature_reading", "tank2/water_temperature_reading"

Also, are there plans to receive commands through MQTT? I don't see any equipment ON/OFF options showing up.
 
Last edited:

Des Westcott

Well-Known Member
View Badges
Joined
May 29, 2018
Messages
646
Reaction score
1,035
Location
Durban - South Africa
Rating - 0%
0   0   0
Hmm I have a master pump for Jebao, but I am comfortable w/ electronics to bypass the control module in it. Thanks for


Hmm I have a master pump for Jebao, but I am comfortable w/ electronics to bypass the control module in it. How are you powering them individually though?

I DIY'd one of these in disussion with Mike. Made more sense than shipping and customs to get one to SA.
 

Des Westcott

Well-Known Member
View Badges
Joined
May 29, 2018
Messages
646
Reaction score
1,035
Location
Durban - South Africa
Rating - 0%
0   0   0
In my experience when you first set up your pi, setup the things with the 10 feeds you want first. Then set up everything else and the extra feeds will be ignored and can be deleted from adafruit.
I'm having an annoying "glitch" regarding AIO

Background :-
I have 3 x ATO's (Normal, AWC OUT, AWC IN). An AWC first turns off Normal, Turns on AWC Out, waits, turns it off then turns AWC In on , waits then turns it off and Normal back on.
I delete the ATO feeds in AIO, because they send too much data and get me throttled, but also because I fing the info they give to not be usefull. I only really want to see pH and temp on AIO

Situation :-
Avery time an AWC runs, the ATO info starts getting sent to AIO again. And I get throttled. I delete the offending feeds and all is good with the world until the next AWC. Any idea how I stop those feeds getting added back to AIO all the time?
 

Martin Lowry

Community Member
View Badges
Joined
Sep 19, 2017
Messages
60
Reaction score
66
Location
Dover, NH
Rating - 0%
0   0   0
Oops! should have thought of that... Looks like there's a bunch of Prometheus/Git related stuff at the bottom of the log and the reef-pi.service exited. log attached

@Ranjib

, not sure if the log attached so here's the last entries:
Dec 12 17:00:13 reef-pi65 reef-pi[1517]: goroutine 1 [running]:
Dec 12 17:00:13 reef-pi65 reef-pi[1517]: github.com/prometheus/client_golang/prometheus.(*Registry).MustRegister(0x153d340, 0x1584e00, 0x1, 0x1)
Dec 12 17:00:13 reef-pi65 reef-pi[1517]: /home/ranjib/gocode/pkg/mod/github.com/prometheus/[email protected]/prometheus/registry.go:401 +0x80
Dec 12 17:00:13 reef-pi65 reef-pi[1517]: github.com/prometheus/client_golang/prometheus/promauto.Factory.NewGauge(0x7a4ed0, 0x153d340, 0x0, 0x0, 0x0, 0x0, 0x158bda0, 0x20, 0x159f170, 0x2c, ...)
Dec 12 17:00:13 reef-pi65 reef-pi[1517]: /home/ranjib/gocode/pkg/mod/github.com/prometheus/[email protected]/prometheus/promauto/auto.go:297 +0xc0
Dec 12 17:00:13 reef-pi65 reef-pi[1517]: github.com/prometheus/client_golang/prometheus/promauto.NewGauge(...)
Dec 12 17:00:13 reef-pi65 reef-pi[1517]: /home/ranjib/gocode/pkg/mod/github.com/prometheus/[email protected]/prometheus/promauto/auto.go:191
Dec 12 17:00:13 reef-pi65 reef-pi[1517]: github.com/reef-pi/reef-pi/controller/telemetry.(*telemetry).EmitMetric(0x15ca000, 0x6ae08d, 0x9, 0x158bd20, 0x16, 0x0, 0x0)
Dec 12 17:00:13 reef-pi65 reef-pi[1517]: /home/ranjib/gocode/src/github.com/reef-pi/reef-pi/controller/telemetry/telemetry.go:194 +0x528
Dec 12 17:00:13 reef-pi65 reef-pi[1517]: github.com/reef-pi/reef-pi/controller/modules/equipment.(*Controller).updateOutlet(0x140a7a0, 0xba7f17, 0x1, 0x14268c0, 0x10, 0xba7f17, 0x1, 0x0, 0x0, 0x0)
Dec 12 17:00:13 reef-pi65 reef-pi[1517]: /home/ranjib/gocode/src/github.com/reef-pi/reef-pi/controller/modules/equipment/controller.go:83 +0xe0
Dec 12 17:00:13 reef-pi65 reef-pi[1517]: github.com/reef-pi/reef-pi/controller/modules/equipment.(*Controller).Start(0x140a7a0)
Dec 12 17:00:13 reef-pi65 reef-pi[1517]: /home/ranjib/gocode/src/github.com/reef-pi/reef-pi/controller/modules/equipment/controller.go:37 +0xa8
Dec 12 17:00:13 reef-pi65 reef-pi[1517]: github.com/reef-pi/reef-pi/controller/daemon.(*ReefPi).loadSubsystems(0x1474100, 0x0, 0x0)
Dec 12 17:00:13 reef-pi65 reef-pi[1517]: /home/ranjib/gocode/src/github.com/reef-pi/reef-pi/controller/daemon/loader.go:193 +0x5fc
Dec 12 17:00:13 reef-pi65 reef-pi[1517]: github.com/reef-pi/reef-pi/controller/daemon.(*ReefPi).Start(0x1474100, 0x3, 0x158a500)
Dec 12 17:00:13 reef-pi65 reef-pi[1517]: /home/ranjib/gocode/src/github.com/reef-pi/reef-pi/controller/daemon/reef_pi.go:68 +0x74
Dec 12 17:00:13 reef-pi65 reef-pi[1517]: main.daemonize(0x158a500, 0x1b)
Dec 12 17:00:13 reef-pi65 reef-pi[1517]: /home/ranjib/gocode/src/github.com/reef-pi/reef-pi/commands/daemon.go:19 +0xa4
Dec 12 17:00:13 reef-pi65 reef-pi[1517]: main.main()
Dec 12 17:00:13 reef-pi65 reef-pi[1517]: /home/ranjib/gocode/src/github.com/reef-pi/reef-pi/commands/main.go:125 +0x240
Dec 12 17:00:13 reef-pi65 systemd[1]: reef-pi.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Dec 12 17:00:13 reef-pi65 systemd[1]: reef-pi.service: Failed with result 'exit-code'

@Ranjib BUMP
 

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,591
Reaction score
1,590
Rating - 0%
0   0   0
I have no idea how hard this would be to implement, probably very, but i have a suggestion: Enable macros to not only switch subsystems on or off, but to alter their parameters or activate their functionalities on demand. For example, instead of switching subsystems or their channels on and off, having the ability to use a macro that sets a light channel to a particular level, or changes that level with a factor and/or offset. Having a macro that tells a dosing pump to dose for 15 seconds right now, independent of the regular dosing scheme, or up or downregulating the dosing speed/duration. Changing the temperature setpoints and hystereses.

Would be very practical for things such as moon phases, seasonal/daily temperature curves etc. to induce spawning or just giving the animals a more natural environment, using reef-pi as the brains of a DIY automatic alkalinity tester/controller, up and down regulating pwm fans to hold a particular temperature instead of flipping them on and off, and probably a bunch of other things i can't think of right now.

Would probably need a bunch of testing to make sure there aren't any very nasty and dangerous bugs though
 
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
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
I have no idea how hard this would be to implement, probably very, but i have a suggestion: Enable macros to not only switch subsystems on or off, but to alter their parameters or activate their functionalities on demand. For example, instead of switching subsystems or their channels on and off, having the ability to use a macro that sets a light channel to a particular level, or changes that level with a factor and/or offset. Having a macro that tells a dosing pump to dose for 15 seconds right now, independent of the regular dosing scheme, or up or downregulating the dosing speed/duration. Changing the temperature setpoints and hystereses.

Would be very practical for things such as moon phases, seasonal/daily temperature curves etc. to induce spawning or just giving the animals a more natural environment, using reef-pi as the brains of a DIY automatic alkalinity tester/controller, up and down regulating pwm fans to hold a particular temperature instead of flipping them on and off, and probably a bunch of other things i can't think of right now.

Would probably need a bunch of testing to make sure there aren't any very nasty and dangerous bugs though
Most things you have mentioned here, such as doser time , light strength etc are already doable with reef-pi right now, probably not in most intuitive way. It’s best to take one case at a time and practice it end to end and then do the software changes once we are confident on what software changes required. To me there are low level improvements (such as stepper driver ) that’s more important for reliably executing titration based workflows
 
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
I'm having an annoying "glitch" regarding AIO

Background :-
I have 3 x ATO's (Normal, AWC OUT, AWC IN). An AWC first turns off Normal, Turns on AWC Out, waits, turns it off then turns AWC In on , waits then turns it off and Normal back on.
I delete the ATO feeds in AIO, because they send too much data and get me throttled, but also because I fing the info they give to not be usefull. I only really want to see pH and temp on AIO

Situation :-
Avery time an AWC runs, the ATO info starts getting sent to AIO again. And I get throttled. I delete the offending feeds and all is good with the world until the next AWC. Any idea how I stop those feeds getting added back to AIO all the time?
I can’t think of any easy way to do this. The feeds get created or deleted every time those items are started or stopped.
 

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,591
Reaction score
1,590
Rating - 0%
0   0   0
Most things you have mentioned here, such as doser time , light strength etc are already doable with reef-pi right now, probably not in most intuitive way. It’s best to take one case at a time and practice it end to end and then do the software changes once we are confident on what software changes required. To me there are low level improvements (such as stepper driver ) that’s more important for reliably executing titration based workflows
Do you mean by creating a lookup table of dozens of dosers and lights and switching them on and off? Or i there some functionality that i don't know of?
 

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,591
Reaction score
1,590
Rating - 0%
0   0   0
Btw, what is supposed to show up in the "Log" tab? Whenever i look there i see the column labels "time, emitter, type, content" but nothing else?Is something supposed to show up there? I haven't got a ph sensor set up yet and no level sensors, are those what it is for?
 

HAVE YOU EVER KEPT A RARE/UNCOMMON FISH, CORAL, OR INVERT? SHOW IT OFF IN THE THREAD!

  • Yes!

    Votes: 32 45.7%
  • Not yet, but I have one that I want to buy in mind!

    Votes: 9 12.9%
  • No.

    Votes: 26 37.1%
  • Other (please explain).

    Votes: 3 4.3%
Back
Top