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

GaryE

Well-Known Member
View Badges
Joined
Mar 12, 2020
Messages
992
Reaction score
1,321
Location
Coatesville, Indiana
Rating - 0%
0   0   0
Unsure why this is happening, but my heaters are not turning on on one of my tanks.

I get an error message in the logs:

Feb 4 06:25:14 nempi reef-pi[6535]: 2022/02/04 06:25:14 Current value of 'temp' is below minimum threshold. Executing up routine
Feb 4 06:25:14 nempi reef-pi[6535]: 2022/02/04 06:25:14 ERROR: Failed to execute temperature control logic. Error: Item 'nothing' does not exist in bucket 'equipment'

1643973968231.png



1643974207646.png



I would assume the error is complaining about the chiller having "Nothing" in it's control.. I do not have a chiller. (can we get a toggle to disable that in cases where the equipment does not exist?) So I thought setting a threshold it would never reach would satisfy the issue, nope.. So, when my tank gets below "Heater Threshold" it tries to turn on the heat, but can't because there is a "Nothing" setting on the chiller ?

My other tank is setup the same way, same version of reef-pi and it's happily turning on and off the heaters..
 

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,695
Reaction score
1,607
Rating - 0%
0   0   0
PSA:

If you are relying on a PCA9685 for your dosers, it might be wise to incorporate a couple safeties.

If your I2C wiring is susceptible to interference and other problems at all, the signal to start up a pump might be sent through fine, while the signal to stop it might be lost or corrupted. Resulting in the pump running non-stop until the next command is send to the PCA9685.

Had it happen 5 times so far in a couple years (that i know of). Twice it emptied my alk reservoir, once my calcium reservoir.

Steps to mitigate this:

1: Create a dummy doser in the reefpi ui that controls a pin on the PCA9685 where nothing is connected. Run that "doser" every minute for a second or so. I didn't go through the code so I don't know whether this works 100% of the time, but to me, running another doser for a second seems to help the previous lost command go through or resets the pwm or something.

2: I have my pumps connected to the PCA9685 and to power via L298N modules. Previously, i had the pins that control direction hardwired to 3.3V. What you can do instead, is connect than pin to a GPIO and only enable it in the timeframe dosing should happen. I have it set to only activate for a window of 30 seconds at each time dosing should happen. This solution relies on just a voltage or lack thereof and no complicated communications that could be subject to interference. I have the relevant direction pins of all pumps wired together to a single GPIO. Now if everything goes wrong and the first safety fails too, the motor driver is only powered for a couple seconds longer than it is programmed to run normally, instead of potentially minutes to hours until the next scheduled dose.

If the second method fails too, that means reef-pi is hung up entirely, not sure how to fix that without introducing more complexity that can fail, but this has never happened to me.
 
Last edited:
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Unsure why this is happening, but my heaters are not turning on on one of my tanks.

I get an error message in the logs:

Feb 4 06:25:14 nempi reef-pi[6535]: 2022/02/04 06:25:14 Current value of 'temp' is below minimum threshold. Executing up routine
Feb 4 06:25:14 nempi reef-pi[6535]: 2022/02/04 06:25:14 ERROR: Failed to execute temperature control logic. Error: Item 'nothing' does not exist in bucket 'equipment'

1643973968231.png



1643974207646.png



I would assume the error is complaining about the chiller having "Nothing" in it's control.. I do not have a chiller. (can we get a toggle to disable that in cases where the equipment does not exist?) So I thought setting a threshold it would never reach would satisfy the issue, nope.. So, when my tank gets below "Heater Threshold" it tries to turn on the heat, but can't because there is a "Nothing" setting on the chiller ?

My other tank is setup the same way, same version of reef-pi and it's happily turning on and off the heaters..
This is ui bug that by mistake sets the cooler equipment Id to nothing. Edit the temperature control and explicitly set the chiller equipment
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
PSA:

If you are relying on a PCA9685 for your dosers, it might be wise to incorporate a couple safeties.

If your I2C wiring is susceptible to interference and other problems at all, the signal to start up a pump might be sent through fine, while the signal to stop it might be lost or corrupted. Resulting in the pump running non-stop until the next command is send to the PCA9685.

Had it happen 5 times so far in a couple years (that i know of). Twice it emptied my alk reservoir, once my calcium reservoir.

Steps to mitigate this:

1: Create a dummy doser in the reefpi ui that controls a pin on the PCA9685 where nothing is connected. Run that "doser" every minute for a second or so. I didn't go through the code so I don't know whether this works 100% of the time, but to me, running another doser for a second seems to help the previous lost command go through or resets the pwm or something.

2: I have my pumps connected to the PCA9685 and to power via L298N modules. Previously, i had the pins that control direction hardwired to 3.3V. What you can do instead, is connect than pin to a GPIO and only enable it in the timeframe dosing should happen. I have it set to only activate for a window of 30 seconds at each time dosing should happen. This solution relies on just a voltage or lack thereof and no complicated communications that could be subject to interference. I have the relevant direction pins of all pumps wired together to a single GPIO. Now if everything goes wrong and the first safety fails too, the motor driver is only powered for a couple seconds longer than it is programmed to run normally, instead of potentially minutes to hours until the next scheduled dose.

If the second method fails too, that means reef-pi is hung up entirely, not sure how to fix that without introducing more complexity that can fail, but this has never happened to me.
I wonder if there’s a circuit /hardware based solution for this. I’ll think through what we can do on the software side.
over the years I realized I don’t need software control of speed for most dosing use cases. I just use a hardware based driver to change and set speed of the dosing pump (Dc) and let reef-pi just turn it on/off with a timer.
next version of reef-pi brings stepper integration, that may offer another approach to this
 

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
2,253
Reaction score
3,603
Location
Sacramento, CA area
Rating - 0%
0   0   0
Yeah it's not fun ordering parts these days. I order 50 or more at a time and look well before I'm out so luckily it's all worked out.

Here's some solder paste I highly recommend, I've gone throw a ton of it but the last year I've not needed it much, the great thing about it is the shelf life. I have a tube I use that's well over a year old and it's still comes out the original needle perfectly. If you order the small container on Mouser it'll turn to rock in less than a week. Keep this stuff in a zip lock in the fridge and you'll always have it. They have other listings of multiple tubes which is cheaper per tube.


If you get one of these the needles screw right on the solder tube and you can use a plunger to push it out. I use the black tips.


I use this to solder all my pca9685's, just did 4 tonight. I simply run a thin line across all the pads, then I place the pca9685 on the pad, nearly blind like yourself, make sure it's straight and hit it with the hot air. The part is floating and will straighten perfectly if close to begin with. Then I take my fine tipped soldering iron and do the drag soldering technique which removes all the bridges and leaves a perfect job. No flux required. Important to have a very clean solder tip when dragging. I drag one side, clean tip, drag again, then repeat on other side. Takes about 2 minutes per part.



I believe each 4 resistors in the array are 0603 but the array package is actually 1206. I don't think there's an 0603 4 pack array, at least not for general use.
I’ve used the paste on board technique but somehow forget to try it all the time.

For general SMD assembly I’ve hard switched to Loctite GC10 (T4 size) paste. I do keep it stored refrigerated (next to all the super glue in one of those mini drink fridges), but it has amazing working time. I can stencil a board and place components a day later without issue. The smaller T4 size solder beads is amazing for not messing up smaller pitched QFNs and the like.
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,409
Reaction score
1,726
Location
Missouri
Rating - 0%
0   0   0
PSA:

If you are relying on a PCA9685 for your dosers, it might be wise to incorporate a couple safeties.

If your I2C wiring is susceptible to interference and other problems at all, the signal to start up a pump might be sent through fine, while the signal to stop it might be lost or corrupted. Resulting in the pump running non-stop until the next command is send to the PCA9685.

Had it happen 5 times so far in a couple years (that i know of). Twice it emptied my alk reservoir, once my calcium reservoir.

Steps to mitigate this:

1: Create a dummy doser in the reefpi ui that controls a pin on the PCA9685 where nothing is connected. Run that "doser" every minute for a second or so. I didn't go through the code so I don't know whether this works 100% of the time, but to me, running another doser for a second seems to help the previous lost command go through or resets the pwm or something.

2: I have my pumps connected to the PCA9685 and to power via L298N modules. Previously, i had the pins that control direction hardwired to 3.3V. What you can do instead, is connect than pin to a GPIO and only enable it in the timeframe dosing should happen. I have it set to only activate for a window of 30 seconds at each time dosing should happen. This solution relies on just a voltage or lack thereof and no complicated communications that could be subject to interference. I have the relevant direction pins of all pumps wired together to a single GPIO. Now if everything goes wrong and the first safety fails too, the motor driver is only powered for a couple seconds longer than it is programmed to run normally, instead of potentially minutes to hours until the next scheduled dose.

If the second method fails too, that means reef-pi is hung up entirely, not sure how to fix that without introducing more complexity that can fail, but this has never happened to me.

I wonder if there’s a circuit /hardware based solution for this. I’ll think through what we can do on the software side.
over the years I realized I don’t need software control of speed for most dosing use cases. I just use a hardware based driver to change and set speed of the dosing pump (Dc) and let reef-pi just turn it on/off with a timer.
next version of reef-pi brings stepper integration, that may offer another approach to this

Yes I have had a similar experience using the pca9685 and having it stuck on, in my case it was after a power outage and either the 9685 is failed closed or a resistor etc. I happened to be by my tank when it happened and I was able to pull the plug so to speak and stopped using pca9685 and have gone to brs 1.1ml dosers on an outlet controlled by a timer, and I have timers to force shutoff incase of a power outage etc. I could still have a failed relay stuck closed but i feel the likelihood is much less than having something go wrong with the pca9685.

Ranjib can you elaborate more on the hardware driver for a doser/timer method. I understand what you are doing but what kind of drivers are you referring too? The BRS pumps work but they are kind of noisy and looking for a quieter alternative, for my nano tanks I do not need something fast just quiet and reliable, lol.
 

GaryE

Well-Known Member
View Badges
Joined
Mar 12, 2020
Messages
992
Reaction score
1,321
Location
Coatesville, Indiana
Rating - 0%
0   0   0
so far so good.. had to cut the power trace to the onboard ds18b20 and PCA9685 and solder in a wire to 3.3v.. (had it going to 5v)

The scope is connected to pin 2 on the PCA9685.. Seems working as planned. (power supply not connected, back powering the board from the pi, power supply tested good though.)

next up add the JST connectors and test the output on the mosfets for my light circuits and temp sensor inputs.

1643994552165.png
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,409
Reaction score
1,726
Location
Missouri
Rating - 0%
0   0   0
Yeah it's not fun ordering parts these days. I order 50 or more at a time and look well before I'm out so luckily it's all worked out.

Here's some solder paste I highly recommend, I've gone throw a ton of it but the last year I've not needed it much, the great thing about it is the shelf life. I have a tube I use that's well over a year old and it's still comes out the original needle perfectly. If you order the small container on Mouser it'll turn to rock in less than a week. Keep this stuff in a zip lock in the fridge and you'll always have it. They have other listings of multiple tubes which is cheaper per tube.


If you get one of these the needles screw right on the solder tube and you can use a plunger to push it out. I use the black tips.


I use this to solder all my pca9685's, just did 4 tonight. I simply run a thin line across all the pads, then I place the pca9685 on the pad, nearly blind like yourself, make sure it's straight and hit it with the hot air. The part is floating and will straighten perfectly if close to begin with. Then I take my fine tipped soldering iron and do the drag soldering technique which removes all the bridges and leaves a perfect job. No flux required. Important to have a very clean solder tip when dragging. I drag one side, clean tip, drag again, then repeat on other side. Takes about 2 minutes per part.



I believe each 4 resistors in the array are 0603 but the array package is actually 1206. I don't think there's an 0603 4 pack array, at least not for general use.

Here's a video showing how to do it. :)



I’ve used the paste on board technique but somehow forget to try it all the time.

For general SMD assembly I’ve hard switched to Loctite GC10 (T4 size) paste. I do keep it stored refrigerated (next to all the super glue in one of those mini drink fridges), but it has amazing working time. I can stencil a board and place components a day later without issue. The smaller T4 size solder beads is amazing for not messing up smaller pitched QFNs and the like.

Thanks guys for all of the input, really great advice. Will pick up some solder paste and see what I can do, still looking for uln2803a but guess I will have to wait on those, no big deal. The one thing that I am trying to figure out with the hot air station is how to figure out the right temp to use plus airflow, need to find some pcb's in my recycle bin and practice i guess, any suggestions?
 

GaryE

Well-Known Member
View Badges
Joined
Mar 12, 2020
Messages
992
Reaction score
1,321
Location
Coatesville, Indiana
Rating - 0%
0   0   0
Thanks guys for all of the input, really great advice. Will pick up some solder paste and see what I can do, still looking for uln2803a but guess I will have to wait on those, no big deal. The one thing that I am trying to figure out with the hot air station is how to figure out the right temp to use plus airflow, need to find some pcb's in my recycle bin and practice i guess, any suggestions?

I might have one or two of those ULN2803A's laying around here somewhere...
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,409
Reaction score
1,726
Location
Missouri
Rating - 0%
0   0   0
I might have one or two of those ULN2803A's laying around here somewhere...
Yeah funny part is I only need 2 of them, I have 2 spare boards that I was going to build up. My other option is I am getting some PCB's made and they seem to have them, not sure how I could order a few extra as an add on, lol.
 

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
2,253
Reaction score
3,603
Location
Sacramento, CA area
Rating - 0%
0   0   0
Thanks guys for all of the input, really great advice. Will pick up some solder paste and see what I can do, still looking for uln2803a but guess I will have to wait on those, no big deal. The one thing that I am trying to figure out with the hot air station is how to figure out the right temp to use plus airflow, need to find some pcb's in my recycle bin and practice i guess, any suggestions?

Temp: Somewhere above the solder melting point. I'm all lead free, so 350-380C works well. Lower this for leaded. And don't dwell using the cheap FR4 material, it can't take those temperatures for any long period of time.

Airflow: Enough to heat things, not enough to blow parts across the board. Often, whatever is 50% is a good starting point.
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,409
Reaction score
1,726
Location
Missouri
Rating - 0%
0   0   0
Temp: Somewhere above the solder melting point. I'm all lead free, so 350-380C works well. Lower this for leaded. And don't dwell using the cheap FR4 material, it can't take those temperatures for any long period of time.

Airflow: Enough to heat things, not enough to blow parts across the board. Often, whatever is 50% is a good starting point.
I am pretty noobish, what is FR4 material?
 

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
2,253
Reaction score
3,603
Location
Sacramento, CA area
Rating - 0%
0   0   0
PSA:

If you are relying on a PCA9685 for your dosers, it might be wise to incorporate a couple safeties.

If your I2C wiring is susceptible to interference and other problems at all, the signal to start up a pump might be sent through fine, while the signal to stop it might be lost or corrupted. Resulting in the pump running non-stop until the next command is send to the PCA9685.

Had it happen 5 times so far in a couple years (that i know of). Twice it emptied my alk reservoir, once my calcium reservoir.

Steps to mitigate this:

1: Create a dummy doser in the reefpi ui that controls a pin on the PCA9685 where nothing is connected. Run that "doser" every minute for a second or so. I didn't go through the code so I don't know whether this works 100% of the time, but to me, running another doser for a second seems to help the previous lost command go through or resets the pwm or something.

2: I have my pumps connected to the PCA9685 and to power via L298N modules. Previously, i had the pins that control direction hardwired to 3.3V. What you can do instead, is connect than pin to a GPIO and only enable it in the timeframe dosing should happen. I have it set to only activate for a window of 30 seconds at each time dosing should happen. This solution relies on just a voltage or lack thereof and no complicated communications that could be subject to interference. I have the relevant direction pins of all pumps wired together to a single GPIO. Now if everything goes wrong and the first safety fails too, the motor driver is only powered for a couple seconds longer than it is programmed to run normally, instead of potentially minutes to hours until the next scheduled dose.

If the second method fails too, that means reef-pi is hung up entirely, not sure how to fix that without introducing more complexity that can fail, but this has never happened to me.

Great discussion - this is actually why I made a timeout to stop running pumps after 5 seconds on my USB doser project:

Version number two is right up the line of thinking - try to use another signal or wire to an enable pin if it exists.

As for the total loss, there are a number of ideas that could work. The simple solution is often "just add firmware to an MCU", but thats complicating the Reef-Pi DIY scene quite a bit (now you're dealing with firmware and processors and such). Instead, you can maybe make a "dead man's switch" using some discrete logic (thinking a flip flop pair) and a 555 timer chip in one shot mode. The idea would be to require toggling a GPIO every N seconds in Reef-Pi, which then feeds the flip-flop and restarts the 555 timer. Once the 555 timer elapses since it didn't get reset, it can disconnect power to a section of your circuit either via a load switch/PFET or enable pins to various parts. You might not even need the flip-flop, its possible a 555 will do it just fine. You could do the same thing to the Raspberry Pi its self, with the caveat you probably want to wait _minutes_ between timer resets for the whole thing to boot.
 

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
2,253
Reaction score
3,603
Location
Sacramento, CA area
Rating - 0%
0   0   0
I am pretty noobish, what is FR4 material?

The fiberglass PCB substrate. The cheap Chinese (and US) manufacturers will give you a low temperature grade (Tg130), and let you upgrade to higher grades (Tg150, 170, etc). The Tg is roughly the sustained degrees C it will tolerate before, well, burning up.

Higher Tg is lower chance it will turn black and then stink up everything with the beautiful smell of burned epoxy (really, its an awful smell, please use some sort of fume extractor), which means its more forgiving to rework with hot air.

The cheap stuff survives going through a lead free reflow process "ok" (its pushing its limits) - it also means being careful holding hot air in one spot for too long (more than a minute it probably a bad idea).
 

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
2,253
Reaction score
3,603
Location
Sacramento, CA area
Rating - 0%
0   0   0
I wonder if there’s a circuit /hardware based solution for this. I’ll think through what we can do on the software side.
over the years I realized I don’t need software control of speed for most dosing use cases. I just use a hardware based driver to change and set speed of the dosing pump (Dc) and let reef-pi just turn it on/off with a timer.
next version of reef-pi brings stepper integration, that may offer another approach to this

IIRC, the Reef-Pi driver only sends the PCA9685 register updates when they change state? Perhaps a simple reliability improvement is to periodically just refresh the last known software state to the hardware.

I don't remember if the PCA9685 has glitching problems, but I think it just reloads the new PWM value when the current cycle is done, not immediately reset the count when reloaded.
 

TOP 10 Trending Threads

WHAT AMOUNT OF LIVE ROCK AND SAND SHOULD BE PRIORITIZED FOR OPTIMAL BIODIVERSITY/FILTRATION?

  • 100% live rock + bagged sand

    Votes: 38 27.3%
  • 100% dry rock + 100% live sand

    Votes: 47 33.8%
  • 50/50 live/dry rock, 50/50 live/bagged sand

    Votes: 30 21.6%
  • 75% live rock, 25% live sand

    Votes: 14 10.1%
  • 25% live rock, 75% live sand

    Votes: 10 7.2%
Back
Top