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,825
Reaction score
17,041
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Ad a look but I don't think there's any way to setup a driver for pH that reads SPI, the drivers that are there seem to use i2c. There is a digital file option but not sure how to format the file and how it would work i.e. where does it live how do you clean it up etc. Oh well guess I just buy the ds18b20, its only $15 just wanted to use the probes I had here and it was fun to get the Analogue to Digital converter running. Might come in useful somewhere down the line.
The file driver is pretty simple, any external program can write a value in a textfile, and reef-pi can read it and use it as analog input. File path is configured during the driver creation
 

mawhins

Community Member
View Badges
Joined
Jul 4, 2019
Messages
58
Reaction score
148
Rating - 0%
0   0   0
The file driver is pretty simple, any external program can write a value in a textfile, and reef-pi can read it and use it as analog input. File path is configured during the driver creation
Is there a particular format for the file or is it just a series of values separated by a linefeed?
 

Yov

Community Member
View Badges
Joined
May 24, 2020
Messages
51
Reaction score
44
Rating - 0%
0   0   0
Hello Ranjib, first of al thank you for al the effort you put un to this! Reef-pi sure is a great open source platform!

i updated to the 3.4 becous the humidity sensor option is what i am looking for, but,


i can not seem to get a reading on ether the temp or humidity from the I2C impout;
when i sellect the option: ph status activated. I get the error :
{"error":"stats for id: '2' not found"} | HTTP 404
{"error":"stats for id: '1' not found"} | HTTP 404


and when i sellect the option : ph status inactiv
{"error":"write /dev/i2c-1: remote I/O error"} | HTTP 404

i dubble checked the wiring and this seems fine.

Also double checked the adress of the sensor, i get a sensor on adres 44 when i use the terminal
next to the SHT31-D i only have 1 digital temperature sensor on there this works perfect.

kind regards
Yov
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,825
Reaction score
17,041
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Is there a particular format for the file or is it just a series of values separated by a linefeed?
just a simple text file with a single value. reef-pi will poll. that value as dictated by the check interval
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,825
Reaction score
17,041
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Hello Ranjib, first of al thank you for al the effort you put un to this! Reef-pi sure is a great open source platform!

i updated to the 3.4 becous the humidity sensor option is what i am looking for, but,


i can not seem to get a reading on ether the temp or humidity from the I2C impout;
when i sellect the option: ph status activated. I get the error :
{"error":"stats for id: '2' not found"} | HTTP 404
{"error":"stats for id: '1' not found"} | HTTP 404


and when i sellect the option : ph status inactiv
{"error":"write /dev/i2c-1: remote I/O error"} | HTTP 404

i dubble checked the wiring and this seems fine.

Also double checked the adress of the sensor, i get a sensor on adres 44 when i use the terminal
next to the SHT31-D i only have 1 digital temperature sensor on there this works perfect.

kind regards
Yov
Hi Yov.
Thank you for the kind words and welcome to reef2reef.
You have to provide the decimal equivalent of the hexadecimal i2c address. For me its 68. Here is an example screenshot. Make sure you enable i2c via raspi-config (or by editing /boot/config.txt)

sht31d-driver.png
 

Simonv92

Active Member
View Badges
Joined
Oct 21, 2014
Messages
106
Reaction score
97
Location
Italy
Rating - 0%
0   0   0
@Ranjib at the moment the only way to send to Reef-pi an ON/OFF input is by the Raspberry header right? there's no support for any I2C based ADC? Thank you :)

Also in the latest version I'm having troubles showing the light graph in the main page. Now I've setup only 1 jack in Interval Light mode. Output works fine but on the main page I can't show the light graph.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,825
Reaction score
17,041
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
@Ranjib at the moment the only way to send to Reef-pi an ON/OFF input is by the Raspberry header right? there's no support for any I2C based ADC? Thank you :)

Also in the latest version I'm having troubles showing the light graph in the main page. Now I've setup only 1 jack in Interval Light mode. Output works fine but on the main page I can't show the light graph.
The light graphs are broken since 3.0 due to significant changes in pwm profiles. 3.0 introduced a host of different pwm profiles that can be applied (including lunar, sine , random profiles...) and we didnt have enough time to implement those in the charts. 3.5 (will be released in couple of weeks) will have interval (auto), fixed and diurnal charts (its already in master, i just have to cut a release).

Currently the only i2c based ADC thats supported is the official ph driver (pico board from blueacro also utilizes an ADC based on i2c). If theres a common chip that you think will be useful for general audience, we are happy to add a driver for the same. Since 3.0 HAL inclusion, adding new driver is pretty straight forward (which is why we have now so many different types of drivers in reef-pi).
 

mawhins

Community Member
View Badges
Joined
Jul 4, 2019
Messages
58
Reaction score
148
Rating - 0%
0   0   0
The file driver is pretty simple, any external program can write a value in a textfile, and reef-pi can read it and use it as analog input. File path is configured during the driver creation
Thanks Ranjib, should the file path be absolute and from the file system's root directory?
 

Yov

Community Member
View Badges
Joined
May 24, 2020
Messages
51
Reaction score
44
Rating - 0%
0   0   0
Hi Yov.
Thank you for the kind words and welcome to reef2reef.
You have to provide the decimal equivalent of the hexadecimal i2c address. For me its 68. Here is an example screenshot. Make sure you enable i2c via raspi-config (or by editing /boot/config.txt)

reefpi.PNG


i but it in as decimal and in config i have:
"

# Uncomment some or all of these to enable the optional hardware interfaces
dtparam=i2c_arm=on
dtparam=i2s=on
dtparam=spi=on
"
and
"
dtparam=i2c_baudrate=10000
"
when i use Sudo Detect i get
sudo detect.PNG
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,825
Reaction score
17,041
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
reefpi.PNG


i but it in as decimal and in config i have:
"

# Uncomment some or all of these to enable the optional hardware interfaces
dtparam=i2c_arm=on
dtparam=i2s=on
dtparam=spi=on
"
and
"
dtparam=i2c_baudrate=10000
"
when i use Sudo Detect i get
sudo detect.PNG
I2cdetect shows hexadecimal address. Hence 44 in i2cdetect will become 68 (4*16 +4) in reef-pi ui,
 

Yov

Community Member
View Badges
Joined
May 24, 2020
Messages
51
Reaction score
44
Rating - 0%
0   0   0
I2cdetect shows hexadecimal address. Hence 44 in i2cdetect will become 68 (4*16 +4) in reef-pi ui,
I have a reading on humidity now! i have to chose PH status switched off and then i can select 2 point for calibration. when i calibrate i can see the readout.
1590389530648.png

but i stil get the errors and no graphs.
 

Simonv92

Active Member
View Badges
Joined
Oct 21, 2014
Messages
106
Reaction score
97
Location
Italy
Rating - 0%
0   0   0
The light graphs are broken since 3.0 due to significant changes in pwm profiles. 3.0 introduced a host of different pwm profiles that can be applied (including lunar, sine , random profiles...) and we didnt have enough time to implement those in the charts. 3.5 (will be released in couple of weeks) will have interval (auto), fixed and diurnal charts (its already in master, i just have to cut a release).

Currently the only i2c based ADC thats supported is the official ph driver (pico board from blueacro also utilizes an ADC based on i2c). If theres a common chip that you think will be useful for general audience, we are happy to add a driver for the same. Since 3.0 HAL inclusion, adding new driver is pretty straight forward (which is why we have now so many different types of drivers in reef-pi).

Thank you as always :D No problem for the lights graphs, It's not a problem :D

Regarding the ADC driver maybe the ADS1115 could be a nice IC, there's a tiny Adafruit board ready to use... It only has 4 channel but for most application they should be fine ;) It also works with I2C :)

Another, at least in my opinion, great possible add could be this module:
for all of the users (works fine with 110V and 230V) who wants to have track of their tank power consumption :)
The only downside is that it works with serial communication, and a few mods are required to make it work with 3,3V.
Nothing so complicated, only a 1K resistor to solder between two points on the pcb..

P.S. if any of you is searching for an IC to extend the I2C lines, maybe to connect the control box to the PWM expander on the hood, the Texas Instruments P82B96 chip works very very good! I'm testing it with more than 10mt (32ft) of CAT5 cable without any problem!
 

BenB

Community Member
View Badges
Joined
Jun 11, 2019
Messages
98
Reaction score
152
Rating - 0%
0   0   0
Thank you as always :D No problem for the lights graphs, It's not a problem :D

Regarding the ADC driver maybe the ADS1115 could be a nice IC, there's a tiny Adafruit board ready to use... It only has 4 channel but for most application they should be fine ;) It also works with I2C :)

Another, at least in my opinion, great possible add could be this module:
for all of the users (works fine with 110V and 230V) who wants to have track of their tank power consumption :)
The only downside is that it works with serial communication, and a few mods are required to make it work with 3,3V.
Nothing so complicated, only a 1K resistor to solder between two points on the pcb..

P.S. if any of you is searching for an IC to extend the I2C lines, maybe to connect the control box to the PWM expander on the hood, the Texas Instruments P82B96 chip works very very good! I'm testing it with more than 10mt (32ft) of CAT5 cable without any problem!

Micheal Lane is working on a driver for ADS1015, that possibly works with ADC1115 as well.

I've got a ADS1015 and I'm working on a driver. It will probably be a few weeks before its done though; I have to wrap up some Open Api documentation. I think it will be compatible with ADS1115.
 

Yov

Community Member
View Badges
Joined
May 24, 2020
Messages
51
Reaction score
44
Rating - 0%
0   0   0
I have a reading on humidity now! i have to chose PH status switched off and then i can select 2 point for calibration. when i calibrate i can see the readout.
1590389530648.png

but i stil get the errors and no graphs.
@Ranjib i think you missed the last line XD
but i stil get the errors and no graphs.
 
Last edited:
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,825
Reaction score
17,041
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
@Ranjib i think you missed the last line XD
I purposefully didn’t answer that as it was not clear what you are doing.i can chart humidity fine, so I’m pretty sure there’s no bug. Often time folks will try different things or not wait enough for the chart to appear. I prefer to wait out, instead of helping immediately. This is a diy project , without the builder working hard on their build it’s more work to extend support. You would notice in this thread many times folks will hit an issue and immediately reach out , only to find out after some time a workaround or tiny mistakes.

For your case, I was not sure why you are calibrating and with what reference . I would start with charting the uncalibrated sensor values first and then proceed to next. Once you have that, then proceed with calibration (if it makes sense ).
 
Last edited:

Nerowolfe

New Member
View Badges
Joined
May 25, 2020
Messages
4
Reaction score
4
Rating - 0%
0   0   0
I am new to Reef-pi, but I have been reading the forum with interest for some time now. First up, great project with a huge potential.

When reading the setup manual, I was a little puzzled by a few things:
-> would it not be best to setup the Reef-pi with a static address, as it is a remotely managed/accessed device?
-> in the settings tab, you can select http/https, and you then enter the IP address .. my question on this, does this IP address have to be the same as the physical address, or can it be a 'virtual address' from the same range as your home network? If it is the physical address, then this is a good reason to use static address.
 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
952
Reaction score
1,280
Location
Edmonton, Canada
Rating - 0%
0   0   0
I think I came across a bug in v3.4. I just did a fresh install and got to the pH circuit which uses the ph-ezo driver, after adding it the pH is random like it's using the ph-analog driver instead and no probe connected. The circuit doesn't blink so it's not coming from it. I tried many times and checked I2C address which shows up and I can get valid readings using a terminal.

It seems if the driver was setup prior to 3.4 it didn't break when updated as mine updated fine but new additions won't.

Does this seem possible?
 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
952
Reaction score
1,280
Location
Edmonton, Canada
Rating - 0%
0   0   0
I have the same problem robsworld78 has.

I got it working by doing the following but you'll lose all your settings.

Delete the pH, connector and driver in that order.

Revert back to v3.3.1 with the following.

wget -c https://github.com/reef-pi/reef-pi/releases/download/3.3.1/reef-pi-3.3.1-pi3.deb
sudo dpkg -i reef-pi-3.3.1-pi3.deb

I tried it at this point but still didn't work so I reset the database.

sudo systemctl stop reef-pi.service
sudo rm -rf /var/lib/reef-pi/reef-pi.db
sudo systemctl start reef-pi.service

Did the reload in reef-pi and was able to add it.

Then I updated back to 3.4 and it remains working.
 

Aquatic acrobat in your aquarium: Have you ever kept an eel?

  • I currently keep an eel in my tank.

    Votes: 28 14.6%
  • I have kept an eel in my tank in the past.

    Votes: 32 16.7%
  • I have not kept an eel in my tank, but I hope to in the future.

    Votes: 33 17.2%
  • I have no plans to keep an eel.

    Votes: 96 50.0%
  • Other.

    Votes: 3 1.6%
Back
Top