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

Urtoo

Well-Known Member
View Badges
Joined
Jul 1, 2019
Messages
688
Reaction score
924
Rating - 0%
0   0   0
When you say direct, do you mean that we do not need their native software app? Ordered the 300 just a moment ago.
 
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
When you say direct, do you mean that we do not need their native software app? Ordered the 300 just a moment ago.
Yes. They use auto key encryption, which I learned from the Nodejs based Kasa library. reef-pi is using exact same scheme to control these smart outlets. Your kasa app will work as it is. It’s just another thing that will control these devices. This also means you now have two places to control those outlets.
 

AbjectMaelstroM

Valuable Member
View Badges
Joined
Jul 21, 2019
Messages
1,526
Reaction score
1,810
Location
RVA
Rating - 100%
1   0   0
Yes. They use auto key encryption, which I learned from the Nodejs based Kasa library. reef-pi is using exact same scheme to control these smart outlets. Your kasa app will work as it is. It’s just another thing that will control these devices. This also means you now have two places to control those outlets.

Saves me building another power controller. Can't wait!
 

Ernie E

New Member
View Badges
Joined
Aug 15, 2019
Messages
19
Reaction score
18
Rating - 0%
0   0   0
Hey guys,

Does the ATO Disable on Alert not work for anyone else?

I have it set to disable if it's on for more than 5 seconds but that never occurs. Just stays on. I'm dry testing this all right now with a mechanical float switch and while it does switch on and off as the levels change in the tank, the "safety" never kicks in.

Also, this is on reef-pi 2.5

1571185452516.png
 

Michael Lane

Well-Known Member
View Badges
Joined
Aug 11, 2018
Messages
677
Reaction score
1,123
Rating - 0%
0   0   0
It looks like the ATO code disables the ATO system, but does not seem to turn off the ATO equipment. I'm reviewing 3.0 code, but it seems like a bug to me.
 
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
Hey guys,

Does the ATO Disable on Alert not work for anyone else?

I have it set to disable if it's on for more than 5 seconds but that never occurs. Just stays on. I'm dry testing this all right now with a mechanical float switch and while it does switch on and off as the levels change in the tank, the "safety" never kicks in.

Also, this is on reef-pi 2.5

1571185452516.png
This is a bug :-( https://github.com/reef-pi/reef-pi/issues/829 , it only works at hourly or greater threshold. I was planning to fix it as part of 3.0 release. Unless you need this urgently.
 

Ernie E

New Member
View Badges
Joined
Aug 15, 2019
Messages
19
Reaction score
18
Rating - 0%
0   0   0
This is a bug :-( https://github.com/reef-pi/reef-pi/issues/829 , it only works at hourly or greater threshold. I was planning to fix it as part of 3.0 release. Unless you need this urgently.

Would you recommend running two float switches? A higher failsafe switch that cuts off the circuit from the 1st float to reef-pi to add a safety net? My ATO pump is a bit... Oversized and will fill the tank within seconds so I'm trying to figure out the best way to prevent a catastrophe :)

Also I noticed that the check frequency on the ATO by default is 60 seconds. This means reef-pi checks the input pin every 60 seconds and the pump will run (for a minimum) for 60 seconds. Would it be possible to have reef-pi check the input status almost real-time once the ATO is signaled ON to prevent overages from oversized ATO pumps like mine? Lol.

I set it to 1 second for the reason above, don't know if that negatively affects anything. I didn't notice any increased CPU usage on the 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
Would you recommend running two float switches? A higher failsafe switch that cuts off the circuit from the 1st float to reef-pi to add a safety net? My ATO pump is a bit... Oversized and will fill the tank within seconds so I'm trying to figure out the best way to prevent a catastrophe :)

Also I noticed that the check frequency on the ATO by default is 60 seconds. This means reef-pi checks the input pin every 60 seconds and the pump will run (for a minimum) for 60 seconds. Would it be possible to have reef-pi check the input status almost real-time once the ATO is signaled ON to prevent overages from oversized ATO pumps like mine? Lol.

I set it to 1 second for the reason above, don't know if that negatively affects anything. I didn't notice any increased CPU usage on the pi.
I think you can get away by running it at 3-5 second interval. I have never ran it at 1 second interval, but i dont think anything will break. Real time is not possible currently, we have to implement a different type of driver and I dont think the effort is worth the benefit right now.
I'll work on fixing the bug though... that needs to be fixed asap.
 

Ernie E

New Member
View Badges
Joined
Aug 15, 2019
Messages
19
Reaction score
18
Rating - 0%
0   0   0
I think you can get away by running it at 3-5 second interval. I have never ran it at 1 second interval, but i dont think anything will break. Real time is not possible currently, we have to implement a different type of driver and I dont think the effort is worth the benefit right now.
I'll work on fixing the bug though... that needs to be fixed asap.

Thank you! I'm testing at 2 and 3 seconds today with the pump connected to see how she does.

One more question on the functionality of "disable on alert". Would this disable the ATO/equipment until the user resets it or would it disable it only for the check period set (60 seconds for example).

Maybe I should learn GO! Wonder how difficult it would be coming from a Python background.
 

Spathodus

New Member
View Badges
Joined
Oct 16, 2019
Messages
9
Reaction score
10
Rating - 0%
0   0   0
Hello Ranjib.

First, thank you for creating such a useful application for all of us. I've been following this project for a while and just completed my lighting build. I DIY'd this as well, with 4 Meanwell LDD-1000L, running 4 channels to twenty-two 3w LEDS. the 4 channels are connected to a PCA 9685. I'm using a Raspberry pi zeroW.

My issue at the moment is that the LED's will flash brightly when they are shut off through the web UI. I believe this is a similar issue to losing the PWM signal from the raspberry pi/PCA 9685 resulting in the LED's just running at 100%, but I'm not sure. Do you think adding an adequately sized capacitor in parallel with each channel would abate this flashing issue?

Thank you very much!
 
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, thank you for creating such a useful application for all of us. I've been following this project for a while and just completed my lighting build. I DIY'd this as well, with 4 Meanwell LDD-1000L, running 4 channels to twenty-two 3w LEDS. the 4 channels are connected to a PCA 9685. I'm using a Raspberry pi zeroW.

My issue at the moment is that the LED's will flash brightly when they are shut off through the web UI. I believe this is a similar issue to losing the PWM signal from the raspberry pi/PCA 9685 resulting in the LED's just running at 100%, but I'm not sure. Do you think adding an adequately sized capacitor in parallel with each channel would abate this flashing issue?

Thank you very much!
Thank you so much for the kind words. It means everything to me and rest of the folks who makes this project possible.

I think this is a bug in the pca9695 driver where we are not sending special instruction for 0 duty_cycle. https://github.com/reef-pi/reef-pi/issues/794
I plan to fix it as part of 3.0 release. If possible use a timer to cut off the power during off cycle.
 

Schreiber

Leviathan
View Badges
Joined
Jun 28, 2016
Messages
468
Reaction score
593
Location
Knoxville
Rating - 0%
0   0   0
On the topic of PCA9685... I can use the PWM output from the PCA for the L293d Enable, correct? That would free up a couple of GPIO pins for me if that's the case.


How do I set these jacks up in my configuration? I'm wanting to use outputs 12 & 13 from the PCA9685 as my PWM outputs for EN 1,2 & EN 3,4 on the L293D. In the Adafruit guide, pins 0 & 1 are being used with the RPi as the driver. I know I have to switch my driver to PCA9685, but are the pins I need to use 12 & 13? Or is the numbering scheme different here as well (like on the Pi, GPIO 18 is "pin 0"? I remember having a lot of trouble with the jacks when I was using the wrong pin in my previous build & I'm wanting to avoid that headache again!
 

sfgabe

Active Member
View Badges
Joined
Sep 7, 2018
Messages
166
Reaction score
264
Rating - 0%
0   0   0
How do I set these jacks up in my configuration? I'm wanting to use outputs 12 & 13 from the PCA9685 as my PWM outputs for EN 1,2 & EN 3,4 on the L293D. In the Adafruit guide, pins 0 & 1 are being used with the RPi as the driver. I know I have to switch my driver to PCA9685, but are the pins I need to use 12 & 13? Or is the numbering scheme different here as well (like on the Pi, GPIO 18 is "pin 0"? I remember having a lot of trouble with the jacks when I was using the wrong pin in my previous build & I'm wanting to avoid that headache again!
I use an L293D (H-bridge board) for exactly this to power my doser pump motors. The pins are entered into reef-pi as 0,1,2,3,4, etc just like the rpi driver, but there's more of them. You'll need 6 pins, ENA, 1, & 2, and ENB, 3, & 4 - which for me are 0,1,2,3,4,& 5 on the PCA9685. If you're powering something like a motor, EN will be the "power" switch and then you'll either end up with 1 dummy pin that's always set to "off" or be able to switch between forward and reverse by turning one high and one low and vice versa.
 

Schreiber

Leviathan
View Badges
Joined
Jun 28, 2016
Messages
468
Reaction score
593
Location
Knoxville
Rating - 0%
0   0   0
I use an L293D (H-bridge board) for exactly this to power my doser pump motors. The pins are entered into reef-pi as 0,1,2,3,4, etc just like the rpi driver, but there's more of them. You'll need 6 pins, ENA, 1, & 2, and ENB, 3, & 4 - which for me are 0,1,2,3,4,& 5 on the PCA9685. If you're powering something like a motor, EN will be the "power" switch and then you'll either end up with 1 dummy pin that's always set to "off" or be able to switch between forward and reverse by turning one high and one low and vice versa.

Interesting. I had been under the impression you had to use the GPIO pins for the Inputs on the L293D, because the PCA9685 was set to a much higher frequency.

So, if the PCA9685 outputs can be used in this way, what's keeping us from using them to control relay outputs as well?
 

Spathodus

New Member
View Badges
Joined
Oct 16, 2019
Messages
9
Reaction score
10
Rating - 0%
0   0   0
Thank you so much for the kind words. It means everything to me and rest of the folks who makes this project possible.

I think this is a bug in the pca9695 driver where we are not sending special instruction for 0 duty_cycle. https://github.com/reef-pi/reef-pi/issues/794
I plan to fix it as part of 3.0 release. If possible use a timer to cut off the power during off cycle.

Thank you for your quick response. I might route the incoming driver power through a timed relay then.
 

sfgabe

Active Member
View Badges
Joined
Sep 7, 2018
Messages
166
Reaction score
264
Rating - 0%
0   0   0
Interesting. I had been under the impression you had to use the GPIO pins for the Inputs on the L293D, because the PCA9685 was set to a much higher frequency.

So, if the PCA9685 outputs can be used in this way, what's keeping us from using them to control relay outputs as well?
As far as I understand, the PCA9685 is specifically for things that require a PWM signal (different from frequency), so basically leds and servos only.
 
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
How do I set these jacks up in my configuration? I'm wanting to use outputs 12 & 13 from the PCA9685 as my PWM outputs for EN 1,2 & EN 3,4 on the L293D. In the Adafruit guide, pins 0 & 1 are being used with the RPi as the driver. I know I have to switch my driver to PCA9685, but are the pins I need to use 12 & 13? Or is the numbering scheme different here as well (like on the Pi, GPIO 18 is "pin 0"? I remember having a lot of trouble with the jacks when I was using the wrong pin in my previous build & I'm wanting to avoid that headache again!
You need only two pwm pins, en1 and en2. IN1/2/3/4 all can be connected to pi GPIO if you want to contol the moto diection. For LEDs it does not make sense. You can just hook them up to 3.3V rail and GND,
 

sfgabe

Active Member
View Badges
Joined
Sep 7, 2018
Messages
166
Reaction score
264
Rating - 0%
0   0   0
You need only two pwm pins, en1 and en2. IN1/2/3/4 all can be connected to pi GPIO if you want to contol the moto diection. For LEDs it does not make sense. You can just hook them up to 3.3V rail and GND,
If you want dimming ability on LEDs it sometimes makes sense to use a PWM signal.
 
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
As far as I understand, the PCA9685 is specifically for things that require a PWM signal (different from frequency), so basically leds and servos only.
with 3.0 , we will be able to use pwm outputs as notmal digital output. In that case its basically 100% duty cyle or 0% duty cycle. So L293D could be entirely driven by pca9685 IC, or even relay contol. I have not tested this, theres a pca9685 driver bug that also i need to fix before i start field testing
 

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: 64 36.8%
  • Not currently, but I have had feather dusters in my tank in the past.

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

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

    Votes: 26 14.9%
  • Other.

    Votes: 0 0.0%
Back
Top