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

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 been reading through this monster thread and am excited by the idea! I've ordered my first raspberry pi (a 4B) and a few things. I don't currently have a tank as we're in the market for buying a house, but have a few questions for planning purposes.

  1. Will this work with non kasa-brand smart outlets? Something similar to Amazon product
  2. If I use a Kasa brand strip that has power monitoring, can I set conditions for this? For instance, if the heater is supposed to be on but no power is being used, send an alert. That would be a huge help for equipment failure.

Current plans for tank include a 300-500 gallon tank (depending on available floor space in whatever house we get). It will be plumbed through to the basement where there will be something like 500-700 gallons of refugium, filtration, frag tanks, and the like.

From what I've read reef-pi will do exactly what I need, and I'm an inveterate tinkerer so it's right up my alley, although to be fair I've not done much with electronics since high school (when I was more active in ham radio). The main needs I see for my setup will be:
  • Temperature sensing with heater control based on results
  • pH sensing with control of either a reactor or dosing mechanism (haven't decided yet).
  • Auto top off of tank
  • Lighting control in all it's various and confusing forms :D
  • Power head control (possibly with wave maker functionality)
  • Feeding mode to shut off pumps for 30 mins and skimmer for another hour beyond that
  • API support so I can kludge together a UI for quick reading and touch screen control
  • Dosing of additives using dosing pumps
  • Ability to use an emergency shutoff switch to stop all pumps (i.e. toggle switch or the like to override everything else)

Cheers!

This thread is more of history and what going on with reef-pi. And everything in between :). Dont use it to learn or build reef-pi, you can use it to seek help if need be. Use the website and adafruit guides for that. Godspeed and welcome to reef2reef.
 
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
Having trouble with the ATO setting.
I am using a CQR Robot sensor. It has a 3.3 volt and 5 volt switch on it. It does trigger when wet or dry. Works fine for a while. Then it will just turn on the pump fill until it is completely submerged. And the equipment light is green. When I pull it out of the water and go back in looks like it is working OK.
It is intermittent.

I am using Pi Version 3.0. Any ideas ? I use a small ATO source so I have not had a big disaster yet.
Try to pinpoint if the problem is with the sensor itself, if so, i am afraid we cant do much from reef-pi side. Depending upon which GPIO (example assume 24) you are using you can check the sensor value
Code:
/sys/class/gpio/gpio24/value
you should see 1 or 0 depending upon whether the sensor is in or out of water. Its ok if the readings are reverses, as long as its consistent its good
 

MangroveCorals

New Member
View Badges
Joined
Jan 5, 2020
Messages
16
Reaction score
29
Rating - 0%
0   0   0
That will be awesome. We could use any and all the help across code, tests, documentation. We generally use the slack channel for development-related discussion, you are most welcome to join us there, link is one the very first post of this thread (or in the website)
Good afternoon Ranjib!
I signed into my Github and did some reading for development for reef-pi. In the next few days I’ll have the environment set up with go and reacton my MacBook and start tinkering around!
 

burningbaal

Active Member
View Badges
Joined
Aug 13, 2019
Messages
232
Reaction score
257
Location
Near Seattle
Rating - 0%
0   0   0
I just sent a request to join the group.
I sent an invite for you to be admin. I'll add some moderators as I see the conversations start and can get to know people better. I figure if it gets enough people, we should have a handful of moderators to help keep things civil. Happy to take your recommendations as it's getting started as long as we don't have too many mods
 

jhoop

Active Member
View Badges
Joined
Jan 10, 2014
Messages
156
Reaction score
179
Location
Cleveland Ohio
Rating - 0%
0   0   0
Try to pinpoint if the problem is with the sensor itself, if so, i am afraid we cant do much from reef-pi side. Depending upon which GPIO (example assume 24) you are using you can check the sensor value
Code:
/sys/class/gpio/gpio24/value
you should see 1 or 0 depending upon whether the sensor is in or out of water. Its ok if the readings are reverses, as long as its consistent its good
Thanks I will try that !
 
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
Good afternoon Ranjib!
I signed into my Github and did some reading for development for reef-pi. In the next few days I’ll have the environment set up with go and reacton my MacBook and start tinkering around!
I keep missing the invite link lol Mind linking it again and I’ll get into the discussion thread as well as follow up with GitHub and direct me to the priority coding / documentation , etc.
Awesome :) . Keep us posted and don’t hesitate to ask questions . I’ll try to organize the 4.0 release as projects and do a design /arch documentation , those two should help you and anyone interested in contribution . This has been pending, we’ll tackle this as deliverable in this year
 
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 keep missing the invite link lol Mind linking it again and I’ll get into the discussion thread as well as follow up with GitHub and direct me to the priority coding / documentation , etc.
Slack link is updated
 

marekd1

Active Member
View Badges
Joined
Dec 24, 2019
Messages
133
Reaction score
200
Rating - 0%
0   0   0
Ya I understand how to switch it and had done so in the past but when I updated the v3 both my webserver running on lighttpd and reef-pi we're on the same port 80 again so I couldn't access reef pi UI to change it back. So I was wondering if there was a way that I could access a config file for reef pi to configure outside of the web UI.

config is contained in the db file. I am not sure if you can edit it. That would be a good question to Ranjib.
 

raketemensch

Ape That Likes Fish
View Badges
Joined
Oct 13, 2019
Messages
378
Reaction score
478
Location
Northwest CT
Rating - 0%
0   0   0
you can update the address to specify any port you want, for example this configuration makes reef-pi to run on port 8080, this is how we do it in development

I think what he's asking is where there's a config file on the filesystem that he can change that value in, because he can't get to that screen in the UI right now.

He could stop the other service on 80 for a few, as well, but maybe that's not possible or a good thing for some reason.

I can't check for the file right now, I don't have access to my pi from here.
 

marekd1

Active Member
View Badges
Joined
Dec 24, 2019
Messages
133
Reaction score
200
Rating - 0%
0   0   0
Sounds like you're thinking ahead!!

I can't help with the smart outlets, as I typically just build my own outlets powered by relays. But as far as all the features you listed:

  • Temperature sensing with heater control based on results
  • pH sensing with control of either a reactor or dosing mechanism (haven't decided yet).
  • Auto top off of tank
  • Lighting control in all it's various and confusing forms :D
  • Power head control (possibly with wave maker functionality)
    • Power head control is theoretically possible, but it's not really baked into Reef-Pi natively. If you're wanting a simple on/off, you can just set it on a schedule in the equipment control. If you're wanting to ramp up & down based on voltage, I'd say the easiest way to do that would to be set it up in Reef-Pi as a "dosing pump". Though these may not be the best work-arounds, as you'd probably have to schedule each ramp-up & down... @Ranjib , any ideas?
  • Feeding mode to shut off pumps for 30 mins and skimmer for another hour beyond that
    • Super easy, there's a macro tab that allows you to select groups of equipment to turn off/on for a specified amount of time that you can trigger with a single button.
  • API support so I can kludge together a UI for quick reading and touch screen control
  • Dosing of additives using dosing pumps
  • Ability to use an emergency shutoff switch to stop all pumps (i.e. toggle switch or the like to override everything else)
    • If you're wanting a software emergency switch, just set up a macro to turn off all pumps & such.
    • If you're wanting a hardware switch, it'd be pretty easy to install a power switch on your setup, like I've got below. Or, just pull the plug!
16 Outlet from front(Transparent BG, Shrunk).JPG


Glad you found the thread & hope it helps with what sounds like an awesome future setup!


Just a comment, nice power distribution but little scary if you need to load all on a single feed of power. Typical house wiring 14/2 with maximum 15A panel breaker. Since it is very likely that this is not going to be plugged into a dedicated circuit and will be shared with some of the existing receptacles in the house very easy for cabling to overheat and spark a house fire. Just an FYI
 

marekd1

Active Member
View Badges
Joined
Dec 24, 2019
Messages
133
Reaction score
200
Rating - 0%
0   0   0
Personally, I've never really liked the optical sensors. They're very finicky & I've had builds do the exact same. I've never truly been able to pin down what causes it, but one of my theories is that the level of light it receives & detects as a trigger depends on the light available when it receives power.

Try turning your setup on with the sensor in the lighting condition it will be installed in. There may be an issue with it getting "room light", then being placed in a dark area under the sump, something with trigger levels being set upon initialization possibly.

In order for optical to work you need to trigger on specific voltage. The output voltage will vary depending on how much reflected light makes it back trough refraction of source IR light inside the sensor. You can actually detect water if just touching the tip to fully submerged lens. Voltage does vary during this transition. I typically used them on arduino's analog inputs. Solid performance. They are completely immune to room light. they work on light refraction cased by the water hitting the plastic lens. Given that I always double up on any sensor and insert logic to handle the failure notification/protection of single sensor never had an issue and I've been using them for over 2 years now.
 

marekd1

Active Member
View Badges
Joined
Dec 24, 2019
Messages
133
Reaction score
200
Rating - 0%
0   0   0
Hi everybody, a suggest if you want to implement any other sensor (digital or analogic) is to use an arduino connected via i2c ro the rpi. I'm succesfully using this technique to achieve a reading of both analog ph-meter and an ec-meter. I perform also value-based actions on these sensors. I have seen ranjib talking about the new feature homeostatis, THANK YOU for the great work, now im waiting for that being implemented to reduce the arduino tasks.

Can you share how you configured the RPI to talk to Arduino over i2c?
 

marekd1

Active Member
View Badges
Joined
Dec 24, 2019
Messages
133
Reaction score
200
Rating - 0%
0   0   0
in this route, where you are primarily using the arduino for analog input, how you do galvanic isolation? reef-pi currently has a HAL Analog driver interface that we can use to implement an arduino driver. We can totally do it if it makes sense (i.e. the results we get are good enough for our use case, and theres enough appetite for such use case)

Ability to interface to Arduino from reef-pi over I2C would be tremendous. Especially for I/O control to start. Not to mention access to analog inputs that can be used for not only analog PH but many other applications like tuning optical sensor levels.

Another good option would be to do it over serial so this will provide ability to have Arduino at remote location if needed.

The simplest way of galvanic isolation is to have two independent power sources. so in this case if Arduino is fed by another power supply ( will need to be with transformer) then if another PH probe is fed from Reef-PI they will not interfere with each other.
 
Last edited:

kdx7214

Well-Known Member
View Badges
Joined
Jan 5, 2020
Messages
830
Reaction score
725
Location
Columbia, MO, US
Rating - 0%
0   0   0
Just a comment, nice power distribution but little scary if you need to load all on a single feed of power. Typical house wiring 14/2 with maximum 15A panel breaker. Since it is very likely that this is not going to be plugged into a dedicated circuit and will be shared with some of the existing receptacles in the house very easy for cabling to overheat and spark a house fire. Just an FYI


A buddy of mine is an electrician and he estimated that I'll need at least 4 separate circuits for what I plan to do. He said he'll run 6 just to be on the safe side. It's great having friends :D
 
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 keep missing the invite link lol Mind linking it again and I’ll get into the discussion thread as well as follow up with GitHub and direct me to the priority coding / documentation , etc.
Start with the developer environment setup (docs in website, link is in slack header), check out 4.0 project in github under reef-pi repo for a tentative list of things we plan to work on 4.0 (more to be added). Let us know your strength , time availability and the things you want to learn and we can definitely find a suitable work item for you.
Godspeed
 
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
Ability to interface to Arduino from reef-pi over I2C would be tremendous. Especially for I/O control to start. Not to mention access to analog inputs that can be used for not only analog PH but many other applications like tuning optical sensor levels.

Another good option would be to do it over serial so this will provide ability to have Arduino at remote location if needed.

The simplest way of galvanic isolation is to have two independent power sources. so in this case if Arduino is fed by another power supply ( will need to be with transformer) then if another PH probe is fed from Reef-PI they will not interfere with each other.
In 3.0 we introduced HAL (hardware abstraction layer), using that it should be relatively easy to have a arduino driver that can do pwm, digital i/o, analog input etc.. if you are mimicing the existing protocols, then you should be able to just add it as an existing driver :)
 
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
A buddy of mine is an electrician and he estimated that I'll need at least 4 separate circuits for what I plan to do. He said he'll run 6 just to be on the safe side. It's great having friends :D
+1000 ,,
 
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 think what he's asking is where there's a config file on the filesystem that he can change that value in, because he can't get to that screen in the UI right now.

He could stop the other service on 80 for a few, as well, but maybe that's not possible or a good thing for some reason.

I can't check for the file right now, I don't have access to my pi from here.
the config and everything in reef-pi is stored in database, as binary file (/var/lib/reef-pi/reef-pi.db), in 3.0 we have introduced a command (reef-pi db) that allows you to introspect and update/delete stuff from database directly bypassing UI. reef-pi needs to stopped before doing this.
 
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
Hive mind
its been more than a month since 3.0 release. Thankfully we have not heard of any serious bugs except few edge cases (bugs induced by very specific type of inputs or usecases). I have taken time to go through those and fix them along with addressing several minor bugs (does not impact controller behavior/function critically but undesirable or confusing things). There are few minor but very useful feature that also i felt were missing after using 3.0 for a month. I have made all those changes and we are shipping reef-pi 3.1 today. This is a non invasive drop in upgrade. All 3.0 users should be able to upgrade without any modifications. Following are the key highlights from 3.1 release

Features
- Revert button in macro ui and api
- ATO, Temperature UI provides top-level enable/disable buttons
- Introduce pi version detection capability and expose it as part of summary information
- Macros can be triggered via ato
- Introduce Undervoltage detector (chart/alerting capability yet to be added)


Bugfixes
- Fix grid alignment under dashboard configuration UI
- Fix interval profile out of index error
- Fix inlet UI components alignment
- Hysteresis validation is applied even when the chiller threshold is not defined
- Fix data race issues in unit tests

Chore
- i18n loader improvement
- dependency upgrades (frontend and backend)
- Improve Chinese translation


Release builds can be found in usual location


cheers,
 

AbjectMaelstroM

Valuable Member
View Badges
Joined
Jul 21, 2019
Messages
1,530
Reaction score
1,811
Location
RVA
Rating - 100%
1   0   0
Hive mind
its been more than a month since 3.0 release. Thankfully we have not heard of any serious bugs except few edge cases (bugs induced by very specific type of inputs or usecases). I have taken time to go through those and fix them along with addressing several minor bugs (does not impact controller behavior/function critically but undesirable or confusing things). There are few minor but very useful feature that also i felt were missing after using 3.0 for a month. I have made all those changes and we are shipping reef-pi 3.1 today. This is a non invasive drop in upgrade. All 3.0 users should be able to upgrade without any modifications. Following are the key highlights from 3.1 release

Features
- Revert button in macro ui and api
- ATO, Temperature UI provides top-level enable/disable buttons
- Introduce pi version detection capability and expose it as part of summary information
- Macros can be triggered via ato
- Introduce Undervoltage detector (chart/alerting capability yet to be added)


Bugfixes
- Fix grid alignment under dashboard configuration UI
- Fix interval profile out of index error
- Fix inlet UI components alignment
- Hysteresis validation is applied even when the chiller threshold is not defined
- Fix data race issues in unit tests

Chore
- i18n loader improvement
- dependency upgrades (frontend and backend)
- Improve Chinese translation


Release builds can be found in usual location


cheers,

Awesome!
 
Back
Top