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

cnidus

Community Member
View Badges
Joined
Mar 19, 2020
Messages
67
Reaction score
81
Rating - 0%
0   0   0
This might be a dumb question...

I saw that the reef-pi hs300 driver should support power monitoring? Where is that exposed? Can we use that as a trigger for alarms/macros etc?
 

Dave's Reef

Active Member
View Badges
Joined
Nov 4, 2018
Messages
102
Reaction score
150
Rating - 0%
0   0   0
Not sure if anyone is interested or not but I seem to have fixed my multiple temp probes issue. With a one wire device they need to be linear not a star when going longer distance and adding more probes. My setup is now running 4 sensors for almost 24hrs with no issues. Before it would only run for a hour or two max. I still have one more I would like to add to the chain but as of now my setup is as follows. I used 25' of 4 wire phone wire and spaced the sensors every 5ft along the length of wire (not currently using the end Tap). I also had to change the resistor to a 3.3k with the 4.7k the first sensor would drop out. I am thinking when I add the fifth I might have to drop down again to say a 2.2k. I had to use sensors with a 3M cable on them because of the distance from the trunk line, with shorts lengths you may not have all these issues but I have equipment spaced over my basement and 1st floor.

This is the page I gathered most of my information from.

 

Bliff

New Member
View Badges
Joined
Apr 6, 2020
Messages
18
Reaction score
41
Rating - 0%
0   0   0
Restarting the thermometer without having to power cycle the pi
Ok this is kinda alpha stages, but I have come up with a solution that should work. When it drops out again I can test properly.

The problem is that for some reason, my almost certainly fake/knockoff DS18B20 drops out on occasion. The only way to reset it so far has been to power cycle the pi - and that's an annoyance.

Instead of powering it from the 3v3 rail, I have it powered from a GPIO pin, and since it uses a very minimal amount of current this is supposed to be ok.
I can then control that GPIO pin, and effectively cut power to the sensor without restarting the pi.

My thermometer is connected with the DATA pin to GPIO4, the default 1-wire input line
VCC is connected to BCM 17 (physical 11)
GND is connected to any ground lead; I used physical 9 since it's right next to the others

In /etc/rc.local I have:
Code:
#turn on GPIO Pin 17 to power the thermometer with 3.3V
/usr/bin/gpio -g mode 17 out
echo "GPIO pin BCM17 set to OUTPUT"
gpio readall | grep 'GPIO. 0' | grep '\(IN\|OUT\)'
/usr/bin/gpio -g write 17 1
echo "GPIO pin BCM 17 turned ON"
gpio readall | grep 'GPIO. 0' | grep '\(IN\|OUT\)'
(gpio -g uses BCM numbering to refer to a particular pin)
(The gpio readall lines are just there to provide some visual feedback of what's going on, they aren't strictly needed)
This is to make sure that on startup the pin is high (+3.3V), so that the thermometer is on at restart.


I have a bash script in the home folder that checks for the presence of my particular probe by checking if its directory is present, and power cycling the GPIO "VCC" pin for a few seconds if it is not:
Code:
#!/bin/bash
echo "Restarting that stupid thermometer"

DIR="/sys/bus/w1/devices/28-xxxxxxxxxx/" #folder for the themometer device
if [ -d "$DIR" ]; then
        echo "directory at  $DIR exists. No restart needed."
else
        echo "directory  $DIR exists"
        gpio -g mode 17 out && echo "Pin 17 set to OUT mode"
        gpio -g write 17 0 && echo "Pin 17 LOW - power off"
        echo "Sleeping 3 seconds" && sleep 3
        gpio -g write 17 1 && echo "Pin 17 HIGH - power on"
        echo "listing devices dir" && ls /sys/bus/w1/devices/
fi
(replace 28-xxxxxxxxxx with your specific probe hardware address)

I then have a cron job that calls this script on 00 minute of each hour.
crontab -e
Code:
#check and restart the thermometer
00 * * * *      /home/pi/restart_therm.sh


Maybe I could actually do this another way, manually. If I create an output on pin 17 in reef-pi, I could then make an equipment entry and toggle that like you would an LED or relay signal within reef-pi. What would make this more fancy is if there was a way for reef-pi to detect a crazy temperature (eg > 80°C or < 0°C), and then call a macro to power cycle the thermometer equipment.
What I don't know is how to get reef-pi to "if some condition x then execute macro y". Yet.

Edit: crontab mistake
 

b4tn

Valuable Member
View Badges
Joined
Jun 17, 2015
Messages
1,673
Reaction score
2,244
Location
Columbia MD
Rating - 0%
0   0   0
I am just wondering if anyone else is using xfinity X1 WiFi with the raspberry? I have had a slew of problems since switching from being hardline Ethernet to my router over to WiFi about 6 months ago when we moved. Some Of the problems I have had

reefpi would not load in browser. Refresh or trying later sometimes worked

reefpi would load but Only loaded the equipment and health widget. Sensor and everything else missing. Even though I could not see in the interface all programmed functions where operating (ATO, Dosers, etc).

reefpi would load but buttons where slow to respond

I would get to the password page but no passwords worked.

In troubleshooting I found rebooting my router sometimes helped but only temporarily. I do have 20 + WiFi objects on my router but several devices peloton, Roku tv, Firestick, Apple TV, windows tablet, phone, work computer, reefi lights, etc are all on WiFi In the same room as my tank with no issues. In the end I have a netgear WiFi extender with an Ethernet jack. I put it behind my tank and have the raspberry connected to that Via cat 5 and all issues have been resolved. Anyone else have WiFi issues like this?
 

GaryE

Well-Known Member
View Badges
Joined
Mar 12, 2020
Messages
992
Reaction score
1,385
Location
Coatesville, Indiana
Rating - 0%
0   0   0
Hardwire is always going to be better than WiFi. WiFi has limited bandwidth, so the more devices connected, the less bandwidth you'll have for any one device. For anything mission critical, hardwire is the way to go.
 

marekd1

Active Member
View Badges
Joined
Dec 24, 2019
Messages
133
Reaction score
200
Rating - 0%
0   0   0
I have noticed that when I use more than 3 DS18B20 temp sensors I am no longer able to properly read them. IDoes anyone else has experienced this problem. I wanted to monitor temperature of the DC power supply's for my LED lights but run into an issue when 4, and 5 sensor was added. After I remove them everything goes back to normal. Also tried different sensors just to make sure they are not faulty? BTW they read fine if there is only 3 max.

Any ideas?
 

Dave's Reef

Active Member
View Badges
Joined
Nov 4, 2018
Messages
102
Reaction score
150
Rating - 0%
0   0   0
I have noticed that when I use more than 3 DS18B20 temp sensors I am no longer able to properly read them. IDoes anyone else has experienced this problem. I wanted to monitor temperature of the DC power supply's for my LED lights but run into an issue when 4, and 5 sensor was added. After I remove them everything goes back to normal. Also tried different sensors just to make sure they are not faulty? BTW they read fine if there is only 3 max.

Any ideas?

I seem to have fixed my multiple temp probes issue. With a one wire device they need to be linear not a star when going longer distance and adding more probes. My setup is now running 4 sensors for almost 24hrs with no issues. Before it would only run for a hour or two max. I still have one more I would like to add to the chain but as of now my setup is as follows. I used 25' of 4 wire phone wire and spaced the sensors every 5ft along the length of wire (not currently using the end Tap). I also had to change the resistor to a 3.3k with the 4.7k the first sensor would drop out. I am thinking when I add the fifth I might have to drop down again to say a 2.2k. I had to use sensors with a 3M cable on them because of the distance from the trunk line, with shorts lengths you may not have all these issues but I have equipment spaced over my basement and 1st floor.
 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
985
Reaction score
1,325
Location
Edmonton, Canada
Rating - 0%
0   0   0
Adding the rtc per my instructions makes the pi look to the rtc to set time at boot and if internet is available it adjusts the RTC as well. If internet is not available the pi gets the RTC time which is close enough to not corrupt the filesystem.

Where could one find your instructions?
 

marekd1

Active Member
View Badges
Joined
Dec 24, 2019
Messages
133
Reaction score
200
Rating - 0%
0   0   0
I have done some reading on electronics boards, and I think the temp sensors can be a crapshoot because most are made with real Dallas Semiconductor DS18b20 chips, but many of the inexpensive sensors found on ebay etc are made in China with cheap knockoffs and seconds.

I agree with @Ranjib my temps in the tank hold just fine with reef-pi, there is more than a daily .2 degree variance in the Amazon River where most of my fish come from. I think shallow reef water has a diurnal variance as well.

I've been using DS18b20 ever since they were released by MAXIM. Over the years used many from Dallas as well including purchased form China in many different applications. Typically its not the sensor that dies its the salt water that kills them due to shorts, etc. Just an FYI.....
 

marekd1

Active Member
View Badges
Joined
Dec 24, 2019
Messages
133
Reaction score
200
Rating - 0%
0   0   0
I seem to have fixed my multiple temp probes issue. With a one wire device they need to be linear not a star when going longer distance and adding more probes. My setup is now running 4 sensors for almost 24hrs with no issues. Before it would only run for a hour or two max. I still have one more I would like to add to the chain but as of now my setup is as follows. I used 25' of 4 wire phone wire and spaced the sensors every 5ft along the length of wire (not currently using the end Tap). I also had to change the resistor to a 3.3k with the 4.7k the first sensor would drop out. I am thinking when I add the fifth I might have to drop down again to say a 2.2k. I had to use sensors with a 3M cable on them because of the distance from the trunk line, with shorts lengths you may not have all these issues but I have equipment spaced over my basement and 1st floor.

Linear or star does not matter, I have about 20 sensors on the OW-Server But resistor will matter. Forgot about the EOL termination. Thank you for reminding!!!!

Capture.PNG
 

b4tn

Valuable Member
View Badges
Joined
Jun 17, 2015
Messages
1,673
Reaction score
2,244
Location
Columbia MD
Rating - 0%
0   0   0
Hardwire is always going to be better than WiFi. WiFi has limited bandwidth, so the more devices connected, the less bandwidth you'll have for any one device. For anything mission critical, hardwire is the way to go.

While the reefpi is technically hardwired. It’s still operating via WiFi extender which remedies all my issues. I’m thinking maybe the onboard WiFi adapter on the raspberry is not very robust.

255D2CBC-489F-4BF0-BEE2-4294DEFDC666.jpeg
 

Dave's Reef

Active Member
View Badges
Joined
Nov 4, 2018
Messages
102
Reaction score
150
Rating - 0%
0   0   0
Linear or star does not matter, I have about 20 sensors on the OW-Server But resistor will matter. Forgot about the EOL termination. Thank you for reminding!!!!

Capture.PNG

Mine were in a star to begin with and I was having issues with them dropping out after changing to linear they are working fine now. I am no expert but the article I attached is what made me even try it. I had already tried different resistors and also using 5v supply and it would only work reliably for a limited amount of time. Like I said I'm no expert this is just what worked for me.
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
I am just wondering if anyone else is using xfinity X1 WiFi with the raspberry? I have had a slew of problems since switching from being hardline Ethernet to my router over to WiFi about 6 months ago when we moved. Some Of the problems I have had

reefpi would not load in browser. Refresh or trying later sometimes worked

reefpi would load but Only loaded the equipment and health widget. Sensor and everything else missing. Even though I could not see in the interface all programmed functions where operating (ATO, Dosers, etc).

reefpi would load but buttons where slow to respond

I would get to the password page but no passwords worked.

In troubleshooting I found rebooting my router sometimes helped but only temporarily. I do have 20 + WiFi objects on my router but several devices peloton, Roku tv, Firestick, Apple TV, windows tablet, phone, work computer, reefi lights, etc are all on WiFi In the same room as my tank with no issues. In the end I have a netgear WiFi extender with an Ethernet jack. I put it behind my tank and have the raspberry connected to that Via cat 5 and all issues have been resolved. Anyone else have WiFi issues like this?

I'm using wireless with my reefpi, its a 3+ A model that only has wifi like the zero model but with more cpu cores. Wireless seems to be solid and I have had no issues at all. I do think depending on the model the wireless maybe only 2.4ghz and its a congested spectrum. I have wireless AP's on each floor to assure a strong signal and try to use channels that are not getting clobberd, but with 2.4Ghz there are only three channels that do not overlap, 1, 6 and 11. There are some android apps like wifi Analyzer that will scan and give you an idea of spectrum and strength of each channel.

I agree I prefer wired where possible, the pi should not be doing a lot of network traffic really should not be an issue.
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
@Michael Lane on the goby hat there are 2 ATO connections, I am thinking of how I want to set up and thinking I may want three float connections, can any of the other connections be used in addition to the ATO ones?

Thanks :)

Now that I think about it, I think I can have 2 floats in one circuit in series. What I want is a low level float in the ATO tank and and another low level float in the sump. I want the circuit to not kick in if the low level float in the ATO has been activated just as a safety measure, also need to figure out how to keep the ato from getting stuck and putting to much rodi in the sump. I'm not concerned about overflowing the sump since my ATO will be pretty small but it could effect the salinity since its only a 29g tank with a 20g sump. Just looking for options to make it semi fail safe.
 
Last edited:

Des Westcott

Well-Known Member
View Badges
Joined
May 29, 2018
Messages
646
Reaction score
1,035
Location
Durban - South Africa
Rating - 0%
0   0   0
Y
I am just wondering if anyone else is using xfinity X1 WiFi with the raspberry? I have had a slew of problems since switching from being hardline Ethernet to my router over to WiFi about 6 months ago when we moved. Some Of the problems I have had

reefpi would not load in browser. Refresh or trying later sometimes worked

reefpi would load but Only loaded the equipment and health widget. Sensor and everything else missing. Even though I could not see in the interface all programmed functions where operating (ATO, Dosers, etc).

reefpi would load but buttons where slow to respond

I would get to the password page but no passwords worked.

In troubleshooting I found rebooting my router sometimes helped but only temporarily. I do have 20 + WiFi objects on my router but several devices peloton, Roku tv, Firestick, Apple TV, windows tablet, phone, work computer, reefi lights, etc are all on WiFi In the same room as my tank with no issues. In the end I have a netgear WiFi extender with an Ethernet jack. I put it behind my tank and have the raspberry connected to that Via cat 5 and all issues have been resolved. Anyone else have WiFi issues like this?
Yes. I have all those symptoms and have been trying to figure a way to solve them without a million km of surface mount cables. A temp wifi extender is kind of a BandAid on th eproblem, but I would like to get to hard wired if possible.
 

Des Westcott

Well-Known Member
View Badges
Joined
May 29, 2018
Messages
646
Reaction score
1,035
Location
Durban - South Africa
Rating - 0%
0   0   0
@Michael Lane on the goby hat there are 2 ATO connections, I am thinking of how I want to set up and thinking I may want three float connections, can any of the other connections be used in addition to the ATO ones?

Thanks :)

Now that I think about it, I think I can have 2 floats in one circuit in series. What I want is a low level float in the ATO tank and and another low level float in the sump. I want the circuit to not kick in if the low level float in the ATO has been activated just as a safety measure, also need to figure out how to keep the ato from getting stuck and putting to much rodi in the sump. I'm not concerned about overflowing the sump since my ATO will be pretty small but it could effect the salinity since its only a 29g tank with a 20g sump. Just looking for options to make it semi fail safe.

I've just been having a similar discussion with Michael in a private chat. He assures me you can use any of the GPIO pins on the Power1 Port as Float switch pins just as you would use the dedicated ATO ports. Hope this helps.
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
I've just been having a similar discussion with Michael in a private chat. He assures me you can use any of the GPIO pins on the Power1 Port as Float switch pins just as you would use the dedicated ATO ports. Hope this helps.

Thanks Wes for checking, I may go with a gravity fed setup and if I do that I will have available ports to do the other checks that I would like.

:)
 

marekd1

Active Member
View Badges
Joined
Dec 24, 2019
Messages
133
Reaction score
200
Rating - 0%
0   0   0
Mine were in a star to begin with and I was having issues with them dropping out after changing to linear they are working fine now. I am no expert but the article I attached is what made me even try it. I had already tried different resistors and also using 5v supply and it would only work reliably for a limited amount of time. Like I said I'm no expert this is just what worked for me.

The issue is total impedance on the one Wire networks. for long runs its preferred to use CAT5. Mixing CAT 5 and phone CAT3 is not recommended as impedance will be difficult to match on long runs. Short runs typically are very forgiving but you need EOL resistor which I forgot about :(

Here is a good reference with guidelines for one wire networks .

 

Dave's Reef

Active Member
View Badges
Joined
Nov 4, 2018
Messages
102
Reaction score
150
Rating - 0%
0   0   0
The issue is total impedance on the one Wire networks. for long runs its preferred to use CAT5. Mixing CAT 5 and phone CAT3 is not recommended as impedance will be difficult to match on long runs. Short runs typically are very forgiving but you need EOL resistor which I forgot about :(

Here is a good reference with guidelines for one wire networks .


My original setup was done via cat5. I had ran a cat5 from my PI downstairs (about 8' long) to a box where I split off and fed all of them. I had a box that I installed jacks in and directly plug the factory (3m) cables into this box no CAT3 on my original setup. The CAT3 now has all 5 on it and has been running since last night.
I also shared that link here and read it here is where it states that star is not an ideal setup

"""Precautions with Star Topologies
Testing has shown that unswitched star-type network topologies (i.e., those with several branches diverging at the master) are the most difficult to make reliable. The junction of various branches presents highly mismatched impedances; reflections from the end of one branch can travel distances equal to nearly the weight of the network (rather than the radius) and cause data errors. For this reason, the unswitched star topology is not recommended, and no guarantees can be made about its performance."""
 

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