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

should work just fine. I'd recommend using uln2803 in between pi GPIO and relay input pins, to keep the current draw from GPIO at minimal.

28cgdqw.jpg
@Ranjib I used used an lm2596 to drop voltage from 12v to 5v.

1. If i connect 5v and ground from gpio together with power from lm2596 to the uln2803 the relays work fine

2. If i just connect 5v from gpio to the uln2803 and the ground from lm2596 to the relay board, the led light turns on but the relay doesnt trigger.

3. If i just follow the diagram exactly, nothing works.

BTW, i dont have a pi proto hat yet so i'm doing this all on a breadboard.
 
@Ranjib I used used an lm2596 to drop voltage from 12v to 5v.

1. If i connect 5v and ground from gpio together with power from lm2596 to the uln2803 the relays work fine

2. If i just connect 5v from gpio to the uln2803 and the ground from lm2596 to the relay board, the led light turns on but the relay doesnt trigger.

3. If i just follow the diagram exactly, nothing works.

BTW, i dont have a pi proto hat yet so i'm doing this all on a breadboard.

I think the grounds need to be linked like here

https://www.reef2reef.com/threads/r...troller-based-on-raspberry-pi.289256/page-241
 
This is exactly Correct and his issue with lights and no action was happening to me in my testing.. Also the power supply power for the relay board does not have to be shared with the uln .They all just need a Common ground.. Using db9 i used the red wire as ground to uln on my pi hat board and then ran ground from relay board to the power supply for relay..
 
The circuit is in heatshrink but if I remember correctly it's a just a 10k resistor splitting the ground wire.

Here's the main bit of the python script...

Code:
def my_callback(channel):
    if GPIO.input(8) == GPIO.HIGH:
        print('\n FLOAT at ' + str(datetime.datetime.now()))
        log = open("current_water_level.txt", "w")
        print (('OK | Last flipped at ' + str(datetime.datetime.now())), file = log)
    else:
        print('\n SINK at ' + str(datetime.datetime.now()))
        log = open("current_water_level.txt", "w")
        print (('Low | Last flipped at ' + str(datetime.datetime.now())), file = log)

GPIO.setmode(GPIO.BCM)
GPIO.setup(8, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.add_event_detect(8, GPIO.BOTH, callback=my_callback)

It's run every few minutes via cron and the status is broadcast via mqtt to my home assistant server which can send out alerts & trigger the top off. I'd prefer getting it into reef-pi so I can trigger the top off directly.
The python script seems to configure the IO with pull down instead of pull up. This makes it seem like the switch should be wired to 3v3 and GPIO.
 
Yes, wavemaker is definitely a thing for 3.0 . Theres an existing issue on providing finer grain pwm (say 12bit) control as well. I have already mentioned there that we want to incremenet/decrement interval customizable as well. Together this two will allow us to generate any arbitrary pwm profile. I think we'll introduce a wave profile similar to light profile.
Even in 2.0 reef-pi will provide a jack control api , i.e. users can write a script to directly control the PWM values and generate pretty much anything. at that level (connectors), reef-pi does not really know its light or pump, user can do whatever they want.
@ranjib can you provide some direction on where I can learn to write such a script and how to apply it with reef pi?
 
Hi,

I am new to the build , have thought looked and followed it for sometime. I am now starting my build and need a bit of help please.

How doe you restart the reef-pi?

Have run "sudo systemctl restart reef-pi.service"

But still getting

* reef-pi.service - raspberry pi based reef tank controller
Loaded: loaded (/lib/systemd/system/reef-pi.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Sun 2018-11-04 20:54:19 SAST; 11s ago
Process: 1509 ExecStart=/usr/bin/reef-pi -config /etc/reef-pi/config.yml (code=exited, status=1/FAILURE)
Main PID: 1509 (code=exited, status=1/FAILURE)
Nov 04 20:54:19 Tank systemd[1]: reef-pi.service: Unit entered failed state.
Nov 04 20:54:19 Tank systemd[1]: reef-pi.service: Failed with result 'exit-code'.


Running attest Noobs and reef-pi-2.0.0-beta-pi3.deb
 
Hi,

I am new to the build , have thought looked and followed it for sometime. I am now starting my build and need a bit of help please.

How doe you restart the reef-pi?

Have run "sudo systemctl restart reef-pi.service"

But still getting

* reef-pi.service - raspberry pi based reef tank controller
Loaded: loaded (/lib/systemd/system/reef-pi.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Sun 2018-11-04 20:54:19 SAST; 11s ago
Process: 1509 ExecStart=/usr/bin/reef-pi -config /etc/reef-pi/config.yml (code=exited, status=1/FAILURE)
Main PID: 1509 (code=exited, status=1/FAILURE)
Nov 04 20:54:19 Tank systemd[1]: reef-pi.service: Unit entered failed state.
Nov 04 20:54:19 Tank systemd[1]: reef-pi.service: Failed with result 'exit-code'.


Running attest Noobs and reef-pi-2.0.0-beta-pi3.deb
Welcome to reef2reef, you'll love it here :-) . We need bit more of the logs to understand why reef-pi is failing. Can you run:
Code:
journalctl -u reef-pi.service
 
Welcome to reef2reef, you'll love it here :) . We need bit more of the logs to understand why reef-pi is failing. Can you run:
Code:
journalctl -u reef-pi.service
Also share any details around the build you may have: like reef-pi version, pi version, circuit etc.
 
I don't see anything suspicious here. Things should work. Is is possible for you to check the log? Like, declare an inlet with GPIO 8 and associate it with an ATO, and set the check interval to 5 second (for example), and see what reef-pi says, when you put the float switch in and out of water
Code:
journalctl -fu reef-pi.service
It gives a float value of 1, regardless of the actual float position.
Code:
ReefControlPi reef-pi[25376]: 2018/11/04 14:27:07 ato sub-system:  sensor Float1 value: 1

(running 2.0.0-rc2)
 
It gives a float value of 1, regardless of the actual float position.
Code:
ReefControlPi reef-pi[25376]: 2018/11/04 14:27:07 ato sub-system:  sensor Float1 value: 1

(running 2.0.0-rc2)
This means reef-pi is reading it always on... I think its highly unlikely that we have a driver bug in reef-pi, and we are missing something else here, likely configuration related. Did you already shared your configuration screenshot? If not please do, connectors (inlet GPIO 8 ?? ) and ato details (check interval, control pump etc). I just tested ATO again with master (rc-2) release, and I could not find a bug. I am doing a whole lot of field testing now, and will hate to ship reef-pi with bugs like this (if it turns out) :-( . If your issue does not resolve, then I'll create a dedicated issue on this in github and I'll try to reproduce this with actual circuit. I have spare float switches, so no issue on getting this physically verified.
 
This means reef-pi is reading it always on... I think its highly unlikely that we have a driver bug in reef-pi, and we are missing something else here, likely configuration related. Did you already shared your configuration screenshot? If not please do, connectors (inlet GPIO 8 ?? ) and ato details (check interval, control pump etc). I just tested ATO again with master (rc-2) release, and I could not find a bug. I am doing a whole lot of field testing now, and will hate to ship reef-pi with bugs like this (if it turns out) :-( . If your issue does not resolve, then I'll create a dedicated issue on this in github and I'll try to reproduce this with actual circuit. I have spare float switches, so no issue on getting this physically verified.

I switched it to pin 7 to make sure there was no conflict with the python script. Also, I tried the inlet in "reverse" mode and then it reads as "0" in all positions instead of "1".

Config:
Screen Shot 2018-11-04 at 2.40.53 PM.png

ATO:
Screen Shot 2018-11-04 at 2.38.10 PM.png
 
This means reef-pi is reading it always on... I think its highly unlikely that we have a driver bug in reef-pi, and we are missing something else here, likely configuration related. Did you already shared your configuration screenshot? If not please do, connectors (inlet GPIO 8 ?? ) and ato details (check interval, control pump etc). I just tested ATO again with master (rc-2) release, and I could not find a bug. I am doing a whole lot of field testing now, and will hate to ship reef-pi with bugs like this (if it turns out) :-( . If your issue does not resolve, then I'll create a dedicated issue on this in github and I'll try to reproduce this with actual circuit. I have spare float switches, so no issue on getting this physically verified.

Have a pi - 3 B and configured pin18 for equipment, just switching a led on and off.

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

So it is up and running now

upload_2018-11-4_21-57-29.png


upload_2018-11-4_21-58-6.png
 
The python script seems to configure the IO with pull down instead of pull up. This makes it seem like the switch should be wired to 3v3 and GPIO.
But it should still not make any difference right?

Assuming its GPIO 8 (inlet), we can do low level verification like this:
Code:
cat /sys/class/gpio/gpio8/value
 
Have a pi - 3 B and configured pin18 for equipment, just switching a led on and off.

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

So it is up and running now

upload_2018-11-4_21-57-29.png


upload_2018-11-4_21-58-6.png
Can you upgrade to rc-2? There were bugs where if you have pca9685 enabled but not present in circuit, reef-pi will crash fatally
 

TOP 10 Trending Threads

ARE YOU READY TO CONFESS TO CRAZIEST, DUMBEST, FUNNIEST THING YOU’VE EVER DONE IN REEFING?

  • Yeah, I'll confess! (Share your story in the comments!)

    Votes: 27 54.0%
  • Nah, I'll keep mine a secret...(Don't be like that, share with the class!)

    Votes: 23 46.0%
Back
Top
Home
Post thread…
Market
What's new