Ahhhh, after digging through tons of posts, I finally pieced together how to do this, lol. I'll post the consolidated, & corrected instructions here for future pioneers with a few additions that could help. I'll replace any mentions of IP with a generic IP of 192.168.x.x, use your raspberry pi's IP instead. If you don't know it, go to the terminal & type ifconfig, then press enter.
- Wire up your ph board and power up your raspberry pi. Once up,you should see the ph board regisetered as i2c addres 0x40 (64 in decimal). Type i2cdetect -y 1 into terminal & press enter. The default address for your board may be different (the @Michael Lane one is 45 with both jumpers attached). It will appear in this list.
- Next download and install the 3.0 pre-alpha release. Make sure to delete the old database. In terminal, use the following commands:
- sudo systemctl stop reef-pi.service
- sudo rm -rf /var/lib/reef-pi/reef-pi.db
- sudo systemctl start reef-pi.service
- Once running , go ahead and create a new driver from the Configuration -> Drivers section, select phboard as type (pico board for pico base board users).
- Make sure to click on the drop down and select the type, even if the one shown in the UI by default is the one you are using (i.e. do an explicit selection).
- My UI gave an error if i had a space in the Name, may just be me though.
- Your address is in decimal format. Look up a "Hex to decimal convertor" & type in your address from the i2cdetect command (e.g. 0x40) & convert it. 0x45 = 69.
- Specify a name, keep it unique across different drivers.
- Next, create a connector under analog input section and associate it with the new driver, specify channel as "0" and give it a name.
- Next, create a pH monitor (if you dont see ph tab, then probably its not enabled, enable this module under Configuration -> Settings, and reload reef-pi).
- Associate the ph monitor with the newly created analog input. And that's it, you should see your ph sensors reading. Note, without calibration it will emit sensor values in raw millivolts, which for me is around -8K.
- Time to perform calibration (don't use the button, we've got to use a work around).
- If you are using reference solution (like ph 7 and 10), keep them in tank temperature and immerse probe in them and note down the reading from the dashboard. It will take a few minute to stabilize the reading. For example, if you put it in 8.21 pH solution, you may get a reading fluctuating around -8768.
- We'll be applying the calibration via API (due to UI still being worked on).
- Go to your pi's file manager, right click, create a new file, name it calibration.json containing the calibration data in this format.
[
{"expected":8.21, "observed": -8768},
{"expected":8.12, "observed": -8189}
]
- The example shows my two point calibration again my own tank water with reference reading taken from hanna ph checker.
- DISABLE the pH monitor before continuing.
- In terminal, type the following 2 commands (pressing enter after each)
curl -c cookie.txt -X POST -d '{"user":"reef-pi", "password":"reef-pi"}' http://127.0.0.1/auth/signin
- you will get a return of "null"- this is good.
curl -X POST -d @calibration.json -b cookie.txt http://192.168.x.x/api/phprobes/1/calibrate
- If you've had multiple attempts at creating a pH monitor, your pH monitor ID may not be 1. If you want to check, use the following command in terminal:
You can now go back to your UI, enable the pH probe, then watch the output to see if it's an actual pH value now!