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

trackerit

Community Member
View Badges
Joined
Apr 11, 2019
Messages
71
Reaction score
137
Rating - 0%
0   0   0
[emoji17]
1555358577191.jpeg
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,344
Reaction score
1,720
Location
Missouri
Rating - 0%
0   0   0
Quite likely. It’s possible the kernel driver gets in a weird state, hence the invalid argument error. The various knobs have to be knobbed in a specific order.

If you get in the state, try rebooting the whole Pi (reboot, not reload).

If I remembered @Ranjib made some updates to correct the issues @Bigtrout was seeing with the
PCA9685 pwm, which fixed those issues. I suspect something broke for the native rpi pwm, I'm running 2.2 and it works fine and never rolled to 2.3 since everything was working fine. I think the thing to call out is if using the pca9685 you probably want to use 2.3 and if using native rpi pwm use 2.2.

I was almost going to suggest that this weekend but didn't really think it would make a difference.

:)
 

trackerit

Community Member
View Badges
Joined
Apr 11, 2019
Messages
71
Reaction score
137
Rating - 0%
0   0   0
If I remembered @Ranjib made some updates to correct the issues @Bigtrout was seeing with the
PCA9685 pwm, which fixed those issues. I suspect something broke for the native rpi pwm, I'm running 2.2 and it works fine and never rolled to 2.3 since everything was working fine. I think the thing to call out is if using the pca9685 you probably want to use 2.3 and if using native rpi pwm use 2.2.

I was almost going to suggest that this weekend but didn't really think it would make a difference.

:)
So, if I use a pca9685 board would I have 16 channels? and if I use the native I will only have 2?
 

b4tn

Valuable Member
View Badges
Joined
Jun 17, 2015
Messages
1,673
Reaction score
2,241
Location
Columbia MD
Rating - 0%
0   0   0
Just a doser reminder. Especially if you are using cheap Chinese peristaltic pumps. Set a timer to check calibration every so often. I have been dosing with reef-pi flawlessly for several months now. I did a random Alk test today and my levels where 9.6 from 8.4. I checked calibration on the pump and had to adjust it 10% slower to get back on track.
 
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
Have you thought as well as the pH sensor add to monitor salinity? using the module EC EZO

https://www.amazon.com/Atlas-Scient...KP7WS0TY24Y&psc=1&refRID=FHNE50G7VKP7WS0TY24Y
EZO pH sensor is supported already. I felt the EC/Salinity sensor is not so important, given ATO is in place. Though it was not planned, I am actually working on getting the DO sensor support, because some folks in University of Alabamae is using reef-pi to monitor some experiments, they need it and I would love to support them.
 

ludnix

Valuable Member
View Badges
Joined
Sep 27, 2015
Messages
1,282
Reaction score
1,643
Location
Fortuna, California
Rating - 0%
0   0   0
EZO pH sensor is supported already. I felt the EC/Salinity sensor is not so important, given ATO is in place. Though it was not planned, I am actually working on getting the DO sensor support, because some folks in University of Alabamae is using reef-pi to monitor some experiments, they need it and I would love to support them.
Oooh, maybe Reef-Pi will be listed in future journals under methodology! Thanks for making an effort to help the university!
 

trackerit

Community Member
View Badges
Joined
Apr 11, 2019
Messages
71
Reaction score
137
Rating - 0%
0   0   0
EZO pH sensor is supported already. I felt the EC/Salinity sensor is not so important, given ATO is in place. Though it was not planned, I am actually working on getting the DO sensor support, because some folks in University of Alabamae is using reef-pi to monitor some experiments, they need it and I would love to support them.
Great
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,344
Reaction score
1,720
Location
Missouri
Rating - 0%
0   0   0
EZO pH sensor is supported already. I felt the EC/Salinity sensor is not so important, given ATO is in place. Though it was not planned, I am actually working on getting the DO sensor support, because some folks in University of Alabamae is using reef-pi to monitor some experiments, they need it and I would love to support them.

UofA ughhhhh ;Yuck

;)
 

Bzar

Community Member
View Badges
Joined
Apr 11, 2019
Messages
32
Reaction score
66
Rating - 0%
0   0   0
So I took some time and figured out how to use regular float switches in a simple fashion using the built in pi resistors. This makes me happy because I don't have to have extra wiring and soldering tasks when adding a bunch of switches, and I don't have to pay for something I already bought. So to get regular float switches (or any switches for that matter) working safely you can do this...

Step A) create a python script to control the pull up resistance. From the terminal...

sudo nano switches.py

Code:
#switches.py
import RPi.GPIO as GPIO

GPIO.setmode(GPIO.BCM)

GPIO.setup(21, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(20, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(16, GPIO.IN, pull_up_down=GPIO.PUD_UP)

ctrl+X > Y > <enter>

Step B) make the file executable...

sudo chmod 755 switches.py

Step C) make the script run at startup by adding a line just before "exit" in rc.local (note: the python start command must point to the directory from root /...

sudo nano /etc/rc.local

Code:
sudo python /home/pi/switches.py &

ctrl+X > Y > <enter>

Step D) Restart or Reboot

sudo reboot

Step E) Plug your float switch wires into the GPIO. One wire to Pi header connected Ground, and one to the GPIO you used in switches.py

Step F) Check to see if your script is running...

ps -aef | grep python

Step G) Designate those pins in Reef-Pi to inlets/ATO for your application.

Hope this helps, working for me here.


After doing some wire management I was having trouble stabilizing the Float Switch signal after reconnecting. There was some bouncing going on with the switches it seemed that would keep the switches always on, so I've added a software time mechanism to clear that up. I've also changed to having a python script for each float switch to keep things clean and easy. So a script for ATOfloat1.py, ATOfloat2.py, ATOfloat3.py, etc. Then add the scripts to rc.local again to start on boot. The new scripts look like this...

Code:
#ATOfloat1.py

import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BCM)

GPIO.setup(21, GPIO.IN, pull_up_down=GPIO.PUD_UP)

while True:
    input_state = GPIO.input(21)
    if input_state == False:
        print ('ATOtank Fill')
        time.sleep(10)

In the code example there the float is connected to GPIO 21. Also there's a print command to see if it's working in the terminal. Hope this helps if anyone has issues where everything looks like it should be working, but the switches just wont turn off due to bouncing.
 
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
updates on the pico board ph test setup. There are three big observations:
- I am hitting some i2c issues, where the ADC ic is getting lost from i2c bus. persistently, after running several hours of monitoring at 1 min interval. I have manually verify this with i2cdetect -y 1
- Not sure why the millivolt reading is in negative, wrong byte read or something else..
- Also the trend is opposite. That time of the day , pH tend to go down.. I am not sure this is calibration will fix. We'll see. Can be bad probe . I am using american marine pin point probes ..bought from Amazon

Here is the four hour run for the sensor, before the i2c address was lost:
Screen Shot 2019-04-15 at 11.32.46 PM.png


Around the breakage point:
Screen Shot 2019-04-15 at 11.30.01 PM.png


I have rebooted pi and the i2c address for ADC reappeared., so sensor is sending data again. I'll see how it goes now. Meanwhile I'll start to put the ph board build in action some time this week. Stay tuned..

On the DO probe side, after reading through atlasscientific ezo circuit docs, I think reef-pi can read the DO probe as it is with ph driver code. So, if one does the do probe UART to I2c setup and calibration using the atlas scientific python code and then add the DO sensor as pH sensor in reef-pi, that should work. I'll see if I can get a sensor and ezo circuit , I have an extra voltage isolator and bnc probe (tentacle shield actually) ... but still its another 200-250$ :-O .
 
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
After doing some wire management I was having trouble stabilizing the Float Switch signal after reconnecting. There was some bouncing going on with the switches it seemed that would keep the switches always on, so I've added a software time mechanism to clear that up. I've also changed to having a python script for each float switch to keep things clean and easy. So a script for ATOfloat1.py, ATOfloat2.py, ATOfloat3.py, etc. Then add the scripts to rc.local again to start on boot. The new scripts look like this...

Code:
#ATOfloat1.py

import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BCM)

GPIO.setup(21, GPIO.IN, pull_up_down=GPIO.PUD_UP)

while True:
    input_state = GPIO.input(21)
    if input_state == False:
        print ('ATOtank Fill')
        time.sleep(10)

In the code example there the float is connected to GPIO 21. Also there's a print command to see if it's working in the terminal. Hope this helps if anyone has issues where everything looks like it should be working, but the switches just wont turn off due to bouncing.
I am curious if something like a schmitt trigger will work in this type of scenarios.
 

PaulJ2303

Community Member
View Badges
Joined
Sep 30, 2018
Messages
76
Reaction score
172
Rating - 0%
0   0   0
Hi,
I've just gone ahead and bought a raspberry-Pi 3b+ and installed Reef-pi on it.
it went really well :) i can now sit the pi across the room and connect to it via WiFi from my PC using putty and VNC on the same local network ... it's all good.
I can also access the reef-pi web UI from my PC whilst on the same local network ... it looks great :)

I only have one real issue right now if anyone could help ?
Although i can connect to reef pi's Web UI using my PC I cant seem to be able to connect to it using my phone ? .... (i am on the same local network (wifi) when i try all of this )

also on a similar vein how do i set up email alerts ?

thanks for any help you guys can be with this
 

PaulJ2303

Community Member
View Badges
Joined
Sep 30, 2018
Messages
76
Reaction score
172
Rating - 0%
0   0   0
Although i can connect to reef pi's Web UI using my PC I cant seem to be able to connect to it using my phone ? .... (i am on the same local network (wifi) when i try all of this )

It's ok I've answered my own question ... for some reason my phone didn't like Reef-pi having a host name ... it connected fine once i reverted back to using an IP address :)
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,826
Rating - 0%
0   0   0
It's ok I've answered my own question ... for some reason my phone didn't like Reef-pi having a host name ... it connected fine once i reverted back to using an IP address :)
With my previous and new android phones i can always connect thru the IP address. For some reason my androids dont like the .local after the name so if i type 75gallon.local it does not work. If i just type 75gallon it lets me connect.
 

GTM42

Active Member
View Badges
Joined
Dec 4, 2017
Messages
131
Reaction score
47
Rating - 0%
0   0   0
Wow what an awesome project, have you thought about selling them? Might be interested if the price is right to get one for my nano. I currently have an apex classic on my 150 gallon tank and would love to compare.
 

A worm with high fashion and practical utility: Have you ever kept feather dusters in your reef aquarium?

  • I currently have feather dusters in my tank.

    Votes: 73 37.8%
  • Not currently, but I have had feather dusters in my tank in the past.

    Votes: 66 34.2%
  • I have not had feather dusters, but I hope to in the future.

    Votes: 25 13.0%
  • I have no plans to have feather dusters in my tank.

    Votes: 28 14.5%
  • Other.

    Votes: 1 0.5%
Back
Top