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
Hi all,

I have a question. I have a test install 4.1, on Raspberry Pi 4 Model B Rev 1.2
I am currently just playing around to test what it can/cannot do.

I have found 2 issues alarming, but maybe it is just me.

1.
I have set up an output to pin 21 (just a led with a resistor)
added a file input (config / drivers - file content is just one number)
added the driver to analog input and outlet accordingly
Set up an equipment using outlet (could turn on and of LED )
Set up 2 macros to turn off and on LED equipment
then went and set up a PH type sensor using this input and control 2 macros so when it is high LED on else OFF

Started to change the values and all seems to be fine at first but noticed that when the value is on the or between the Lower or Upper Threshold the LED blinks with the frequency of the "Check Frequency" in my case ever 5 sec

This means it gives a pulse every time it cheeks it but why?

2. I have started to turn on functions so I can do more tests. but there is no way to turn them off. You untick it and it comes back. Not to mention the above setup started to receive constant on status as random values on the chart started to appear above the Upper Threshold which I presume triggered the TURN on macro.

Any idea why?
I’m not sure I understand correctly., there are too many things going on here. I’ll need lot more detail about the file driver setup , controller configurations etc and have to spend time to untangle this. If you think you are seeing bugs then please file a GitHub issue . It’s best to create a thread if you want to maintain some context. Else things get buried pretty quickly in this thread
 

ReeferLou

Active Member
View Badges
Joined
Dec 24, 2020
Messages
193
Reaction score
151
Location
Michigan-Oakland County
Rating - 0%
0   0   0
Use the api , and curl
Thanks for pointing me in the general direction. Here is the pythonized version for use:
Code:
#Provided by ReeferLou for Reef-pi telemetry via python script
#give a like if you find useful
print ("Attempt at Reef-Pi API")

import requests
session = requests.session()
#Log into reef-pi session
r = session.post(url='http://0.0.0.0:80/auth/signin', data='{"user":"reef-pi", "password":"reef-pi"}')

rtest = str(r)
#print(rtest)
if ("200" in rtest):
        print("Signed in")
        tempd = session.get(url='http://0.0.0.0:80/api/tcs/1/read')
#       print (tempd,tempd.text)
        temp = str(tempd.text)
        temp = temp.rstrip()

        phd = session.get(url='http://0.0.0.0:80/api/phprobes/2/read')

#       print (phd,phd.text)
        ph = str(phd.text)
        ph = ph.rstrip()
        print ("Current ph =  " + ph)
        print ("Current temp =  " + temp)
else:
        print ("Login failed!")
 
Last edited:

tmbarbour

New Member
View Badges
Joined
Jan 29, 2021
Messages
2
Reaction score
4
Location
Fairfax Station, VA
Rating - 0%
0   0   0
Thanks for pointing me in the general direction. Here is the pythonized version for use:
Code:
#Provided by ReeferLou for Reef-pi telemetry via python script
#give a like if you find useful
print ("Attempt at Reef-Pi API")

import requests
session = requests.session()
#Log into reef-pi session
r = session.post(url='http://0.0.0.0:80/auth/signin', data='{"user":"reef-pi", "password":"reef-pi"}')

rtest = str(r)
#print(rtest)
if ("200" in rtest):
        print("Signed in")
        tempd = session.get(url='http://0.0.0.0:80/api/tcs/1/read')
#       print (tempd,tempd.text)
        temp = str(tempd.text)
        temp = temp.rstrip()

        phd = session.get(url='http://0.0.0.0:80/api/phprobes/2/read')

#       print (phd,phd.text)
        ph = str(phd.text)
        ph = ph.rstrip()
        print ("Current ph =  " + ph)
        print ("Current temp =  " + temp)
else:
        print ("Login failed!")


Use the api , and curl
I just pushed out an update to my "Reef-pi script utils". It includes a 'reef-py.py' command that provides a CLI for the API calls . It tries to mimic the reef-pi db command as much as possible. It also has full Bash completion support, to assist with available options and configured reef-pi ids. It can do some simple value extractions, pretty-print the JSON, or you can pipe the JSON into jq for more advanced options.
Examples:
reef-py.py show temperature_current 2 reef-py.py show ph_readings 7 --value current --last value reef-py.py list timers --pretty

I use it to get the current pH, temperature and time for an OLED display for my tank.
 

attiland

2500 Club Member
View Badges
Joined
Jul 22, 2020
Messages
2,594
Reaction score
4,802
Location
United Kingdom
Rating - 0%
0   0   0
I’m not sure I understand correctly., there are too many things going on here. I’ll need lot more detail about the file driver setup , controller configurations etc and have to spend time to untangle this. If you think you are seeing bugs then please file a GitHub issue . It’s best to create a thread if you want to maintain some context. Else things get buried pretty quickly in this thread
Thanks I will. I do believe I see an error here with my first test als think it is not major issue.
 

attiland

2500 Club Member
View Badges
Joined
Jul 22, 2020
Messages
2,594
Reaction score
4,802
Location
United Kingdom
Rating - 0%
0   0   0
I just pushed out an update to my "Reef-pi script utils". It includes a 'reef-py.py' command that provides a CLI for the API calls . It tries to mimic the reef-pi db command as much as possible. It also has full Bash completion support, to assist with available options and configured reef-pi ids. It can do some simple value extractions, pretty-print the JSON, or you can pipe the JSON into jq for more advanced options.
Examples:
reef-py.py show temperature_current 2 reef-py.py show ph_readings 7 --value current --last value reef-py.py list timers --pretty

I use it to get the current pH, temperature and time for an OLED display for my tank.
This is awesome. Now if there would be a way to trigger these from macro would make lot of sense instead using 2 schedulers.

I haven’t looked into this in details but if reef-pi would use crontab for its scheduling a whole new word would open.

Knowing there is a way to do this from bash may be the way forward at least for me. Would allow greater access to hardware not officially supported too.
 

ReeferLou

Active Member
View Badges
Joined
Dec 24, 2020
Messages
193
Reaction score
151
Location
Michigan-Oakland County
Rating - 0%
0   0   0
I just pushed out an update to my "Reef-pi script utils". It includes a 'reef-py.py' command that provides a CLI for the API calls . It tries to mimic the reef-pi db command as much as possible. It also has full Bash completion support, to assist with available options and configured reef-pi ids. It can do some simple value extractions, pretty-print the JSON, or you can pipe the JSON into jq for more advanced options.
Examples:
reef-py.py show temperature_current 2 reef-py.py show ph_readings 7 --value current --last value reef-py.py list timers --pretty

I use it to get the current pH, temperature and time for an OLED display for my tank.
Do you notice the API for PH reading does not return the same current value that is on the Dashboard? Temp is OK, but ph seems to be an old value when using:
curl -b cookie.txt http://0.0.0.0:80/api/phprobes/{2}/read
 

GaryE

Well-Known Member
View Badges
Joined
Mar 12, 2020
Messages
992
Reaction score
1,385
Location
Coatesville, Indiana
Rating - 0%
0   0   0
Had to cobble together another box last night so I can control my new lights on my nem tank.

1614524677232.png


1614524697715.png




1614524726249.png
 

GaryE

Well-Known Member
View Badges
Joined
Mar 12, 2020
Messages
992
Reaction score
1,385
Location
Coatesville, Indiana
Rating - 0%
0   0   0
Still testing. As soon as I get this one assembled, I can test and determine if it's going to do what I need it to.

If all is good I'll order the next batch of boards that have more PWM pins, ground pins and a few other minor mods.
 

attiland

2500 Club Member
View Badges
Joined
Jul 22, 2020
Messages
2,594
Reaction score
4,802
Location
United Kingdom
Rating - 0%
0   0   0
Still testing. As soon as I get this one assembled, I can test and determine if it's going to do what I need it to.

If all is good I'll order the next batch of boards that have more PWM pins, ground pins and a few other minor mods.
nice work, All I am missing is the RTC and a couple of extra i2c ports for flexibility or just repeat the pins of GPIO so next board can go on top but your ideas are already noted ;)
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
Had to cobble together another box last night so I can control my new lights on my nem tank.

1614524677232.png


1614524697715.png




1614524726249.png
How did the integration go with the Wills lights, looks like it was pretty straight forward but I thought I read something about blowing some mosfets? Wasn't sure where it ended up build wise.

Looks good though :)
 

GaryE

Well-Known Member
View Badges
Joined
Mar 12, 2020
Messages
992
Reaction score
1,385
Location
Coatesville, Indiana
Rating - 0%
0   0   0
How did the integration go with the Wills lights, looks like it was pretty straight forward but I thought I read something about blowing some mosfets? Wasn't sure where it ended up build wise.

Looks good though :)

I'm not sure why that driver blew a mosfet. I have a replacement, but haven't fixed it.

Overall they are working fine. I added a second set of those same lights to my nem tank and the blue channel on it blinks for about 3 minutes at the end of the cycle when they are ramping down. Not sure why.
 

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,591
Reaction score
1,590
Rating - 0%
0   0   0
I'm not sure why that driver blew a mosfet. I have a replacement, but haven't fixed it.

Overall they are working fine. I added a second set of those same lights to my nem tank and the blue channel on it blinks for about 3 minutes at the end of the cycle when they are ramping down. Not sure why.
I get that blinking sometimes too, it happens when the signal oscillates above and below the treshold at which the light turns on. You can fix it by looking at what level reef-pi sets the light when that is happening and set the "minimum" value in the light settings to a point or two above that.
Could be anything, inadequate low pass filter, long cables picking up interference, more intricate electrical stuff, but the minimum setting "fixes" them all, at the cost of losing a bit of range.
 

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 will be honest I don’t know enough about that chip to consider it at all but heard that it gets really hot so that would put me off.

Yeah, it does require a you to place a crap ton of vias under it for thermal relief.. I'll check the temp when running, once I get that far.

Hopefully those traces under it don't get too hot and lift up..

1614820557687.png
 
Last edited:

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 get that blinking sometimes too, it happens when the signal oscillates above and below the treshold at which the light turns on. You can fix it by looking at what level reef-pi sets the light when that is happening and set the "minimum" value in the light settings to a point or two above that.
Could be anything, inadequate low pass filter, long cables picking up interference, more intricate electrical stuff, but the minimum setting "fixes" them all, at the cost of losing a bit of range.
I'll take a look at that. Odd thing, it's just the blue channel in one fixture. If course the drivers in these are junk, but I have seen any similar that I think would work that wouldn't raise the cost a over what a better light would cost. Defeating the purpose of buying this one in the first place.

For now the nems get a 3 minute light show before bed time.
 
Back
Top