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

Aaron Smith

Active Member
View Badges
Joined
Apr 9, 2017
Messages
250
Reaction score
270
Location
Oregon
Rating - 0%
0   0   0
That's better idea than USB. Each reef-pi can then be a IoT unit, can even support Amazon Alexa and Google Home. :D

I'm suck at wiring, otherwise I would dump my reef angel and jump ship to reef-pi right away.

I was in the market for a reef angel until I found Ranjib's post!

Have my lights on a working schedule and having fun learning pi.[emoji41]
 

Aaron Smith

Active Member
View Badges
Joined
Apr 9, 2017
Messages
250
Reaction score
270
Location
Oregon
Rating - 0%
0   0   0
That's better idea than USB. Each reef-pi can then be a IoT unit, can even support Amazon Alexa and Google Home. :D

I'm suck at wiring, otherwise I would dump my reef angel and jump ship to reef-pi right away.

Amazon Alexa interface would be sweet!

Alexa dim blue channel to 50% white channel to 10%.[emoji41]
 

chipmunkofdoom2

Always Making Something
View Badges
Joined
Jun 6, 2017
Messages
2,417
Reaction score
4,497
Location
Baltimore, MD
Rating - 0%
0   0   0
Hey there, good work and glad to see someone experimenting with a RPi based aquarium controller. I'm working on something similar myself and had a question.

I'm trying to duplicate the default "on" or "off" functionality some controllers have. This is where the outlet is on even if the device is disconnected from the head or control unit. Have you figured out a way to do this? I'm using a simple relay board similar to the one you're using, but I just can't seem to figure a good way to do this. I'm just trying to think worst case scenario. If the RPi dies, freezes on reboot, or the GPIO SoC dies, the relays would be shut and anything running off a relay (pumps, dosers, lighting, etc) would all be shut down and wouldn't come back on until I was able to manually intervene.

The only thing I could think of was wiring the loads to the NC terminals of the relay and energizing the relays as soon as possible after boot. This would, however, turn on ANY equipment plugged into a relay until the OS boots. This means dosing pumps would be dosing, lights would be on, etc, until a startup script could be run and shut them down. In the event the OS never boots, they would never be shut off. I suppose I could wire some outlets as "default on" for things that we generally want to be on all the time, like powerheads and skimmers, but leave the dosing pumps on the "default off" outlets. This way, worst case scenario, the tank still has flow and some filtration.

What are your thoughts on this?
 

Aaron Smith

Active Member
View Badges
Joined
Apr 9, 2017
Messages
250
Reaction score
270
Location
Oregon
Rating - 0%
0   0   0
Hey there, good work and glad to see someone experimenting with a RPi based aquarium controller. I'm working on something similar myself and had a question.

I'm trying to duplicate the default "on" or "off" functionality some controllers have. This is where the outlet is on even if the device is disconnected from the head or control unit. Have you figured out a way to do this? I'm using a simple relay board similar to the one you're using, but I just can't seem to figure a good way to do this. I'm just trying to think worst case scenario. If the RPi dies, freezes on reboot, or the GPIO SoC dies, the relays would be shut and anything running off a relay (pumps, dosers, lighting, etc) would all be shut down and wouldn't come back on until I was able to manually intervene.

The only thing I could think of was wiring the loads to the NC terminals of the relay and energizing the relays as soon as possible after boot. This would, however, turn on ANY equipment plugged into a relay until the OS boots. This means dosing pumps would be dosing, lights would be on, etc, until a startup script could be run and shut them down. In the event the OS never boots, they would never be shut off. I suppose I could wire some outlets as "default on" for things that we generally want to be on all the time, like powerheads and skimmers, but leave the dosing pumps on the "default off" outlets. This way, worst case scenario, the tank still has flow and some filtration.

What are your thoughts on this?

Equipment that needs to run regardless of pi state would be NC non critical items would be NO. Like you stated above [emoji16]
 

ReefBeta

Valuable Member
View Badges
Joined
May 26, 2016
Messages
1,318
Reaction score
1,427
Location
Seattle, US
Rating - 0%
0   0   0
Hey there, good work and glad to see someone experimenting with a RPi based aquarium controller. I'm working on something similar myself and had a question.

I'm trying to duplicate the default "on" or "off" functionality some controllers have. This is where the outlet is on even if the device is disconnected from the head or control unit. Have you figured out a way to do this? I'm using a simple relay board similar to the one you're using, but I just can't seem to figure a good way to do this. I'm just trying to think worst case scenario. If the RPi dies, freezes on reboot, or the GPIO SoC dies, the relays would be shut and anything running off a relay (pumps, dosers, lighting, etc) would all be shut down and wouldn't come back on until I was able to manually intervene.

The only thing I could think of was wiring the loads to the NC terminals of the relay and energizing the relays as soon as possible after boot. This would, however, turn on ANY equipment plugged into a relay until the OS boots. This means dosing pumps would be dosing, lights would be on, etc, until a startup script could be run and shut them down. In the event the OS never boots, they would never be shut off. I suppose I could wire some outlets as "default on" for things that we generally want to be on all the time, like powerheads and skimmers, but leave the dosing pumps on the "default off" outlets. This way, worst case scenario, the tank still has flow and some filtration.

What are your thoughts on this?

Maybe have a separate micro controller the control the relay, and have pi control via that controller?
 

Mark Taber

Community Member
View Badges
Joined
Oct 7, 2016
Messages
89
Reaction score
31
Rating - 0%
0   0   0
Is there a way we can get a step by step guide on this, maybe a separate link so it is a single place to visit for an up to date install, config and equipment guide? I am happy to help and contribute to this?
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Is there a way we can get a step by step guide on this, maybe a separate link so it is a single place to visit for an up to date install, config and equipment guide? I am happy to help and contribute to this?
Yes. I am trying to understand whats the best way to collaborate, like should we start a documentation within the software project in github, or a dedicated thread in reef2reef or a google doc. I need all of you, who want to contribute to the guide input in that. Once we decided on the medium, I can start with some initial content and then we can all iterate.
@Cary thoughts?
 

ReefBeta

Valuable Member
View Badges
Joined
May 26, 2016
Messages
1,318
Reaction score
1,427
Location
Seattle, US
Rating - 0%
0   0   0
For dashboarding, I did this for reefangel:

9jROTSA.png


A simple app that pull data off its api and post it to Influxdb, then run a grafana to create dashboard. Can also setup telegraf for alerting. Run all of those services off a single raspberry pi 3. You should be able to do the same thing with reef-pi, have it push data to influxdb and get dashboard easily. Grafana dashboards are also easy to embed in other pages. So can also integrate them into the web ui。
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
@zsxking Ah, I love grafana :). You know couple of years before (even before I started working on reef-pi) I got entire monitoring stack up and running a a raspberry pi based rack. It had full telegraf, influxdb and grafana running in different raspberry pi. I still use this farm for building all my pi based software (reef-pi, weather station, nomad, gocd , chef , influx/telegraf/grafana etc etc). That was my very first raspberry pi based software project, as I could see myself doing a lot of raspberry pi based work, and i needed as full blow metric and build system powered by raspberry pi.

Noteworthy, telegraf used to break on raspberry pi due to some anomalies in gopsutil (a go based library telegraf uses for gathering system metrics). I recall patching those, i think telegraf still has some code contribution from me..

sorry for the off topic post, this is so close to my heart,
coming back to dashboard for reef-pi, I found the bare bone dashboard we need, can easily be done with adafruit.io, we are not really looking at complex graphs, the focus here is whats most important for a reef tank, and I think temperature, ph and alakilinity specific trending and alert is very good to begin with, hence I didnt went with telegraf/grafana style thing. That would also add to the learning curve
BTW, reef-pi itself packs rechart javascript library, so we can show any probe data as graph in the dashboard itself. I think currently its hardcoded to use with temperature data, but I will make it generic enough to chart any probe base data.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I got little busy with the coming cherrycorals shipment :) . Just wanted to let you all know that I am reading and staying up to date with your requests, and I will get back to the controller work soon. Meanwhile I have already patched couple of bugs in last few days, the github pull requests tab will reveal the details, in case if any of you are interested.
My current priority is
1) introduce a minimum and maximum threshold for lighting (i noticed kessil flickr on pwm value below certain range, threshold will prevent that)
2) start work on the guide. I have started on a draft, but the scope and possible variations making it difficult. Just to make it more complicated, I think I am not a good person to write it, since I know most of it, and I probably wont understand the difficulties encountered by someone from different background. This is why all your feedback/help if very important.
Thanks again for tagging along
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
reef-pi itself uses boltdb, a go based embedded key value store, which keeps relays state, pwm values etc. For historical values, I am shipping those to adafruit.io (thats my initial thought). I dont see any problem with keeping data locally, but I'll try to limit it to a certain period (say week long),
 

ReefBeta

Valuable Member
View Badges
Joined
May 26, 2016
Messages
1,318
Reaction score
1,427
Location
Seattle, US
Rating - 0%
0   0   0
Not sure what it mean by "shipping those to adafruit.io", not familiar with what that do. I don't mean to request for feature. If I get chance to start with reef-pi, i'll probably port sidecar I have for reefangel to scrape data off reef-pi and push it to influxdb route. Maybe it can be made easy to use by packing all the services into a docker image and ship that. :thinking:

I actually most interest in the idea of pi-zero per functionality, then get a set of them, join together as a cluster for monitoring. Can even have HA deployment for head unit ...
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
https://io.adafruit.com/ has REST api to send data and chart based on it. By shipping I meant reef-pi can be configured to send data to adafruit.io , where the data will be stored for charting or download for other use
code example is here: https://github.com/ranjib/reef-pi/blob/master/controller/telemetry.go
Both of your idea is sound. I dont think it will be much work to add telegraf based metric emission (telemetry module will support sending data to both adafruit.io or telegraf/statsd endpoints). Let me know your build time line, I'll add the code accordingly, so that you can test it out.
HA is very good idea. HA everything, and backed by hardware watch dog. I was looking at reef builder video of Scott Anderson's reef tank where he shows hot back up for pump (two pump are in HA mode). We know historically tank failures has been caused by heater failure , power outage like handful of things. If reef-pi can be used to address some of those challenges, it will be very nice :)
 

ReefBeta

Valuable Member
View Badges
Joined
May 26, 2016
Messages
1,318
Reaction score
1,427
Location
Seattle, US
Rating - 0%
0   0   0
Do you know how to monitor socket current like the new Apex controller do? That would be a good indicator of if equipment is properly started/shut off.
 

Reefing threads: Do you wear gear from reef brands?

  • I wear reef gear everywhere.

    Votes: 13 21.7%
  • I wear reef gear primarily at fish events and my LFS.

    Votes: 2 3.3%
  • I wear reef gear primarily for water changes and tank maintenance.

    Votes: 0 0.0%
  • I wear reef gear primarily to relax where I live.

    Votes: 7 11.7%
  • I don’t wear gear from reef brands.

    Votes: 33 55.0%
  • Other.

    Votes: 5 8.3%
Back
Top