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
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,253
Reaction score
3,603
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,876
Reaction score
16,680
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,409
Reaction score
1,726
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,876
Reaction score
16,680
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,409
Reaction score
1,726
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:
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
Got a few things done on the 3.0 side.. ezo ph driver was ported to new HAL . And now I am running 3.0 development build on one of my ph monitor. Everything looks good, I am yet to test the ezo calibration bits on 3.0. But I wanted the ezo support to be there in 3.0 so that I can start comparing the ph board with ezo circuit side by side.
Screen Shot 2019-03-20 at 9.43.12 PM.png

Unfortunately, due to 2.1 -> 3.o upgrade, I lost the usage data. But Adafruit.io was configured :-)
Screen Shot 2019-03-20 at 9.43.03 PM.png


During the process I also found a telemetry update API bug :-O , dont know how it went and who all have been impacted, I hope this was not part of 2.x series and it was only present in 3.0 development branch.. anyway.. its fixed now.

Telemetry bugfix: https://github.com/reef-pi/reef-pi/pull/762
EZO hal porting: https://github.com/reef-pi/reef-pi/pull/761

I'll start putting regular development update from now on. I feel like we have a decent community now, and there are enough folks who understand some parts of reef-pi, so if anyone curious how the code works, these changes with the context of whats being done might be useful. Software engineers could always use an extra pair of eyes for review :-)
 

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
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.

An update to this issue. I was not focusing last night and was running my "Feed" macro when the power went off. I now have that macro constantly showing the "running" state and I'm not sure how to solve that short of deleting the macro. I guess this is sort of like trying to cancel a macro while running. I have managed to turn the equipment / systems back on that the macro turns off to feed by manually changing the state of the equipment and enabling the sensors.

Is it possible to create a "cancel" or "reset" button for each macro?
 

rushbattle

Valuable Member
View Badges
Joined
Oct 19, 2016
Messages
1,347
Reaction score
1,628
Location
Equality
Rating - 0%
0   0   0
An update to this issue. I was not focusing last night and was running my "Feed" macro when the power went off. I now have that macro constantly showing the "running" state and I'm not sure how to solve that short of deleting the macro. I guess this is sort of like trying to cancel a macro while running. I have managed to turn the equipment / systems back on that the macro turns off to feed by manually changing the state of the equipment and enabling the sensors.

Is it possible to create a "cancel" or "reset" button for each macro?
Hit the edit button, then don’t make any changes and hit the save button.
 
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
An update to this issue. I was not focusing last night and was running my "Feed" macro when the power went off. I now have that macro constantly showing the "running" state and I'm not sure how to solve that short of deleting the macro. I guess this is sort of like trying to cancel a macro while running. I have managed to turn the equipment / systems back on that the macro turns off to feed by manually changing the state of the equipment and enabling the sensors.

Is it possible to create a "cancel" or "reset" button for each macro?
This is not supported yet, but on our roadmap
 
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
Working on this side project. My first layout for n scale railroad. Total newbie in this. It’s based on a 2x4 plywood, it will have a reef tank , a terrarium and a railroad. The tank will have a tunnel beneath , railroad go through it. The whole thing should be controlled by multiple reef-pi. And the layout it’s also modular , broken into 4 equal parts for easy transportation.
Here is the rough idea
A6E9AC66-F158-41AD-9020-93233C31660D.jpeg

It’s a 5.5g pico tank.
09AC7B06-AC69-42E3-912E-E53EF2F6A5BA.jpeg

Started working on the tank part of the layout , just finished plastering the rocks
1E1C7618-17D0-4681-B9B2-7693E51B2886.jpeg

2BB977CB-FAFF-47A9-AF2A-E589483D95B7.jpeg


62200A69-C643-4E0D-B3C8-3A8478429618.jpeg


Excited about this. It will keep my son busy while give me another way to test the manager functionality . And I always wanted to do some more railroad layout ;-)
Will keep you all posted. With the terrarium in, I have more reasons to add support for the humidity sensor (and Hal work has made it relatively easy )
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,409
Reaction score
1,726
Location
Missouri
Rating - 0%
0   0   0
Working on this side project. My first layout for n scale railroad. Total newbie in this. It’s based on a 2x4 plywood, it will have a reef tank , a terrarium and a railroad. The tank will have a tunnel beneath , railroad go through it. The whole thing should be controlled by multiple reef-pi. And the layout it’s also modular , broken into 4 equal parts for easy transportation.
Here is the rough idea
A6E9AC66-F158-41AD-9020-93233C31660D.jpeg

It’s a 5.5g pico tank.
09AC7B06-AC69-42E3-912E-E53EF2F6A5BA.jpeg

Started working on the tank part of the layout , just finished plastering the rocks
1E1C7618-17D0-4681-B9B2-7693E51B2886.jpeg

2BB977CB-FAFF-47A9-AF2A-E589483D95B7.jpeg


62200A69-C643-4E0D-B3C8-3A8478429618.jpeg


Excited about this. It will keep my son busy while give me another way to test the manager functionality . And I always wanted to do some more railroad layout ;-)
Will keep you all posted. With the terrarium in, I have more reasons to add support for the humidity sensor (and Hal work has made it relatively easy )

wooo woooo!!!! :)
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,811
Rating - 0%
0   0   0
Working on this side project. My first layout for n scale railroad. Total newbie in this. It’s based on a 2x4 plywood, it will have a reef tank , a terrarium and a railroad. The tank will have a tunnel beneath , railroad go through it. The whole thing should be controlled by multiple reef-pi. And the layout it’s also modular , broken into 4 equal parts for easy transportation.
Here is the rough idea
A6E9AC66-F158-41AD-9020-93233C31660D.jpeg

It’s a 5.5g pico tank.
09AC7B06-AC69-42E3-912E-E53EF2F6A5BA.jpeg

Started working on the tank part of the layout , just finished plastering the rocks
1E1C7618-17D0-4681-B9B2-7693E51B2886.jpeg

2BB977CB-FAFF-47A9-AF2A-E589483D95B7.jpeg


62200A69-C643-4E0D-B3C8-3A8478429618.jpeg


Excited about this. It will keep my son busy while give me another way to test the manager functionality . And I always wanted to do some more railroad layout ;-)
Will keep you all posted. With the terrarium in, I have more reasons to add support for the humidity sensor (and Hal work has made it relatively easy )
That brings back memories of my Dad building his Xmas platform...made it different every year...it was a large O guage Lionel. He framed mountains from thin wood strips, covered them with "mountain paper" which was like paper mache. The streetlights turned on...the roads made from chicken grit had working traffic signals.
At the heart of this was this giant controller with the train transformer and 40 toggle switches to turn everything on and off....lol
 
Last edited:
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
That brings back memories of my Dad building his Xmas platform...made it different every year...it was a large O guage Lionel. He framed mountains from thin wood strips, covered them with "mountain paper" which was like paper mache. The streetlights turned on...the roads made from chicken grit had working traffic signals.
At the heart of this was this giant controller with the train transformer and 40 toggle switches to turn everything on and off....lol
Wow :-) , oldschool.
My plan is similar I am looking forward to control numerous outlets and cross pi macro .. should be a good testing platform for the clustering work.
I really like the arts part of it
 

EddieJ

Active Member
View Badges
Joined
Dec 13, 2011
Messages
188
Reaction score
256
Location
Brunswick Oh
Rating - 0%
0   0   0
Alright, I am kinda stumped on this one. I am trying to get PH working. I have wired up an EZO with Isolation carrier board per wiring diagram. When I power up the system, I notice the LED keeps flashing on the EZO board. When I go to calibrate I get these errors:

Failed to update. Error: write /dev/i2c-1: remote I/O error

Has anyone run into this?

@Ranjib
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,811
Rating - 0%
0   0   0
Alright, I am kinda stumped on this one. I am trying to get PH working. I have wired up an EZO with Isolation carrier board per wiring diagram. When I power up the system, I notice the LED keeps flashing on the EZO board. When I go to calibrate I get these errors:

Failed to update. Error: write /dev/i2c-1: remote I/O error

Has anyone run into this?

@Ranjib
Maybe a wiring error, also do you have i2c enabled on the raspberry pi?
 

EddieJ

Active Member
View Badges
Joined
Dec 13, 2011
Messages
188
Reaction score
256
Location
Brunswick Oh
Rating - 0%
0   0   0
Maybe a wiring error, also do you have i2c enabled on the raspberry pi?

I2c is enabled , have doubled checked the wiring which is pretty basic and it appears correct . Reading the docs on the EZO maybe it needs a reset. I was hoping someone ran into this and has the answer.
 

jhoop

Active Member
View Badges
Joined
Jan 10, 2014
Messages
158
Reaction score
181
Location
Cleveland Ohio
Rating - 0%
0   0   0
When powered on the LED on EZ board should be solid blue then flash green every 60 seconds or so. If it is flashing green all the time it is in wrong mode. There is a " U art mode " and IC2 mode. U art is default. Must be in IC2 mode. Factory sheet uploaded.
 

Attachments

  • PH Atlas Scientific.pdf
    7.7 MB · Views: 334
  • PH Atlas Scientific.pdf
    7.7 MB · Views: 325

smittysreef

New Member
View Badges
Joined
Mar 22, 2019
Messages
12
Reaction score
53
Location
McCrory, Arkansas
Rating - 0%
0   0   0
I'd like to try this! I'd have to learn Python, but I've had 3.5 out of 4 years in Network Management which included some Linux, programming, and a host of other useful courses. Shouldn't be too difficult. Besides, an Apex right now is way out of my reach. I've already downloaded Rasbian on a VM and the source code and stuff from Github to see what's up. I'll have to get an actual Pi and have a go at it. This thread rules!
 

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

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

    Votes: 34 23.3%
  • 75% live rock, 25% live sand

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

    Votes: 11 7.5%
Back
Top