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
Has anyone tried to set up different lighting profiles for the same fixtures. I haven't been able to find a way to do this yet but wanted to see if my approach is incorrect. I use the diurnal for all of my 9 channels across 3 fixtures. The thought was to create a photograph mode for the lights in which I may define a preset fixed value. I created the channel assignment for this new mode under jacks. Then head to the lighting subsystem and assign my mode. I don't think this will work though properly after looking through journalctl -u reef-pi I see that this new addition is still outputting a value when assigned to 0 which I understand that once its created in lighting it's a constant output. Has anyone devised a way to do this? I looked at a macro to turn of pieces of the lighting subsystem but the sandbox is too shallow there. If there is a 0 value that's outputting while my daily diurnal is running I'm sure there will be a conflict.

+1
I was wanting to do something similiar, I have configuration for my lights that ramp up and down but would also like to have a pre-set setting that I could just turn off and on, curious as to how accomplish it, basically multiple profiles for the same fixture.

:)
 
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
It’s not possible to do this easily with ui. I am tracking this as a feature request and hopefully
I’ll implement it sometime future , but it’s not a priority thing yet, one of meta feature for 3.0 around arbitrary pwm profile needs to be done before we can support this easily in ui.

It will be trivial to write a small script to do this via api (python, nodes etc) and then hook up the script with a push button or something similar
 

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
I've just noticed a strange aberation......

We are experiencing "rolling blackouts" here, and power goes out for 2 hours at a time once or twice a day - depending on your schedule.

I have a timer set up in Reef-Pi that adds Kalkwasser every hour (and my ATO does the rest). The timer is set to run on every "01" minute. Our rolling blackouts seem to start and stop pretty near exactly on the hour. I've noticed a couple of times that when the Reef-Pi starts up, the timer seems to be running, but does not turn off as it is supposed to. I can go in manually and turn the equipment off.

As a work-around, I have now set the timer to run on the "30" minute.

But it would seem that if the Reef-Pi loses power during a timed operation, it does not remember to reset the equipment status to orignal when power is restored.

I am also going to install a small UPS for my Reef-Pi to keep the Pi alive for a few hours in the event of a power outage. Not the equipment, just the Pi. Should also help with this issue.
 

b4tn

Valuable Member
View Badges
Joined
Jun 17, 2015
Messages
1,673
Reaction score
2,244
Location
Columbia MD
Rating - 0%
0   0   0
I have my wavemakers set to turn on at the designated hour and every minute after that hour. This way if I loose power or turn them off for a macro function once the timer is re-enabled or power comes back on one minute later they turn back on.

46931274541_022fe83af1_h.jpg


You could experiment with creating a second timer that turns off the kalk pump every minute by using a * in the month, hour, minute field, then 0 in the second field. The only issue is that doing this is that any functions on that piece of equipment would be limited to 1 minute of run time. So you would set the kalk to dose Month *, Hour *, Minute 0, Second 1. This gives you 59 seconds of run time before the second timer turns it off at the 0 second mark. Thats just a thought. It may or may not work.
 
Last edited:
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've just noticed a strange aberation......

We are experiencing "rolling blackouts" here, and power goes out for 2 hours at a time once or twice a day - depending on your schedule.

I have a timer set up in Reef-Pi that adds Kalkwasser every hour (and my ATO does the rest). The timer is set to run on every "01" minute. Our rolling blackouts seem to start and stop pretty near exactly on the hour. I've noticed a couple of times that when the Reef-Pi starts up, the timer seems to be running, but does not turn off as it is supposed to. I can go in manually and turn the equipment off.

As a work-around, I have now set the timer to run on the "30" minute.

But it would seem that if the Reef-Pi loses power during a timed operation, it does not remember to reset the equipment status to orignal when power is restored.

I am also going to install a small UPS for my Reef-Pi to keep the Pi alive for a few hours in the event of a power outage. Not the equipment, just the Pi. Should also help with this issue.
This is a tricky problem, as during the start of the power outage reef-pi was supposed to keep the outlet on, while when power came back reef-pi has no clue what the state should be , as the timer has crashed , and the last known state was on. I am open for suggestions here,
 

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
2,223
Reaction score
3,632
Location
Sacramento, CA area
Rating - 0%
0   0   0
This is a tricky problem, as during the start of the power outage reef-pi was supposed to keep the outlet on, while when power came back reef-pi has no clue what the state should be , as the timer has crashed , and the last known state was on. I am open for suggestions here,

Add a “fallback” option to outlets? Options are on/off/last.
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
Add a “fallback” option to outlets? Options are on/off/last.

I was thinking about something along those lines, I still need to dig more into the code to understand how things are working in relation to the database, but why not write something to the DB regarding the state, on/off for each device. If reef-pi is restarted it just reads from the variable for each component and restores based on last state. It does get tricky if the state is based on a timer etc, would require additional flags for things turned on via macro and timers.
 
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
Add a “fallback” option to outlets? Options are on/off/last.
And how reef-pi will know it has to fallback ? Like detect there was an abrupt shutdown? And what this means got input and other type of outputs (like pwm /jack )
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
And how reef-pi will know it has to fallback ? Like detect there was an abrupt shutdown? And what this means got input and other type of outputs (like pwm /jack )

Exactly that why I was thinking of writing the state to the database, gets complicated if its running a macro since it's transitive depending on how long its supposed to run. I dunno something similar to a journal entry for a journaled hard drive, gets replayed when it boots back up. It's an interesting one to think about, not sure what teh best approach might be at the moment.
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,826
Rating - 0%
0   0   0
Exactly that why I was thinking of writing the state to the database, gets complicated if its running a macro since it's transitive depending on how long its supposed to run. I dunno something similar to a journal entry for a journaled hard drive, gets replayed when it boots back up. It's an interesting one to think about, not sure what teh best approach might be at the moment.
As a hardware guy, id say a mini UPS to keep the pi up...ive already added a real time clock...maybe a next project for me ;)
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
As a hardware guy, id say a mini UPS to keep the pi up...ive already added a real time clock...maybe a next project for me ;)

Yeah I use quite a few UPS, although never for a Pi, but they are a hassle also, limited amount of run-time even with a rpi, so you have to have a way of shutting things down etc. I like the idea of writing the state, if it reboots, when it comes up it continues on its way...lots of ways to accomplish but would think you would want something that doesn't require a UPS.
 

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
2,223
Reaction score
3,632
Location
Sacramento, CA area
Rating - 0%
0   0   0
And how reef-pi will know it has to fallback ? Like detect there was an abrupt shutdown? And what this means got input and other type of outputs (like pwm /jack )

It’s the set point to bring it to on initialization. If it’s a timer or macro this sets the state to a “safe” value until the routine runs and sets the output. (e.g. dosing pump off, etc)

Jack is a bit more complicated. Could be
 
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
Exactly that why I was thinking of writing the state to the database, gets complicated if its running a macro since it's transitive depending on how long its supposed to run. I dunno something similar to a journal entry for a journaled hard drive, gets replayed when it boots back up. It's an interesting one to think about, not sure what teh best approach might be at the moment.
We store outlet state in the database, even when macro or timer turns it on or off, thats why upon power outage that state is restored, but the timer or macros lost part (like reversing action or some steps in a macro) are hard to replay
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
We store outlet state in the database, even when macro or timer turns it on or off, thats why upon power outage that state is restored, but the timer or macros lost part (like reversing action or some steps in a macro) are hard to replay

Agree with macros and all the options it's gets *cough* interesting. I was thinking along the limes of a journaling file system, replays when it's booted, I've watched it replay many times on a Linux box booting up. Just thinking about what would be similar to maybe compare how it's been solved in the past.

:)
 
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
Agree with macros and all the options it's gets *cough* interesting. I was thinking along the limes of a journaling file system, replays when it's booted, I've watched it replay many times on a Linux box booting up. Just thinking about what would be similar to maybe compare how it's been solved in the past.

:)
Yeah that is indeed a good way of approaching this. I’ll think about it.
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
Yeah that is indeed a good way of approaching this. I’ll think about it.

For my simpleton mind, I would have a list for a macro, as each item is accomplished it's removed from the list till the list is empty. If I half way through the list when I reboot I start at the point that I was on before the restart, so if I had started a wait cycle of 100 it doesn't get removed until it hits 0. If it reboots during the 100 second countdown it restarts the 100sec countdown again. One of the downsides is if it keeps rebooting then it would restart over and over, you could set a count that says if it's started it once then it removes the item and goes to the next step.

Update: Thinking about this some more the more prudent action would be to remove the step from the list when it's started, if it reboots it picks up at the next step, that way it couldn't repeat an item. A timer may be cut short but it wouldn't be replayed.

No idea if this makes any sense or is practical just thinking about how it might be done. Probably there is a much nicer/elegant solution.

:)
 
Last edited:
Back
Top