Reef pi and Anyleaf PH Module

trenfrow

New Member
Review score
+0 /0 /-0
View Badges
Joined
Jun 28, 2021
Messages
4
Reaction score
0
Review score
+0 /0 /-0
Location
Paso Robles
Rating - 0%
0   0   0
I need some help. I purchased an Anyleaf PH module. https://www.anyleaf.org/ph-module

Wired it up and for some reason Reef pi does not see it. Any help would be awesome. I am sure it is something easy. I am not good at the code. I just need someone to point me in the right direction.

thanks in advance
 
BRS

attiland

2500 Club Member
Review score
+0 /0 /-0
View Badges
Joined
Jul 22, 2020
Messages
2,594
Reaction score
4,787
Review score
+0 /0 /-0
Location
United Kingdom
Rating - 0%
0   0   0
I need some help. I purchased an Anyleaf PH module. https://www.anyleaf.org/ph-module

Wired it up and for some reason Reef pi does not see it. Any help would be awesome. I am sure it is something easy. I am not good at the code. I just need someone to point me in the right direction.

thanks in advance
I don’t know this model but as per the description you need to use a python script to query the probe.
Assuming you have wired it up correctly (check if you see the board in i2c installed on I2C address: 0×48 or 0x49 (selectable))the software you should able to do;
  • python3 ph_orp.py
This should display the ph reading
Did you get this fare?
If so just a few line to modify and you can pass the reading to a file and that can be picked up by reef-pi

from git; https://github.com/anyleaf/anyleaf-python

Quickstart​

To get started as quickly as possible on Raspberry Pi:

  • Activate I2C (pH and ORP module): Run sudo raspi-config. Select Interfacing Options → I2C → Yes.
  • Activate SPI (RTD temp module): Same as above, but select SPI instead of I2C.
  • Reboot
Then run these commands from a terminal:

 
Last edited:
Top Shelf Aquatics
OP
OP
T

trenfrow

New Member
Review score
+0 /0 /-0
View Badges
Joined
Jun 28, 2021
Messages
4
Reaction score
0
Review score
+0 /0 /-0
Location
Paso Robles
Rating - 0%
0   0   0
I don’t know this model but as per the description you need to use a python script to query the probe.
Assuming you have wired it up correctly (check if you see the board in i2c installed on I2C address: 0×48 or 0x49 (selectable))the software you should able to do;
  • python3 ph_orp.py
This should display the ph reading
Did you get this fare?
If so just a few line to modify and you can pass the reading to a file and that can be picked up by reef-pi

from git; https://github.com/anyleaf/anyleaf-python

Quickstart​

To get started as quickly as possible on Raspberry Pi:

  • Activate I2C (pH and ORP module): Run sudo raspi-config. Select Interfacing Options → I2C → Yes.
  • Activate SPI (RTD temp module): Same as above, but select SPI instead of I2C.
  • Reboot
Then run these commands from a terminal:

@attlland ok. I know now that the probe works. now I need to get it to talk to Reefpi.
 
OP
OP
T

trenfrow

New Member
Review score
+0 /0 /-0
View Badges
Joined
Jun 28, 2021
Messages
4
Reaction score
0
Review score
+0 /0 /-0
Location
Paso Robles
Rating - 0%
0   0   0
Can you post the script you are using? I can help you to add the few lines to talk to Pi
When I run this bit of code, it spits out data.
import time
import board
import busio
from anyleaf import PhSensor, CalPt, OnBoard

def main():
i2c = busio.I2C(board.SCL, board.SDA)
delay = 1 # Time between measurements, in seconds
phSensor = PhSensor(i2c, delay)

phSensor.calibrate_all(
CalPt(0., 7., 25.), CalPt(0.18, 4., 25.)
)

while True:
print(f"pH: {phSensor.read(OnBoard())}")

time.sleep(delay)


if __name__ == "__main__":
main()

How do I get Reef PI to use this data?
 
www.dinkinsaquaticgardens.com

attiland

2500 Club Member
Review score
+0 /0 /-0
View Badges
Joined
Jul 22, 2020
Messages
2,594
Reaction score
4,787
Review score
+0 /0 /-0
Location
United Kingdom
Rating - 0%
0   0   0
When I run this bit of code, it spits out data.
import time
import board
import busio
from anyleaf import PhSensor, CalPt, OnBoard

def main():
i2c = busio.I2C(board.SCL, board.SDA)
delay = 1 # Time between measurements, in seconds
phSensor = PhSensor(i2c, delay)

phSensor.calibrate_all(
CalPt(0., 7., 25.), CalPt(0.18, 4., 25.)
)

while True:
print(f"pH: {phSensor.read(OnBoard())}")

time.sleep(delay)


if __name__ == "__main__":
main()

How do I get Reef PI to use this data?
You have put the reading to a file so reef-pi can read it. I will able to change this code for you so you can ran it and write to a file for you on Monday
 

Ranjib

7500 Club Member
Review score
+0 /0 /-0
View Badges
Joined
Apr 16, 2016
Messages
9,810
Reaction score
16,998
Review score
+0 /0 /-0
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
butt @attiland mentioned, you have to update the code to write the data into a file. and do so in a loop, say after every 1 minute. and then in reef-pi you add a file driver (configuration ->drivers -> new) that reads that file. With the file driver added, next create an analog connector that will use the new driver (based on the file your python script is generating) . Once you have the analog connector, you can use it with ph controller.
 
Nutramar Foods

theatrus

Valuable Member
Review score
+0 /0 /-0
View Badges
Joined
Mar 26, 2016
Messages
1,693
Reaction score
3,034
Review score
+0 /0 /-0
Location
Sacramento, CA area
Rating - 0%
0   0   0
Hey - AnyLeaf creator here. Let me know if there's anything I can do to help adapt the code to work with Reef pi.

Glad to see more module makers around :) (Its hard to keep up with demand sometimes)

The simplest integration now with Reef-Pi would be to make a canned daemon which reads sensors and writes results to a file (preferably in tmpfs) - the file driver can pick it up.

If you want to integrate directly you can add a driver here (and a few other places in the UI): https://github.com/reef-pi/drivers - the other pH drivers are (all?) I2C as well so its easy to adapt.

I see you have a few Rust MCU examples, which is cool as I've been dabbling in that space as well.
 

eves65

New Member
Review score
+0 /0 /-0
View Badges
Joined
Jan 24, 2010
Messages
1
Reaction score
0
Review score
+0 /0 /-0
Location
italy
Rating - 0%
0   0   0
@attlland ok. Ora so che la sonda funziona. ora ho bisogno di farlo parlare con Reefpi.
ciao anche io, ho recentemente acquistato i moduli ph e orp anyleaf.... puoi dirmi come lo fai parlare con reef-pi?
Seve

Translation:
hello me too, i recently bought the ph and orp modules anyleaf .... can you tell me how you make it talk to reef-pi?
 
Last edited by a moderator:

Polyp polynomial: How many heads do you start with when buying zoas?

  • One head is enough to get started.

    Votes: 27 10.6%
  • 2 to 4 heads.

    Votes: 145 57.1%
  • 5 heads or more.

    Votes: 65 25.6%
  • Full colony.

    Votes: 10 3.9%
  • Other.

    Votes: 7 2.8%

New Posts

Join the movement!
Back
Top