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,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Ok I will post an issue to track it. I use Grafana extensively so this level of segregation will allow for multiple reef-pi devices data analytics.
If you use grafana and Prometheus you can do this already, because Prometheus will let you filer by job Id (pi in our case )
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I am getting a bug where my temp graphs on my dashboard seem to not be updating. I was on 4.3 and upgraded to 5.1 but its still happening.
I know its still monitoring the temp in real time but the graphs are always behind by 20 - 30 min and only seem to randomly update. Perhaps I am missing a setting somewhere?
Hmm. I can’t think of anything that will do this ,, if you refresh the graphs get updated ?
 

GaryE

Well-Known Member
View Badges
Joined
Mar 12, 2020
Messages
992
Reaction score
1,384
Location
Coatesville, Indiana
Rating - 0%
0   0   0
The only way i can get them to update is to reboot the pi. The graph has not updated for 3 hours at this point.

point a browser at the reef-pi endpoint for stats http://REEFPI/x/metrics change this to the appropriate host name or ip address you use.

Refresh that page a few times and watch the memory numbers :


go_memstats_alloc_bytes 7.326184e+06
# HELP go_memstats_alloc_bytes_total Total number of bytes allocated, even if freed.
# TYPE go_memstats_alloc_bytes_total counter
go_memstats_alloc_bytes_total 9.1560913656e+10
# HELP go_memstats_buck_hash_sys_bytes Number of bytes used by the profiling bucket hash table.
# TYPE go_memstats_buck_hash_sys_bytes gauge
go_memstats_buck_hash_sys_bytes 938885

They should change a bit every refresh.. If they do, reef-pi is likely not where you are having the issue.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
point a browser at the reef-pi endpoint for stats http://REEFPI/x/metrics change this to the appropriate host name or ip address you use.

Refresh that page a few times and watch the memory numbers :


go_memstats_alloc_bytes 7.326184e+06
# HELP go_memstats_alloc_bytes_total Total number of bytes allocated, even if freed.
# TYPE go_memstats_alloc_bytes_total counter
go_memstats_alloc_bytes_total 9.1560913656e+10
# HELP go_memstats_buck_hash_sys_bytes Number of bytes used by the profiling bucket hash table.
# TYPE go_memstats_buck_hash_sys_bytes gauge
go_memstats_buck_hash_sys_bytes 938885

They should change a bit every refresh.. If they do, reef-pi is likely not where you are having the issue.
This is reef-pi dashboard related or grafana/prom related ?
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I'd say if his metrics endpoint is emitting data every refresh, it'd be an issue with either prometheus or grafana..
The dashboard is independent of that . When browser is open, the charts should auto update every 10s. The metrics itself gets updated based on the individual module’s interval time (like ato interval )
 

GaryE

Well-Known Member
View Badges
Joined
Mar 12, 2020
Messages
992
Reaction score
1,384
Location
Coatesville, Indiana
Rating - 0%
0   0   0
The dashboard is independent of that . When browser is open, the charts should auto update every 10s. The metrics itself gets updated based on the individual module’s interval time (like ato interval )

Hmm.. I was stuck on Grafana.. I guess he's talking about the reef-pi graphs.. Ooops.. ;)
 

marekd1

Active Member
View Badges
Joined
Dec 24, 2019
Messages
133
Reaction score
200
Rating - 0%
0   0   0
If you use grafana and Prometheus you can do this already, because Prometheus will let you filer by job Id (pi in our case )
In my case I use NodeRed and all DB functions go to InfluxDB. Grafana pull data from InfluxDB. The NodeRed also does bunch of logic functions and is my central IoT processing engine. Having this function native at the device level will minimize the external app sprawl and management nightmare. I host all of these as containers on Docker locally. This is the only reason I've asked if this could be done at the Reef-Pi level.
 

GaryE

Well-Known Member
View Badges
Joined
Mar 12, 2020
Messages
992
Reaction score
1,384
Location
Coatesville, Indiana
Rating - 0%
0   0   0
Working on a display for the outside of my project case so I can get a quick look at some parameters.

Currently running on a raspberry pi with python. Going to convert to Arduino...

PXL_20220101_005327157.jpg
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
In my case I use NodeRed and all DB functions go to InfluxDB. Grafana pull data from InfluxDB. The NodeRed also does bunch of logic functions and is my central IoT processing engine. Having this function native at the device level will minimize the external app sprawl and management nightmare. I host all of these as containers on Docker locally. This is the only reason I've asked if this could be done at the Reef-Pi level.
You are not using any less software right ? Instead of influx, we use Prometheus (for long term retention and consolidation of metrics ) .
I thought about this before, would it be possible to make what is displayed dependant on the time-width of the graph? I.e. only display hours and minutes OR day and month OR just month OR month and year OR just year depending on how much time the graph covers. The full timestamp can still be left in the popup whn selecting datapoints to clear up confusions

Or something similar, to declutter irrelevant data
we can. Because it’s software , we can definitely do something clever to detect the available space and adjust accordingly . But we have to test it , and be mindful of responsive scenarios (phone and tablets )
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
In my case I use NodeRed and all DB functions go to InfluxDB. Grafana pull data from InfluxDB. The NodeRed also does bunch of logic functions and is my central IoT processing engine. Having this function native at the device level will minimize the external app sprawl and management nightmare. I host all of these as containers on Docker locally. This is the only reason I've asked if this could be done at the Reef-Pi level.
How you are moving the metric from reef-pi to influxdb ? You can not assign the metadata in that mechanism ?
it’s bit confusing on reef-pi end to specify those metadata since it’s not pushing metrics anywhere, it just publish the metrics in a handler/endpoint which prom scrapes . Any metadata is associated by the prom scrape config
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
In my case I use NodeRed and all DB functions go to InfluxDB. Grafana pull data from InfluxDB. The NodeRed also does bunch of logic functions and is my central IoT processing engine. Having this function native at the device level will minimize the external app sprawl and management nightmare. I host all of these as containers on Docker locally. This is the only reason I've asked if this could be done at the Reef-Pi level.
I think I get it now. You are talking about your work node red controller. Reef/pi does not uses any external db like influx , uses its own embedded database called boltdb. In this way reef-pi is significantly less component compared to the stack you are using . A full reef-pi does not need any external host to store metric or visualize charts . It has all those built in, and ships as single Debian package that comes with the entire db, backend, front end . For advance use cases (like arbitrary graphs, long term retention ) reef-pi allows Prometheus integration .
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,344
Reaction score
1,722
Location
Missouri
Rating - 0%
0   0   0
Happy New year everyone! :)

I have a question that I am hoping someone can point me in the right direction. I have a few of the @Michael Lane boards. I have one goby that appears to have had a bad pca9685, one of the channels is stuck closed and want to replace it the pca9685 but it's surface mount and not sure I am up to the challange any one have any suggestions on how to approach would be appreciated. The other board I have is for controlling my viparspectra light, he has a board that will allow you to turn it off and on via pwm. I wish I had bought more than one and would like to have a spare or make one up, he has the data on github but not sure how to display the schematic - https://github.com/Ranthalion/viparspectra-adapter

The other question is how does one go about and get a pcb board made up, not sure the cost and how many you have to have made but just curious. If I can get the schematic I can make one up but will not be anywhere as pretty as his boards, lol.

Maybe someone else is making something similiar for the vipar lights but thought I would ask, thanks.

Found that the files are kicad and loaded it up and was able to open the schematic but now to get my head wrapped around how I would do this on a bread board, lol. Might be out of my league, anyone care to make this simple for me let me know, lol.
vipar-schematic.png
 
Last edited:

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
952
Reaction score
1,281
Location
Edmonton, Canada
Rating - 0%
0   0   0
Happy New year everyone! :)

I have a question that I am hoping someone can point me in the right direction. I have a few of the @Michael Lane boards. I have one goby that appears to have had a bad pca9685, one of the channels is stuck closed and want to replace it the pca9685 but it's surface mount and not sure I am up to the challange any one have any suggestions on how to approach would be appreciated. The other board I have is for controlling my viparspectra light, he has a board that will allow you to turn it off and on via pwm. I wish I had bought more than one and would like to have a spare or make one up, he has the data on github but not sure how to display the schematic - https://github.com/Ranthalion/viparspectra-adapter

The other question is how does one go about and get a pcb board made up, not sure the cost and how many you have to have made but just curious. If I can get the schematic I can make one up but will not be anywhere as pretty as his boards, lol.

Maybe someone else is making something similiar for the vipar lights but thought I would ask, thanks.

Found that the files are kicad and loaded it up and was able to open the schematic but now to get my head wrapped around how I would do this on a bread board, lol. Might be out of my league, anyone care to make this simple for me let me know, lol.
vipar-schematic.png
It's possible I've soldered over 1,000 pca9685's, when you know what your doing they're actually not that difficult, I would prefer doing them all day then say an RJ45 connector. The key is to use really thin solder (personally I use a small bead of solder paste and hot air) so you don't get too much on it. You'll also want a fine tip for the solder iron.

You would tack one corner pin and get it nice and straight then take the opposite corner and verify all pins line up perfectly straight, this is important. Then start in the middle and touch a little solder while heating and drag the iron across and away from the IC, I think they call it drag soldering. If you look up fine pitch soldering on youtube you'll see some examples.

Removing it isn't too difficult, here's a video showing how, these come off easier as the pins are so close. Typically all the solder you add will go with the part when you push it off with the iron, then with a clean soldering tip wipe the pads clean on the board.



As for the ML adapter I've been asked a few times about it so I remade the board using Eagle (don't like Kicad) but I'm having a hard time hitting the order button as I don't feel right about it, I've been hoping he would come back with them instead. I'm not sure about the files on Github as someone mentioned they weren't accepted but maybe you can ask JLPCB or similar if they can help.
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,344
Reaction score
1,722
Location
Missouri
Rating - 0%
0   0   0
It's possible I've soldered over 1,000 pca9685's, when you know what your doing they're actually not that difficult, I would prefer doing them all day then say an RJ45 connector. The key is to use really thin solder (personally I use a small bead of solder paste and hot air) so you don't get too much on it. You'll also want a fine tip for the solder iron.

You would tack one corner pin and get it nice and straight then take the opposite corner and verify all pins line up perfectly straight, this is important. Then start in the middle and touch a little solder while heating and drag the iron across and away from the IC, I think they call it drag soldering. If you look up fine pitch soldering on youtube you'll see some examples.

Removing it isn't too difficult, here's a video showing how, these come off easier as the pins are so close. Typically all the solder you add will go with the part when you push it off with the iron, then with a clean soldering tip wipe the pads clean on the board.



As for the ML adapter I've been asked a few times about it so I remade the board using Eagle (don't like Kicad) but I'm having a hard time hitting the order button as I don't feel right about it, I've been hoping he would come back with them instead. I'm not sure about the files on Github as someone mentioned they weren't accepted but maybe you can ask JLPCB or similar if they can help.

Yeah pretty easy when you know what your doing, yeah it's my eyesight us older folks at least me have a harder time seeing the dang small stuff. I need to get a better setup for doing smd stuff been thinking about getting a hot air rework station for just this stuff, would make it a lot easier. Thanks for the information need to order some and see what I can do, have you ever seen one go bad like this, basically it appears to be stuck closed and will not shut off. It's a doser connection and lost power and when it return the pump stays on, tried a lot of different things and finally just replaced the board and restored software and it was fine, but that is all I can think of is that the 9685 has gone south.

I'd really like to have some spare vipar boards, I have reached out to @Michael Lane a couple of times just checking in and not have gotten any responses. Last time I talked to him sounded like things outside of reefing were taking up more of his time. Pretty sure all of his stuff on github is licensed opensource, the silkscreen on the board says opensource hardware but will look further into the files. I have uploaded them onto mypcb and was looking into getting a cost for them, heck i was even going to get a cost for them to assembly them. I have no idea what I am doing but I uploaded the gerber files and the inventory bom that he had and from the boards I have they appear to be the same ones. Will probably not hear back from them until next week but will see where it leads, I just would like to have a couple on hand for testing and backups etc. but I think there are many folks that would like to use them it removes the relay requirement from having to turn the unit off and on I am using one and they are really nice and easy to implement.

Thanks again for all of the input and let me know what you think about the boards. :)
 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
952
Reaction score
1,281
Location
Edmonton, Canada
Rating - 0%
0   0   0
Yeah pretty easy when you know what your doing, yeah it's my eyesight us older folks at least me have a harder time seeing the dang small stuff. I need to get a better setup for doing smd stuff been thinking about getting a hot air rework station for just this stuff, would make it a lot easier. Thanks for the information need to order some and see what I can do, have you ever seen one go bad like this, basically it appears to be stuck closed and will not shut off. It's a doser connection and lost power and when it return the pump stays on, tried a lot of different things and finally just replaced the board and restored software and it was fine, but that is all I can think of is that the 9685 has gone south.

I'd really like to have some spare vipar boards, I have reached out to @Michael Lane a couple of times just checking in and not have gotten any responses. Last time I talked to him sounded like things outside of reefing were taking up more of his time. Pretty sure all of his stuff on github is licensed opensource, the silkscreen on the board says opensource hardware but will look further into the files. I have uploaded them onto mypcb and was looking into getting a cost for them, heck i was even going to get a cost for them to assembly them. I have no idea what I am doing but I uploaded the gerber files and the inventory bom that he had and from the boards I have they appear to be the same ones. Will probably not hear back from them until next week but will see where it leads, I just would like to have a couple on hand for testing and backups etc. but I think there are many folks that would like to use them it removes the relay requirement from having to turn the unit off and on I am using one and they are really nice and easy to implement.

Thanks again for all of the input and let me know what you think about the boards. :)
I hear you on the eyes, mine are shot close up, most of the time I'm soldering blind. :) Something about the pca9685 that makes it easy, I've done other IC's with similar pitch but they seem harder.

I have one of these cheap hot air guns, I'm amazed at how long it has lasted and it's been used a lot with times running hours. I highly recommend, no need to spend big bucks. With that said it's still better to remove parts using that technique I showed, that's the best tip I ever learned. Never remove solder when removing anything, instead add solder.


The pca9685 is quite rugged, I have very little trouble with them, I don't think I've ever seen a pin stuck on. It's sounding like you have a bad mosfet instead. I'm guessing you have similar being driven by the pca9685? Those can get stuck closed, when that happens the gate with the PWM signal will have voltage which can looks like it's coming from pca9685 but it's not. If you remove the mosfet the pin will react as expected. I would look at that first.

That adapter is nicely thought out, I guess at this point it wouldn't hurt to get some. I currently have a customer who's trying to adapt the light, he determined the signal inside the light is 0-3.3v, are you driving the adapter with the same or 0-5v? I'm hoping 0-5v PWM from your pca9685.
 

GaryE

Well-Known Member
View Badges
Joined
Mar 12, 2020
Messages
992
Reaction score
1,384
Location
Coatesville, Indiana
Rating - 0%
0   0   0
I hear you on the eyes, mine are shot close up, most of the time I'm soldering blind. :) Something about the pca9685 that makes it easy, I've done other IC's with similar pitch but they seem harder.

I have one of these cheap hot air guns, I'm amazed at how long it has lasted and it's been used a lot with times running hours. I highly recommend, no need to spend big bucks. With that said it's still better to remove parts using that technique I showed, that's the best tip I ever learned. Never remove solder when removing anything, instead add solder.


The pca9685 is quite rugged, I have very little trouble with them, I don't think I've ever seen a pin stuck on. It's sounding like you have a bad mosfet instead. I'm guessing you have similar being driven by the pca9685? Those can get stuck closed, when that happens the gate with the PWM signal will have voltage which can looks like it's coming from pca9685 but it's not. If you remove the mosfet the pin will react as expected. I would look at that first.

That adapter is nicely thought out, I guess at this point it wouldn't hurt to get some. I currently have a customer who's trying to adapt the light, he determined the signal inside the light is 0-3.3v, are you driving the adapter with the same or 0-5v? I'm hoping 0-5v PWM from your pca9685.
I have the exact same gun.. ;) Works great once you figure out the temps..
 

GaryE

Well-Known Member
View Badges
Joined
Mar 12, 2020
Messages
992
Reaction score
1,384
Location
Coatesville, Indiana
Rating - 0%
0   0   0
Nice :) , keep us posted


a quick update. I was trying to do this all in the arduino, but it seems it's really not up to the task of slurping in all of the metrics, parsing for the right data and then spitting out the right bit.. So... I decided to write a python script to do that part and output to a file, then will have the arduino connect and FTP the files to get the data and then display it. Should be way easier on the ardiuno side that way. Then it's a matter of finding a case and figuring out how I want to power it long term.. Fun stuff!!

On the positive side, this will make the gadget portable. Will not be tied to the tank. Just will need to plug it in somewhere and instant stats!

so far, this is the python code.


import requests

URL = "http://10.167.15.10/x/metrics"
tankTemp = "tank_temp_reading"
sumpTemp = "sump_temp_reading"
boxTemp = "box_temp_reading"

def listToString(s):
#initialize an empty string

string = " "
#return string
return (string.join(s))

def getTemp(t):

from urllib.request import urlopen

response = urlopen(URL)
html = response.read()
html = html.decode()
text = html.split('\n') # split everything into lines.

for line in text:
if not line.startswith(t) :
# do nothing
pass
else :
text = line.split(' ') # split everything into lines.
text.pop(0)
temp = (listToString(text))
return temp

print(getTemp(tankTemp))
print(getTemp(sumpTemp))
print(getTemp(boxTemp))
 

Creating a strong bulwark: Did you consider floor support for your reef tank?

  • I put a major focus on floor support.

    Votes: 59 39.6%
  • I put minimal focus on floor support.

    Votes: 34 22.8%
  • I put no focus on floor support.

    Votes: 50 33.6%
  • Other.

    Votes: 6 4.0%
Back
Top