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

Here is what I am doing regarding dosing and power outage reliability. For dosers that are timer controlled I am basically having timers to verify that outside of the dosing time the equipment stays off, its cumbersome but I like the additional reliability about knowing that if power goes out and comes back up that the likely hood of continuing to dose is lower.

Here are some examples:

This is one of the more complicated ones, dosing Kalk from 1800 to 0600, since I am wanting to dose overnight it requires 2 entries, one 1800 to 2300 and then another one from 0:00 to 0600. Unless someone knows better I do not think I can combine this into one entry but I could be wrong, not a cron xpert. :p

High level
Dosing-HI-level.png


Detail timer ON and OFF, should come on top of hour and turn off 2 minutes later, note that I also have the OFF timer to keep turning it off the rest of the time, so for the hours between 18-23 the timer will continue to ensure that the equipment is in the off state, if we loose power during a dosing time and it comes back online during this time it will be turned off, it could possible run a minute.

Dosing-kalk1.png

Power off safety settings, I want to further have additional safety measures for the other hours I do not want it to dose. Since I already have the dosing turned off for the corresponding on times 18-23 and 0-06 I only need to be concerned about the additional hours 07-17.

Dose-kalk2.png


Now the one additional thing that I would like is to chart the equipment coming on and off the various times during the day like the normal dosing chart. I do not see a way to do this with my current version on reefpi but hoping that with prometheus and grafana that I can chart the equipment coming on and off, is that correct @Ranjib ?

I know it seems more complicated than it needs to be but with Nano tanks I'm just trying to to be as careful as I can. @Ranjib I am thinking that if we could set some watchdog timers, basically a setting for equipment that I know I do not want on might be another path, basically it watches and ensures that the equipment is only on during the times that you specify, if its outside of that window then it's turned off. Maybe that doesnt make since but that is what I was thinking, the default setting may be an easier thing to annotate and do, just been thinking about alternatives.

Let me know if any of this makes sense, hoping that someone may find it useful. :)
 
Last edited:
Here is what I am doing regarding dosing and power outage reliability. For dosers that are timer controlled I am basically having timers to verify that outside of the dosing time the equipment stays off, its cumbersome but I like the additional reliability about knowing that if power goes out and comes back up that the likely hood of continuing to dose is lower.

Here are some examples:

This is one of the more complicated ones, dosing Kalk from 1800 to 0600, since I am wanting to dose overnight it requires 2 entries, one 1800 to 2300 and then another one from 0:00 to 0600. Unless someone knows better I do not think I can combine this into one entry but I could be wrong, not a cron xpert. :p

High level
Dosing-HI-level.png


Detail timer ON and OFF, should come on top of hour and turn off 2 minutes later, note that I also have the OFF timer to keep turning it off the rest of the time, so for the hours between 18-23 the timer will continue to ensure that the equipment is in the off state, if we loose power during a dosing time and it comes back online during this time it will be turned off, it could possible run a minute.

Dosing-kalk1.png

Power off safety settings, I want to further have additional safety measures for the other hours I do not want it to dose. Since I already have the dosing turned off for the corresponding on times 18-23 and 0-06 I only need to be concerned about the additional hours 07-17.

View attachment 1986094

Now the one additional thing that I would like is to chart the equipment coming on and off the various times during the day like the normal dosing chart. I do not see a way to do this with my current version on reefpi but hoping that with prometheus and grafana that I can chart the equipment coming on and off, is that correct @Ranjib ?

I know it seems more complicated than it needs to be but with Nano tanks I'm just trying to to be as careful as I can. @Ranjib I am thinking that if we could set some watchdog timers, basically a setting for equipment that I know I do not want on might be another path, basically it watches and ensures that the equipment is only on during the times that you specify, if its outside of that window then it's turned off. Maybe that doesnt make since but that is what I was thinking, the default setting may be an easier thing to annotate and do, just been thinking about alternatives.

Let me know if any of this makes sense :)
One difficulty with this might be the difference between the doser being off, and ReefPi thinking it is off. Depends on which driver/electronic solution you use of course. An easy example are file drivers, reefpi only knows that it writes to the file that something should be off, it doesn't know whether the pipeline that actually uses that file is malfunctioning or running at all.

Different example that actually happened to me: the pi crashed on its own a while back but overall power was still there. Meaning the PCA9685 making the pwm signals for my dosers never got the i2c message to stop /change what it was doing. If I remember correctly the pi restarting wasn't enough, I had to delete and reconfigure the doser in the Ui before it would stop, thankfully I was there while it happened and could pull out the tubing.

I haven't really looked into it at all, but how hard would it be to diy current sensing for 12v/24v? Then that would be an easy alarm /macro trigger when a doser is running when it shouldn't.
 
One difficulty with this might be the difference between the doser being off, and ReefPi thinking it is off. Depends on which driver/electronic solution you use of course. An easy example are file drivers, reefpi only knows that it writes to the file that something should be off, it doesn't know whether the pipeline that actually uses that file is malfunctioning or running at all.

Different example that actually happened to me: the pi crashed on its own a while back but overall power was still there. Meaning the PCA9685 making the pwm signals for my dosers never got the i2c message to stop /change what it was doing. If I remember correctly the pi restarting wasn't enough, I had to delete and reconfigure the doser in the Ui before it would stop, thankfully I was there while it happened and could pull out the tubing.

I haven't really looked into it at all, but how hard would it be to diy current sensing for 12v/24v? Then that would be an easy alarm /macro trigger when a doser is running when it shouldn't.
Correct that is the issue, you doser is going and you loose power, the doser is supposed to run for 1 minute etc. Your power comes back on some period of time after the time as expired and reefpi returns it to its working state, eg. doser continues to run. It may not happen but its a possibility and I would like to minimize that possibility as much as possible.

:)
 
Last edited:
A bit of googling turned up ina219 and ina3221, single and triple channel current/voltage sensing chips that have i2c capability and exist as breakout boards that aren't all too expensive.

Haven't looked at all the details yet though, maybe there's better ones for the price.

Those would provide a nice graph which equipment is running when though.
 
I was thinking in the UI maybe you could have a "purge graph data" or "reset graph" - maybe in the Dashboard Configuration. I know sometimes when I'm testing ATO or similar I get one big spike in the histogram that visually gives me a twitch until it drops off the end after time.
I'll vote for purging the graph data too... Also, I don't seem to be able to change the graph colors in the Dashboard. Maybe it's just me.
 
All right - been testing this and I now have a better understanding of how this is working.

As a test, I have set up the following :
  • a momentary switch to imitate a float switch - set up as an input.
  • a light set up on an outlet
  • Created a macro that has one step - turn on light
  • Create an ATO with one second check frequency
  • Set the ATO to control the Macro described above
Working findings
  • If I press and hold the button (simulating the float switch opening) the light comes on and stays on.
  • When I release the button (simulating the float switch closing), the light goes off
  • If I press the button for 1 second and release, the light comes on for one second and then goes off again.
  • If I enable One Shot and press and release the button, the light comes on and stays on, but then the ATO is disabled afterwards
Now, I altered the Macro to add the steps to turn on, wait 1sec, turn off, wait 1 sec and turn on. Then activate the ATO on and the light turns on and off repeatedly (1 sec frequency) regardless of the state of the button / switch until I de-activate the ATO. When de-activating the ATO, the light finishes the Macro cycle. If the ATO is left on longer, it takes longer to "normalise" ie reef-pi is counting the activation cycles of the ATO and is trying to run the Macro that number of times.

Next I tried to create a Macro that first de-activated ATO, then did the light steps and then re-activated the ATO. This just confused it completely and made the ATO uncontrollable. I had to delete the ATO because I couldn't change it's state to off despite a re-start on Reef-Pi.

But I can see how using the doser as described has worked.

I'm going to keep testing a few things, but as far as getting the status of an ATO to trigger a multi-step Macro - that's still a no.
The behavior you noted is exactly what expected. The only thing I’ll add is a spst /latching switch is better way to simulate float sensor than momentary switches, since reef-pi polls for change at best 1s interval, which is not instantaneous, like a momentary switch (immediate on /off )
 
A bit of googling turned up ina219 and ina3221, single and triple channel current/voltage sensing chips that have i2c capability and exist as breakout boards that aren't all too expensive.

Haven't looked at all the details yet though, maybe there's better ones for the price.

Those would provide a nice graph which equipment is running when though.
I do that with Kasa smart plugs. They are useful only for initial validation and to establish the usage pattern, afterwards they are kinda predictable and repetitive. They should be useful in detecting when equipment is found bad (like light for example ), but it’s limited
 
So far I have not gotten any PH probes to be consistent, about to send another one back, its like they all start to lose the calibrations settings and drift. I may try one more but starting to think about not having PH monitored which with dosing kalk I kind of wanted.
Are you saying you were not even able to get to stable diurnal cycle ??
 
I'll vote for purging the graph data too... Also, I don't seem to be able to change the graph colors in the Dashboard. Maybe it's just me.
Is this with 4.1 ? Can you give some specifics, like which chart etc, if I can reproduce it I can fix it quickly
 
Are you saying you were not even able to get to stable diurnal cycle ??
No thats not the issue, I know they cycle, although I run my sump light during the night but I just can't get a PH probe to hold calibration. I calibrate and over time they start to drift, the latest one I am using yesterday started jumped up yesterday and today reporting over 8.4 to 8.5. This is the second time, I re-calibrate it and it runs fine and starts doing the same thing, I'm pretty sure my PH is not 8.4, I have a handheld tester and it reads 8.0 which is probably closer than the 8.4. I've had others where they spike etc, I just cant get them to be consistent for long periods of time, I'm using one of @Michael Lane PH module, its well made but just haven't had much luck with the ones I have tried.
:)
 
No thats not the issue, I know they cycle, although I run my sump light during the night but I just can't get a PH probe to hold calibration. I calibrate and over time they start to drift, the latest one I am using yesterday started jumped up yesterday and today reporting over 8.4 to 8.5. This is the second time, I re-calibrate it and it runs fine and starts doing the same thing, I'm pretty sure my PH is not 8.4, I have a handheld tester and it reads 8.0 which is probably closer than the 8.4. I've had others where they spike etc, I just cant get them to be consistent for long periods of time, I'm using one of @Michael Lane PH module, its well made but just haven't had much luck with the ones I have tried.
:)
Got it, that’s unfortunate. If the sensor reading itself is skewing then it’s beyond reef-pi software , something we have to address in the tank or sensor side. If we do spot any software induced issue , such as this one (sensor value or control loop ) that is definitely a top priority bug fixing from my perspective.
 
Got it, that’s unfortunate. If the sensor reading itself is skewing then it’s beyond reef-pi software , something we have to address in the tank or sensor side. If we do spot any software induced issue , such as this one (sensor value or control loop ) that is definitely a top priority bug fixing from my perspective.
No it's not your software it's my setup, hardware, something either I have had back luck with probes or placement or the PH module. This one ran for a couple weeks and started reading higher, I re calibrated and it held and now is doing the same thing, pretty sure if I placed it in some calibration solution it would be about .3-.4 high, so it's the only thing that I have not been able to get stable or maybe my dino's are getting to it. ;)
 
what brand/model did you buy? (See if others have good results with the same probe) Is anything growing on the probe? (I’ve seen drift when something was growing on it). Does turning anything on or off make a sudden change? ( I had electrical interference from a light cause bad readings). When I don’t have a special cause I would say my calibration holds for about 6 months or so.
 
what brand/model did you buy? (See if others have good results with the same probe) Is anything growing on the probe? (I’ve seen drift when something was growing on it). Does turning anything on or off make a sudden change? ( I had electrical interference from a light cause bad readings). When I don’t have a special cause I would say my calibration holds for about 6 months or so.
The one I have now is a bluelab probe, worked for a couple weeks and skewed high and I re-calibrated it and its now doing the same thing. I can't put my finger on it, I've moved it around in my sump and nothing seems to make a difference. Like I said I can calibrate it and it will be fine and at some point it starts to drift. I've cleaned it off but doesn't seem to make a difference.
 
Not sure why, but last night for the second night in a row, I lost all 3 of my temp sensors. All at the same time. Last night at 02H30 and the previous night at 00h00.


Jan 20 07:32:22
temperature sub-system. Failed to read sensor Tank Temperature. Error:open /sys/bus/w1/devices/28-01193ae00410/w1_slave: no such file or directory

Jan 20 07:32:22
temperature sub-system. Failed to read sensor Chiller Outlet. Error:open /sys/bus/w1/devices/28-01193b185be6/w1_slave: no such file or directory

Jan 20 07:31:52
temperature sub-system. Failed to read sensor Room Temperature. Error:open /sys/bus/w1/devices/28-37af8f1d64ff/w1_slave: no such file or directory

I wonder what could cause that. 07H32 is now when I discovered it.
 
I do that with Kasa smart plugs. They are useful only for initial validation and to establish the usage pattern, afterwards they are kinda predictable and repetitive. They should be useful in detecting when equipment is found bad (like light for example ), but it’s limited
No i mean for low voltage stuff. Like mostly dosing pumps controlled by reefpi. Or 24V equipment. And yeah only for validation /catching things that run when they shouldn't /don't run when they should, or suddenly draw more or less amps.

But I looked a bit more and the combination acs712+ads1115 or other arduino based ones+ads1115 should also work and not need any extra drivers

On that note, if I remember correctly, a long time back there was talk about communication between several reef-pis or reefpi and arduino, anything ever come of that?

And I would love to get kasa bars, they don't make those for EU :/ and individual hs110 plugs would be super expensive and way too bulky to get 10 or 20 of
 

TOP 10 Trending Threads

Back
Top
Home
Post thread…
Market
What's new