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
Thanksgiving is on the way, and that means a major release of reef-pi.
I had a few remaining wish list , other than what has already been shipped part of 4.1/4.2/4.3,
- Reset ATO usage
- Light graph
- Ability to control light enable/disable from macro
- ph control chart (similar to temperature)
I dont expect any breaking changes, i.e. 4.0 users should be able to upgrade without any hiccups. I am expecting most of these to be done within next two weeks, after which we'll have release candidate, or direct general availability release if we feel confident on the build/test.

Let me know if you folks have any thoughts, particularly any major bugs that we should be focusing on instead.
 

crapshoot

New Member
View Badges
Joined
Nov 6, 2021
Messages
5
Reaction score
23
Location
Pennsylvania
Rating - 0%
0   0   0
I just picked up a couple of Chinese Black Box LED fixtures for cheap.. They came with two of these LED Drivers in them, so it got me thinking.. How can I connect these to the reef-pi to control them....


I'm thinking I should be able to connect the PWM wire to an open pin on the pca9685 and control it that way....

If so, this opens up a nice lighting option..

1612135470368.png



Amazon product

New to the forum and signed up because I have these exact same lights on a tank I'm building and wanted to gain some insight on the easiest way to dim these with the reef-pi I'm putting together.

I'll also be hacking away on my reef-pi and figured this would be as good as a place as github to pick at peoples brains. I've been mulling over my approach to automating my tank going back and forth between using reef-pi or some of my own controllers since I work in the automation field for a living.
 

Dave's Reef

Active Member
View Badges
Joined
Nov 4, 2018
Messages
102
Reaction score
150
Rating - 0%
0   0   0
I finally got around to add a low sump level incase ATO fails and I set up notifications and have it set to run a dummy outlet I'm not using the outlet triggers as it should on and off but the notifications never stop? Has anyone else had this trouble and how did you fix it? Thanks in advance..
 
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 finally got around to add a low sump level incase ATO fails and I set up notifications and have it set to run a dummy outlet I'm not using the outlet triggers as it should on and off but the notifications never stop? Has anyone else had this trouble and how did you fix it? Thanks in advance..
theres a setting under telemetry configuration on the maximum alerts of an individual type in an hour. Set it to 3 or something you like..
 

Dave's Reef

Active Member
View Badges
Joined
Nov 4, 2018
Messages
102
Reaction score
150
Rating - 0%
0   0   0
BUT will I still keep getting 3 alerts every hour? I think this may be a bounce issue after watching it all day I noticed sometimes it would turn the outlet on even when it does change state. I should have stated before I am using a float switch with only two wire one to ground and a resistor to the GPIO pin. Does reef-pi have debounce written in the program?
theres a setting under telemetry configuration on the maximum alerts of an individual type in an hour. Set it to 3 or something you like..
 

crapshoot

New Member
View Badges
Joined
Nov 6, 2021
Messages
5
Reaction score
23
Location
Pennsylvania
Rating - 0%
0   0   0
I got my reef-pi up and running today. it took some digging to find out what the available gpio were and I was going to start digging through the code this week to make some customizations.

I used an old UPS for an enclosure because for the past month I keep forgetting to order a hobby box and there's nobody local that I can pick one up from. Everything I used is scavenged from parts I've had laying around other than I had to order a temp sensor. I have dozens of 10k thermistors laying around that I was going to use but I have no ADC's and I don't want to bother ordering one just for temp, so I bought the 5 pack of DS18B20 and a PCA9685 so I can dim my LED's and I may eventually connect my pumps to it for a custom wavemaker.

No, I probably didn't need 12 receptacles, but I had them so why not. I also plumbed a 1/4" poly line from my RO/DI in my well room right into my sump and have it controlled with a 1/2" valve on the supply line to the filter for my ATO. I thought about doing a build thread, but I forgot to take pics while I was putting everything together. I got the tank for $100 on craigslist which was a piece of junk. Built the stand, canopy, painted the back of the tank, drilled the bottom for the overflow bulkheads, picked up acrylic and built my own overflows, built my own sump out of a pestco aqueon 40 gallon breeder with acrylic pieces I cut and siliconed myself. I've had the tank up and running for about a week now, but still need to pick up some odds and ends. I still have time since it needs to cycle.
 

Attachments

  • 20211106_182425.jpg
    20211106_182425.jpg
    74.3 KB · Views: 71
  • 20211106_190112.jpg
    20211106_190112.jpg
    65.2 KB · Views: 69
  • 20211106_193542.jpg
    20211106_193542.jpg
    52.9 KB · Views: 69
  • 20211106_201121.jpg
    20211106_201121.jpg
    39.4 KB · Views: 74

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
985
Reaction score
1,325
Location
Edmonton, Canada
Rating - 0%
0   0   0
Thanksgiving is on the way, and that means a major release of reef-pi.
I had a few remaining wish list , other than what has already been shipped part of 4.1/4.2/4.3,
- Reset ATO usage
- Light graph
- Ability to control light enable/disable from macro
- ph control chart (similar to temperature)
I dont expect any breaking changes, i.e. 4.0 users should be able to upgrade without any hiccups. I am expecting most of these to be done within next two weeks, after which we'll have release candidate, or direct general availability release if we feel confident on the build/test.

Let me know if you folks have any thoughts, particularly any major bugs that we should be focusing on instead.
This sounds great, on behalf of many thanks for your hard work.

This isn't a bug but yesterday I got a sad email where someone's dosing pump didn't turn off, thankfully no harm was done. He restarted things which immediately turned off the pump. The control for the pump was coming from the pca9685, my guess is reef-pi sent out the command to turn off the pump but that command didn't make it to the pca9685 in tact. Unfortunately this is the problem with I2C, it'll never be 100% perfect as it has no acknowledge system.

I didn't think it was possible to read the current value of a specific pca9685 pin as I've looked into this in the past however after hearing this I thought I would try again. I stumbled across a new c++ Arduino based library from Rob Tillaart last updated early this year. Again it looks like he did what few could and added a function to read the set value of a pin. I've tested it out and it works perfectly. You're able to set the value normally then immediately check and verify if it in fact changed.

So now I'm wondering if you're able to incorporate a verification on mainly the dosing pumps as they are critical. When reef-pi turns on/off the pump it could check the pin to verify it's set proper and move on, if not try again.

The function is call getPWM and is located in the PCA9685.cpp file here.



Unfortunately I'm still not comfortable poking in the code yet, would be great if you could start adding comments, that's my feature request. :)

If it helps any I can convert this function to work with pure c++ and drop the Arduino based libraries.
 

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,591
Reaction score
1,590
Rating - 0%
0   0   0
This sounds great, on behalf of many thanks for your hard work.

This isn't a bug but yesterday I got a sad email where someone's dosing pump didn't turn off, thankfully no harm was done. He restarted things which immediately turned off the pump. The control for the pump was coming from the pca9685, my guess is reef-pi sent out the command to turn off the pump but that command didn't make it to the pca9685 in tact. Unfortunately this is the problem with I2C, it'll never be 100% perfect as it has no acknowledge system.

I didn't think it was possible to read the current value of a specific pca9685 pin as I've looked into this in the past however after hearing this I thought I would try again. I stumbled across a new c++ Arduino based library from Rob Tillaart last updated early this year. Again it looks like he did what few could and added a function to read the set value of a pin. I've tested it out and it works perfectly. You're able to set the value normally then immediately check and verify if it in fact changed.

So now I'm wondering if you're able to incorporate a verification on mainly the dosing pumps as they are critical. When reef-pi turns on/off the pump it could check the pin to verify it's set proper and move on, if not try again.

The function is call getPWM and is located in the PCA9685.cpp file here.



Unfortunately I'm still not comfortable poking in the code yet, would be great if you could start adding comments, that's my feature request. :)

If it helps any I can convert this function to work with pure c++ and drop the Arduino based libraries.
Yeah, that's a very scary failure mode, had it twice before, I've made a bandaid solution by wiring the enable pins on the l293n boards to the pi and enable and disable the motor drivers on a timer, not relying on i2c

But this new solution would be way better
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
Does anyone know how to configure Prometheus for persistent storage, I have a vm running Prometheus and grafana but when I went back to look at some data for this summer no data was found. I'm pretty sure I need to have Prom set up to keep the data and not roll over but not sure how to configure it to do that, tried googling but lots of container based stuff and still trying to find the right how to....Thanks in advanced

:)
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
Does anyone know how to configure Prometheus for persistent storage, I have a vm running Prometheus and grafana but when I went back to look at some data for this summer no data was found. I'm pretty sure I need to have Prom set up to keep the data and not roll over but not sure how to configure it to do that, tried googling but lots of container based stuff and still trying to find the right how to....Thanks in advanced

:)
Nevermind, finally figured it out...not sure how much storage it actually uses but set it up for a year and I guess I can increase that if needed.
 
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
Nevermind, finally figured it out...not sure how much storage it actually uses but set it up for a year and I guess I can increase that if needed.
Yup. Prometheus is a persistent storage. You just have to tune the retention time per your requirements
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
Yup. Prometheus is a persistent storage. You just have to tune the retention time per your requirements
Yup finally found the option and where I needed to make it. How long are you setting the retention period for? I upped it to 1y but just curious on what you are using.

:)
 

level16gazebo

Active Member
View Badges
Joined
Apr 29, 2017
Messages
175
Reaction score
94
Rating - 0%
0   0   0
Wanted to use some of the probes I have on my old Apex until I can replace them with native ones, so I enabled 'Open XML Access' and wrote this python3 script. You might also find it useful. It just writes the value of each probe to a file named the same as that probe's name. This might exist somewhere else, but I couldn't find it in ten minutes, so...

How can I actually use these values, though? I've tried adding the file-analog and file-digital drivers, but I'm not sure where to go from there. I tried adding the file-analog driver as an analog input and then adding it on the temperature tab, but that doesn't seem to work, I can't select it as an input.

Python:
#sudo apt-get install libxml2-dev libxslt-dev python-dev
#pip install requests
#pip install bs4
#pip install lxml

import requests
from bs4 import BeautifulSoup

#put the address for your apex here. 
#you probably don't have a DNS entry for it
#so you should set a static IP and enter it here
#See your apex's configuration > network setup section
apexAddress = "apex"

#Get the data from the Apex. You need to enable "Open XML Access"
#See your apex's configuration > network setup section
apexData = requests.get("http://" + apexAddress + "/cgi-bin/status.xml")
xml_soup = BeautifulSoup(apexData.content, 'xml')

#Write the data into files for reef-pi to ingest
for probe in xml_soup.find_all('probe'):
    name = probe.find("name").contents[0]
    value = probe.find("value").contents[0]
    probeType = probe.find("type").contents[0]

    filename = name + ".txt"
    f = open(filename, "w")
    f.write(value)
    f.close()
 

Crisstianoo

New Member
View Badges
Joined
Nov 7, 2021
Messages
10
Reaction score
8
Location
Michigan
Rating - 100%
1   0   0
hi

Ranjib can you add a diagram like the one for ATO to see when one of my Equipment turned on or off? one exemple is I want to know when my heater turned on or off​

 
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
Wanted to use some of the probes I have on my old Apex until I can replace them with native ones, so I enabled 'Open XML Access' and wrote this python3 script. You might also find it useful. It just writes the value of each probe to a file named the same as that probe's name. This might exist somewhere else, but I couldn't find it in ten minutes, so...

How can I actually use these values, though? I've tried adding the file-analog and file-digital drivers, but I'm not sure where to go from there. I tried adding the file-analog driver as an analog input and then adding it on the temperature tab, but that doesn't seem to work, I can't select it as an input.

Python:
#sudo apt-get install libxml2-dev libxslt-dev python-dev
#pip install requests
#pip install bs4
#pip install lxml

import requests
from bs4 import BeautifulSoup

#put the address for your apex here.
#you probably don't have a DNS entry for it
#so you should set a static IP and enter it here
#See your apex's configuration > network setup section
apexAddress = "apex"

#Get the data from the Apex. You need to enable "Open XML Access"
#See your apex's configuration > network setup section
apexData = requests.get("http://" + apexAddress + "/cgi-bin/status.xml")
xml_soup = BeautifulSoup(apexData.content, 'xml')

#Write the data into files for reef-pi to ingest
for probe in xml_soup.find_all('probe'):
    name = probe.find("name").contents[0]
    value = probe.find("value").contents[0]
    probeType = probe.find("type").contents[0]

    filename = name + ".txt"
    f = open(filename, "w")
    f.write(value)
    f.close()
use file analog driver to associate this file with a driver. then create an analog input connector using the new driver. after than you can use the analog input connector under ph module to read it and control equipment/alert etc.
tldr,
file driver -> analog input connector -> ph module is the way to use this file to control/monitor things using reef-pi.
keep us posted
 
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
hi

Ranjib can you add a diagram like the one for ATO to see when one of my Equipment turned on or off? one exemple is I want to know when my heater turned on or off​

you mean equipment state chart? we can do that right now with prometheus metric. for a native chart inside reef-pi, i have to think about it. It will cost some memory to store the historical state. we do this for the control systems (ph, temperature, ato etc) and not just independent equipment
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
Pretty sure this has come up just not finding much with search, but is it possible to have power monitoring with the Kasa strips? I'd like to get notified if the power dips on the return pump, wasn't sure if possible and if so what did you need to do to enable it.
 
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
Pretty sure this has come up just not finding much with search, but is it possible to have power monitoring with the Kasa strips? I'd like to get notified if the power dips on the return pump, wasn't sure if possible and if so what did you need to do to enable it.
Yes. If you have hs300 or 110 units then the driver will provide analog input connectors (pin 0-5 for hs300, and only 0 for hs110) to read the current draw, that you can use in ph module to monitor and control other things
 

trustychords

New Member
View Badges
Joined
Aug 17, 2019
Messages
24
Reaction score
31
Location
Virginia, USA
Rating - 0%
0   0   0
This sounds great, on behalf of many thanks for your hard work.

This isn't a bug but yesterday I got a sad email where someone's dosing pump didn't turn off, thankfully no harm was done. He restarted things which immediately turned off the pump. The control for the pump was coming from the pca9685, my guess is reef-pi sent out the command to turn off the pump but that command didn't make it to the pca9685 in tact. Unfortunately this is the problem with I2C, it'll never be 100% perfect as it has no acknowledge system.

I didn't think it was possible to read the current value of a specific pca9685 pin as I've looked into this in the past however after hearing this I thought I would try again. I stumbled across a new c++ Arduino based library from Rob Tillaart last updated early this year. Again it looks like he did what few could and added a function to read the set value of a pin. I've tested it out and it works perfectly. You're able to set the value normally then immediately check and verify if it in fact changed.

So now I'm wondering if you're able to incorporate a verification on mainly the dosing pumps as they are critical. When reef-pi turns on/off the pump it could check the pin to verify it's set proper and move on, if not try again.

The function is call getPWM and is located in the PCA9685.cpp file here.



Unfortunately I'm still not comfortable poking in the code yet, would be great if you could start adding comments, that's my feature request. :)

If it helps any I can convert this function to work with pure c++ and drop the Arduino based libraries.
I agree with @robsworld78 on the need to verify if the dosing pumps are on and off when using pca9685. Dosing pumps failures are scary; having the peace of mind they are working appropriately would be wonderful.

Hopefully this can be incorporated into a future release.
 
Back
Top