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

attiland

2500 Club Member
View Badges
Joined
Jul 22, 2020
Messages
2,594
Reaction score
4,800
Location
United Kingdom
Rating - 0%
0   0   0
Interesting idea, What about python to read the input and then use the API to run the macro? You can call the API from the same python script. See my post a few pages back from an example.

http://youraddress/api/macros/{id}/run
As long as the macro checks somehow that there is an override flag for the feeding is done let’s say 1 hour ago it would work. I can do this in phyton for sure. There’s more than one way to achieve the same.
 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
952
Reaction score
1,281
Location
Edmonton, Canada
Rating - 0%
0   0   0
Hello, I have a little problem with 4.1 version, how can I change the colour in the dashboard graph? because the line is white on a white background.

I'm using Roberto Buti Ph board, two for ph probe and one for redox probe , sometimes I found a reading error. every 5 minutes I check the value, it's because i'm reading on i2c at the same time? or because the baud rate is too fast?
You should be able to change the color in the main tab for whatever the graph is for. If it's pH go to pH tab and you can change color.

The pH errors could be due to I2C issues, the more devices connected the more likely issues will happen. Try slowing the baud rate down by adding the following line to the config.txt file in the boot folder on the Pi SD card. I recommend everyone does this even if no issues.

dtparam=i2c_arm_baudrate=10000

This will set the speed to 10 khz instead of 100 khz and hopefully cure things.
 

natebatey

New Member
View Badges
Joined
Jan 9, 2021
Messages
10
Reaction score
6
Location
home
Rating - 0%
0   0   0
Hi all! Its been too long and I totally forgot about pwm lights I recived my 3 black boxes and I will change some leds. I noticed that drivers are pwm driven. There is 3.3v, pwm and ground. So if I wire this to mikes hat this should work. Ok ground and pwm. What do I do with 3.3v coming out of driver? Sorry its been a
Hi Matevz, (or anyone who can answer) I assume someone answered your question, "What do I do with the 3.3v coming out of the driver?", but I couldn't find any. I have the same light and would like to control from reef-pi, did you get this to work?

Also I only have one light so I think I can just go straight out of the pi to the pwm on the light, instead of using a hat? If so, then I just run the pwm and ground from the light straight to the pi pwm and ground? Thanks
 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
952
Reaction score
1,281
Location
Edmonton, Canada
Rating - 0%
0   0   0
Hi Matevz, (or anyone who can answer) I assume someone answered your question, "What do I do with the 3.3v coming out of the driver?", but I couldn't find any. I have the same light and would like to control from reef-pi, did you get this to work?

Also I only have one light so I think I can just go straight out of the pi to the pwm on the light, instead of using a hat? If so, then I just run the pwm and ground from the light straight to the pi pwm and ground? Thanks
If you check with volt meter you should get no voltage on 3.3v wire, it's expecting 3.3v. @GaryE uses same light, at least same driver and powered the 3.3v from the PI. Two posts in a row explain.


You won't need a hat, the two PWM pins on Pi will work fine, remember to enable them in the Pi settings.
 

natebatey

New Member
View Badges
Joined
Jan 9, 2021
Messages
10
Reaction score
6
Location
home
Rating - 0%
0   0   0
If you check with volt meter you should get no voltage on 3.3v wire, it's expecting 3.3v. @GaryE uses same light, at least same driver and powered the 3.3v from the PI. Two posts in a row explain.


You won't need a hat, the two PWM pins on Pi will work fine, remember to enable them in the Pi settings.
Great, I will try that. Thanks!
 

Alaa

Community Member
View Badges
Joined
Nov 28, 2018
Messages
74
Reaction score
80
Rating - 0%
0   0   0
Hi all

I’m having some troubles in my reef pi setup, help would be appreciated

1-pH reading problem

2021-03-19_19-38-54.png



As you can see I may have issues in my reef tank but pH reading of 22-24 is not compatible with aquatic life, the issue started after I calibrated my pH probe (I mentioned in a previous post) when I started having low readings from the tank (7.4-7.7) but proper reading from reference solution, I was advised it was mostly my tank pH that was low, however after retesting several times and having tank pH 8-8.1 I recalibrated my pH probe the then when added to the tank the readings were 22-24 while reading the calibration fluid properly.

I tried erasing stuck data using a previous post (running python script)

sudo wget -c https://robo-tank.ca/Robo-Tank_pH_Script.zip

python Robo-Tank_pH_Script.py

I entered R
but got query failed



How do I recalibrate my pH properly and get all bad data from the system, if I save the reefpi database and then fresh install will it work



2- API usage




I’m trying to setup reefpi with home assistant, I had luck using MQTT, however I’m stuck with API

I’m trying to control a pump with rest platform

This is what I have in my sensors.yaml



rest command.png



Now the first rest order worked fine for a while then I started getting not authorized, though I updated the reefpi cookie, The second one never worked I always get invalid body on as per attached pic

invalid body on.png


this is what i get from my reef pi API docs

equipment ID 11 raw.png
 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
952
Reaction score
1,281
Location
Edmonton, Canada
Rating - 0%
0   0   0
not sure what you mean by "enable them" in the settings? I don't see anything in the PI settings about PWM?
Sorry I thought you could access with raspi-config but instead you need to edit the config.txt file in /boot/ directory.

Add the following line at the bottom.

dtoverlay=pwm-2chan

You can use the following to edit on Pi, might have to restart Pi after.

sudo nano /boot/config.txt
 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
952
Reaction score
1,281
Location
Edmonton, Canada
Rating - 0%
0   0   0
Hi all

I’m having some troubles in my reef pi setup, help would be appreciated

1-pH reading problem

2021-03-19_19-38-54.png



As you can see I may have issues in my reef tank but pH reading of 22-24 is not compatible with aquatic life, the issue started after I calibrated my pH probe (I mentioned in a previous post) when I started having low readings from the tank (7.4-7.7) but proper reading from reference solution, I was advised it was mostly my tank pH that was low, however after retesting several times and having tank pH 8-8.1 I recalibrated my pH probe the then when added to the tank the readings were 22-24 while reading the calibration fluid properly.

I tried erasing stuck data using a previous post (running python script)

sudo wget -c https://robo-tank.ca/Robo-Tank_pH_Script.zip

python Robo-Tank_pH_Script.py

I entered R
but got query failed



How do I recalibrate my pH properly and get all bad data from the system, if I save the reefpi database and then fresh install will it work



2- API usage




I’m trying to setup reefpi with home assistant, I had luck using MQTT, however I’m stuck with API

I’m trying to control a pump with rest platform

This is what I have in my sensors.yaml



rest command.png



Now the first rest order worked fine for a while then I started getting not authorized, though I updated the reefpi cookie, The second one never worked I always get invalid body on as per attached pic

invalid body on.png


this is what i get from my reef pi API docs

equipment ID 11 raw.png
Hi, for the pH issue can you try the python script again but disable the pH in reef-pi first. If it's trying to read and you type in R you can get query failed.

When you get a value after typing in R type in D and press enter. That will say query failed but if R worked it worked. After that unplug power from controller and start the script again and type R, that'll be the raw value from the circuit so we'll know where the problem lays. Also try unplugging your probe and doing R to see what value you get, should be around 4.1.

The circuit can manage calibration on it's own which I'm discovering can be a problem, I'm just going to remove all the extra features from the circuit as they aren't being used anyway. If it doesn't start working maybe start a new thread about this.

Sorry I can't help with the API.
 

kerm007

New Member
View Badges
Joined
Mar 19, 2021
Messages
1
Reaction score
0
Location
Montreal
Rating - 0%
0   0   0
Welcome to the development thread of reef-pi, an open-source, affordable, modular DIY reef-tank controller based on Raspberry Pi.

aio.jpg

If you are trying to build a reef-pi controller, please check out the build guides linked below. You can use this thread to seek help and to stay updated with the latest development.

Screen Shot 2018-11-04 at 8.38.50 PM.png



reef-pi provides following functionalities:
  • Equipment control or automated power strip (including digital timers to switch on/off equipment at periodic intervals)
  • LED light control (24 hour cycle), diurnal cycle, fixed dimmig
  • Auto Top Off (based on photoelectric water level sensor or float switch)
  • Temperature monitoring and control (switch on/off heater & chiller)
  • pH monitoring
  • Dosing automation
  • Macro (feed mode etc)
  • And several other features like camera controls (periodic image capture and upload on google drive), telemetry (dashboard and alerting based on sensor values using adafruit.io), mobile friendly UI etc.
A beginner friendly list of reef-pi build guides are available on adafruit.io, if you are planning to build a reef-pi controller start with them.
  1. Setup and installation
  2. Power controller
  3. Temperature controller
  4. Auto Top Off
  5. Light controller
  6. pH monitor
Since reef-pi is modular and customizable, the cost of individual builds varies. In our experience reef-pi controller are almost always cheaper than the commercial alternatives and costs anywhere between 100 to 550 USD. An example bill of materials can be found here as amazon list. If you are building a reef-pi controller, I highly encorage you start a build thread and tag it with #reefpi to seek help with your build


--------------------------- Original thread start ---------------------
Hello friends,
I am starting a master thread for a DIY reef tank controller that is based on all opensource software and hardware. I had started with this project with following goals:
- Build an opensource software and hardware based reeftank controller that anyone can use and hack
- Keep the controller well tested against a set of standard equipment I use, while make it possible for other equipment to be used
- Maintain my own tank build threads and their evolution, backed by this controller.
- Learn electronics and reef keeping along the way (I am biologist by education & software engineer by occupation)

Following are the details of what I have developed & tested till now:
Controller software:
- The main controller software is called reef-pi. It is written in go, its fast and performant. It used embd for hardware communication. It also runs a little web server which provides the UI for the controller. UI is written in React , and can be accessed from anything that has web browser. As of now, the reef-pi supports following things:
- AC 110/220 V socket on/off (uses optocoupled relays underneath). This is used to remotely switch on/off return pump, LED bulb, heater etc.
- 0-20 Volt DC PWM. This is used to control things like dimmable LEDs, DC pumps. I use it to control my Kessil A80, A360. As well as a 5V DC pump (i use it as wave maker in one of my pico with SPS). PWM is done using PCA9685 breakout board from adafruit. This board supports 16 channels. I am using only 5 at max, as of now.
- Analog sensor support using MCP3008 analog to digital converter. This supports 8 channels. i.e. I can use up to 8 sensors/probes. As of now, I have only tested temperature sensor with it.
Other than the following basic hardware/equipment support, the controller software provides following additional features:
- Setting up daily/weekly/monthly scheduled jobs. Like turning on/off certain equipment. I use this feature to run my AC20 HOB filter nightly.
- Setting up dusk-to-dawn like lighting using PWM. The UI gives 12 vertical slider based 0-24 hours (each slider representing 2 hours gaps). I combine two of these two control the kessil LEDs.
- Authentication using Google OAuth. Since the whole controller runs on raspberry pi and provides an web frontend, security of one of my concern. To mitigate this, I have added google authentication support, which when configured will allow only certain users to log in (email specified in the configuration value).

This is the summary of the core controller software and what features it has as of now. I am constantly writing/improving things around it. As of now, I have two reef tank powered by this. I 'll have seperate threads on the individual builds that will include the housing and ancillary hardware in nano-reef.com, as my tank build threads are there, but I'll share all the controller specific common bits here, including UI screen shots, and tank pics :)

20161115_081550.jpg
hello very nice project im new to raspberry pi and i want to start with ph monitoring but i want to add more in the futur what box should i buy and what part for the ph since i already have the raspberry pie zero wH ? Thanks
 

Alaa

Community Member
View Badges
Joined
Nov 28, 2018
Messages
74
Reaction score
80
Rating - 0%
0   0   0
Hi, for the pH issue can you try the python script again but disable the pH in reef-pi first. If it's trying to read and you type in R you can get query failed.

When you get a value after typing in R type in D and press enter. That will say query failed but if R worked it worked. After that unplug power from controller and start the script again and type R, that'll be the raw value from the circuit so we'll know where the problem lays. Also try unplugging your probe and doing R to see what value you get, should be around 4.1.

The circuit can manage calibration on it's own which I'm discovering can be a problem, I'm just going to remove all the extra features from the circuit as they aren't being used anyway. If it doesn't start working maybe start a new thread about this.

Sorry I can't help with the API.
Hi, thanks for your response
i tried but still no luck, i'm using pH board not robotank, so maybe this is the reason
 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
952
Reaction score
1,281
Location
Edmonton, Canada
Rating - 0%
0   0   0
Hi, thanks for your response
i tried but still no luck, i'm using pH board not robotank, so maybe this is the reason
Are you using my pH board? If not that python script won't work. Did you try deleting the pH from pH tab and adding it back? That will clear the calibration data from the database.
 

Dukereefnz

Active Member
View Badges
Joined
Aug 23, 2020
Messages
381
Reaction score
207
Location
Hunua - New Zealand
Rating - 0%
0   0   0
Hi - my reef-pi - I cant view the remote screen on my PC.
Everything was working fine then - no remote screen connection.

- I enter the modem and i can see that wifi is connected and I can see the IP address.
- I can use CMD and ping that IP address and my PC sent 4 and received 4
- The reef pi was still controlling a dosing pump connected on my desk and turns it on each day.. was setup for testing.
- Putty/ putty does not work on my PC
- Checked Pi and SHH it is turned on.

I have run sudo systemctl restart reef-pi.service and sudo systemctl status reef-pi.service and the Pi screen says running.

I have the Pi connected to a keyboard, mouse and a screen but I can not view the reef pi on a screen, tried tablet and PC - no connection. Modem says its connected and I can ping the pi.

any ideas?
 
Last edited:

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,521
Reaction score
1,511
Rating - 0%
0   0   0
Hi - my reef-pi - I cant view the remote screen on my PC.
Everything was working fine then - no remote screen connection.

- I enter the modem and i can see that wifi is connected and I can see the IP address.
- I can use CMD and ping that IP address and my PC sent 4 and received 4
- The reef pi was still controlling a dosing pump connected on my desk and turns it on each day.. was setup for testing.
- Putty/ putty does not work on my PC
- Checked Pi and SHH it is turned on.

I have run sudo systemctl restart reef-pi.service and sudo systemctl status reef-pi.service and the Pi screen says running.

I have the Pi connected to a keyboard, mouse and a screen but I can not view the reef pi on a screen, tried tablet and PC - no connection. Modem says its connected and I can ping the pi.

any ideas?
At risk of me sounding like an absolute idiot, have you just tried turning it off and on again? The whole pi? Seems like it reacts to your commands, so give it a shutdown -r
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,345
Reaction score
1,722
Location
Missouri
Rating - 0%
0   0   0
Looking for anyone that has a goby hat that @Michael Lane used to produce. I would like to have a spare unit, if anyone has one they want to let go shoot me a PM.

Thanks :)
 
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
@Ranjib I am seeing a strange trend in temp over the last week.. Here is 7 days of temp graph. Mind you the swing is no more than .5 degrees, but I do have it set at .1 hysteresis.

Screenshot_20210319-220330.png
Do you have ambient temperature reading? Any chance the heater is not able to keep up ? Or you think it’s a software issue ....?
 

Tentacled trailblazer in your tank: Have you ever kept a large starfish?

  • I currently have a starfish in my tank.

    Votes: 33 30.3%
  • Not currently, but I have kept a starfish in the past.

    Votes: 28 25.7%
  • I have never kept a starfish, but I hope to in the future.

    Votes: 24 22.0%
  • I have no plans to keep a starfish.

    Votes: 24 22.0%
  • Other.

    Votes: 0 0.0%
Back
Top