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,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I ended up removing the pot from the equation. Direct connect from the reef pi to the pen input on the lights.

One of the lights didn't play nicely with the pots in the mix.
i bet its some missing passives.. somewhere in the circuit. im not good at hunting those down.. but i strongly feel thats what it.. passives to filter out noise, aberration (capacitors, resistor etc)
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Updated to 4.1 and its reporting correctly the usage but it doesn't reset to 0 once it runs, the reading stays at the last value. I thought it would read the value and then reset to 0 like its doing on the ATO graph, I'm obviously missing something.

:)

Screenshot at 2021-02-09 12-52-32.png


Here is the journalctl entries...
Code:
Feb 09 12:55:57 octopi reef-pi[17454]: 2021/02/09 12:55:57 ato-subsystem: sensor: ato-dt  usage: 10
Feb 09 12:56:02 octopi reef-pi[17454]: 2021/02/09 12:56:02 ato-subsystem: sensor: ato-dt state: 1
Feb 09 12:56:02 octopi reef-pi[17454]: 2021/02/09 12:56:02 ato-subsystem: sensor: ato-dt  usage: 10
Feb 09 12:56:05 octopi reef-pi[17454]: 2021/02/09 12:56:05 API Request:'   GET /api/atos/3/usage' from: 10.99.99.146:52618
Feb 09 12:56:07 octopi reef-pi[17454]: 2021/02/09 12:56:07 ato-subsystem: sensor: ato-dt state: 1
Feb 09 12:56:07 octopi reef-pi[17454]: 2021/02/09 12:56:07 ato-subsystem: sensor: ato-dt  usage: 10
Feb 09 12:56:12 octopi reef-pi[17454]: 2021/02/09 12:56:12 ato-subsystem: sensor: ato-dt state: 1
Feb 09 12:56:12 octopi reef-pi[17454]: 2021/02/09 12:56:12 ato-subsystem: sensor: ato-dt  usage: 10
Feb 09 12:56:15 octopi reef-pi[17454]: 2021/02/09 12:56:15 API Request:'   GET /api/atos/3/usage' from: 10.99.99.146:52632
Feb 09 12:56:17 octopi reef-pi[17454]: 2021/02/09 12:56:17 ato-subsystem: sensor: ato-dt state: 1
Feb 09 12:56:17 octopi reef-pi[17454]: 2021/02/09 12:56:17 ato-subsystem: sensor: ato-dt  usage: 10
Feb 09 12:56:22 octopi reef-pi[17454]: 2021/02/09 12:56:22 ato-subsystem: sensor: ato-dt state: 1

Looks like at the top of the hour it reset to 0, scratching my head now since I am not sure how this is supposed to work.
i changed the metrics emission code during 4.0 https://github.com/reef-pi/reef-pi/pull/1121 , so this is expected in all 4.0 installations,
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
i changed the metrics emission code during 4.0 https://github.com/reef-pi/reef-pi/pull/1121 , so this is expected in all 4.0 installations,
Just to explain furthers, this is as expected. there was a bug in 3.x , which is why you saw the change in 4.0 upgrade. The current graph is correct, as in it "charts hourly usage, aka pump run time", this metric is useful as the exact time you can see when the pump started (increments should reflect your check interval in seconds) and it will reset to 0 every hour. In long term (2-7 days) this should show the hourly pattern and its variation in seasons and help you set the alert threshold (which is in pump usage / hour).
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I shut the controller down, wiggled some wires, and then rebooted. I an certain I didn't do anything, but now every relay works. I suspect something is going on that I don't understand. I am lost here and don't know what to do to get my relays working reliably....help. For now I will add my equipment again and test.
Just to reiterate, there was no errors in reef-pi log?
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
anything I can do to help? I have parts and can test code, Just dont know how to write code.
i mean, we have to do some design & coding work, and follow up testing/validation. The design work will involve at least settling on a common stepper driver (e.g. 8825??) for the standard build, the coding work i.e. HAL integration and any UI(driver??) work, and finally testing it out.
 

brian.badge

Active Member
View Badges
Joined
Apr 19, 2019
Messages
143
Reaction score
79
Rating - 0%
0   0   0
Correct no errors.
And I have a different relay stuck on. I came downstairs to find my sump lights on despite being turned off in the UI. When I manually turned it on then back off nothing happened. I have moved my sump light over to a mechanical timer just in case its causing the issue. Its a zet light LED and its plug converts ac to 24 v DC. I will restart and hope the relay starts working again.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
And I have a different relay stuck on. I came downstairs to find my sump lights on despite being turned off in the UI. When I manually turned it on then back off nothing happened.
You probed the GPIO output at every junction till it connects to the relay input, and validated the voltages are as expect (if i recall correctly, it should be around 3.3v at GPIO on). This should help you isolate the problem at circuit vs relay itself.
 

brian.badge

Active Member
View Badges
Joined
Apr 19, 2019
Messages
143
Reaction score
79
Rating - 0%
0   0   0
And I have a different relay stuck on. I came downstairs to find my sump lights on despite being turned off in the UI. When I manually turned it on then back off nothing happened. I have moved my sump light over to a mechanical timer just in case its causing the issue. Its a zet light LED and its plug converts ac to 24 v DC. I will restart and hope the relay starts working again.
I think I know what is happening. Power off the reboot did nothing. Power off, tap the relay with a screw driver and reboot and it functions correctly. That suggests they are sticking due to arcing right? If that is the case what do I do?
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
Just to explain furthers, this is as expected. there was a bug in 3.x , which is why you saw the change in 4.0 upgrade. The current graph is correct, as in it "charts hourly usage, aka pump run time", this metric is useful as the exact time you can see when the pump started (increments should reflect your check interval in seconds) and it will reset to 0 every hour. In long term (2-7 days) this should show the hourly pattern and its variation in seasons and help you set the alert threshold (which is in pump usage / hour).
Thanks @Ranjib for the quick reply that is exactly what I am seeing, I knew it had to be coded since it reset on the hour. I will update my other reefpi installation to the latest, the upgrade so far was painless and everything appears to be working fine. My goal is to replicate all the graphs with grafana and just use it to monitor vs the dashboard, that way I will free up resources on the pi.

One more question, I am using a dosing module but do not see anything on prometheus to allow to monitor the dosing module, is that correct or did I miss it?

Thanks :)
 

GaryE

Well-Known Member
View Badges
Joined
Mar 12, 2020
Messages
992
Reaction score
1,385
Location
Coatesville, Indiana
Rating - 0%
0   0   0
i bet its some missing passives.. somewhere in the circuit. im not good at hunting those down.. but i strongly feel thats what it.. passives to filter out noise, aberration (capacitors, resistor etc)


Nope. After I removed the pots, I noticed the blue channel on that light wasn't dimming. Tested everything and came down to something in the driver. Had power, ground and pwm signal all the way to the driver.

Traced the pwm pin from the jst on the driver board to something that looked suspiciously like a smoked AO3400 mosfet. Just so happened to have a spare on my desk.

May not be that exact mosfet, but good enough. It's working correctly now.

Well, more like the d@mned thing is off like it should be for this time of night. We'll see tomorrow.. ;-)
 

babrooks

New Member
View Badges
Joined
Feb 28, 2020
Messages
22
Reaction score
43
Rating - 0%
0   0   0
Ive been away for awhile. Wondering if @Ranjib ever got it where steppers could be used for dosing? want to build a doser, but want the precision that a stepper would deliever.
It is possible to rig up an Arduino board to read the doser signal from reef-pi and then run stepper motor drivers. This is what I did on my tank for dosing and AWC with DIY peristaltic pumps. You can read about it on my build thread.
 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
985
Reaction score
1,325
Location
Edmonton, Canada
Rating - 0%
0   0   0
I ended up removing the pot from the equation. Direct connect from the reef pi to the pen input on the lights.

One of the lights didn't play nicely with the pots in the mix.
Thanks for letting me know. I assume you just unplugged JST from dimmer and can wire to it? Just lost that nice carrier board? Seemed too good to be true. :)
 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
985
Reaction score
1,325
Location
Edmonton, Canada
Rating - 0%
0   0   0
It is possible to rig up an Arduino board to read the doser signal from reef-pi and then run stepper motor drivers. This is what I did on my tank for dosing and AWC with DIY peristaltic pumps. You can read about it on my build thread.
Yeah you can do that, plug the doser signal into an analog pin on Arduino and have code monitor it for action.
 

babrooks

New Member
View Badges
Joined
Feb 28, 2020
Messages
22
Reaction score
43
Rating - 0%
0   0   0
Yeah you can do that, plug the doser signal into an analog pin on Arduino and have code monitor it for action.
How would it work with an analog pin? I have the Arduino reading the duty cycle of the PWM signal from the reef pi with a digital pin. Every second or so, it measures the length of the duty cycle by averaging a large number of samples from pulseIn(), to filter out noise. A bit elaborate, though it's been pretty reliable. Would be nice to have a simpler solution, though!
 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
985
Reaction score
1,325
Location
Edmonton, Canada
Rating - 0%
0   0   0
How would it work with an analog pin? I have the Arduino reading the duty cycle of the PWM signal from the reef pi with a digital pin. Every second or so, it measures the length of the duty cycle by averaging a large number of samples from pulseIn(), to filter out noise. A bit elaborate, though it's been pretty reliable. Would be nice to have a simpler solution, though!
I'm assuming you have the Arduino able to run the dosing pumps so all you need to know is when to start/stop the pump. If you connect PWM signal to an analog pin you can read the voltage from the PWM pin and use that to trigger things. When the PWM is off you'll have 0v and on you'll have 3.3v-5v depending on your setup. If you map out the voltage in Arduino code you can use the speed control feature in reef-pi for whatever but this is all you need to for start/stop. If you have the timing setup in Arduino code just add a flag to the start dosing pump section so it only runs once until you reset flag in Arduino.

C++:
int analogPin = A0;
int analogValue = 0;

void setup() {
}

void loop() {
  analogValue = analogRead(analogPin);

  if (analogValue > 100) {
    // start dosing pump
  }
  else {
    // stop dosing pump 
  } 
}
 

GaryE

Well-Known Member
View Badges
Joined
Mar 12, 2020
Messages
992
Reaction score
1,385
Location
Coatesville, Indiana
Rating - 0%
0   0   0
Thanks for letting me know. I assume you just unplugged JST from dimmer and can wire to it? Just lost that nice carrier board? Seemed too good to be true. :)

I did.. but I just butted the jst connectors on my wires together and used some pins I had laying around (ends from large axial resistors) to connect them together. The real question I have is what caused the mosfet to blow in the driver..
 

brian.badge

Active Member
View Badges
Joined
Apr 19, 2019
Messages
143
Reaction score
79
Rating - 0%
0   0   0
You probed the GPIO output at every junction till it connects to the relay input, and validated the voltages are as expect (if i recall correctly, it should be around 3.3v at GPIO on). This should help you isolate the problem at circuit vs relay itself.
No but I certainly can.
 

GaryE

Well-Known Member
View Badges
Joined
Mar 12, 2020
Messages
992
Reaction score
1,385
Location
Coatesville, Indiana
Rating - 0%
0   0   0
I did.. but I just butted the jst connectors on my wires together and used some pins I had laying around (ends from large axial resistors) to connect them together. The real question I have is what caused the mosfet to blow in the driver..


and I think the mosfet blew again.. or something equally stupid. The wife just texted me and that light has no blues on right now. I'd like to swap out the driver with a meanwell, but I have yet go find one that matches the specs closely enough to make me feel good about doing it.
 

HAVE YOU EVER KEPT A RARE/UNCOMMON FISH, CORAL, OR INVERT? SHOW IT OFF IN THE THREAD!

  • Yes!

    Votes: 32 45.7%
  • Not yet, but I have one that I want to buy in mind!

    Votes: 9 12.9%
  • No.

    Votes: 26 37.1%
  • Other (please explain).

    Votes: 3 4.3%
Back
Top