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

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,520
Reaction score
1,511
Rating - 0%
0   0   0
Hey guys. Looks like Rpi has recently announce a $4 arduino style board. The Pi pico. Do we foresee any use for this down the line?
Will they this time actually be willing to sell it instead of clamping down on it with orders limited to one and doubling the price with periphery bundles that were the only way to get it, like they did with the zero?

But if they do, it could almost compete with aliexpress arduino clones. Only 3 ADCs though, which kinda sucks, but better than none I guess
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,056
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
There is additional information on the troubleshooting webpage for how to do database edits see this

Down towards the bottom you will see this section - Using reef-pi db command

Looks like the bucket you are after is the "equipment" bucket. Take a look at that page along with the one I previously linked to should provide enough information to change what you need and get it working. Remember to make a copy of the db before applying any edits, that way you can always go back.

:)
Settings bucket has the Prometheus enabled/disabled option, set it to false and start reef-pi, then update the relevant equipment name and enable Prometheus again
 

brian.badge

Active Member
View Badges
Joined
Apr 19, 2019
Messages
143
Reaction score
79
Rating - 0%
0   0   0
I have 2 heaters in my tank that have internal digital controls. I want to use the heater's internal control as primary and configure reef pi to act as a failsafe. Best situation would be reef pi shutting down the outlets to both at a certain high temp. Looking at the UI it wasn't clear how to accomplish this and my attempts at finding the answer online have bee fruitless. Can anyone point me in the right direction?
 

DanTheReefer

Active Member
View Badges
Joined
Dec 2, 2019
Messages
493
Reaction score
508
Rating - 0%
0   0   0
Hey everyone still seem to be having an issue where my ph calibration button is grayed out and pi is not detecting any readings? Any tips on whether this is probably more a hardware or software config issue?
 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
952
Reaction score
1,281
Location
Edmonton, Canada
Rating - 0%
0   0   0
I know reef-pi supports the SHT31-D but how about the SHT31? How important is the D? I can't find what that represents. Someone asked me about this sensor but I'm unsure, anyone know? I assume its ok but...

 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
952
Reaction score
1,281
Location
Edmonton, Canada
Rating - 0%
0   0   0
Do they stay stuck? Or is it a transient glitch?

1W is not going to give you guarantees, and it looks like a probe probably held the bus when it shouldn't have. The biggest risk is a probe remaining in that state, when it takes a power cycle to fix it. There is nothing to prevent that condition, especially with all the clone probes. While its not possible in stock reef-pi, putting the pull-up and the power on a switchable port, which resets the bus if it fails, is something that could be scripted on the Pi and only costs one GPIO and one P-channel FET.

I've heard this happening a few times and looked quite extensively for some code to reset the bus but yeah nothing. This hardware/code reset sounds really interesting, could you explain how it could be done? I would love to add this to my controller and I just happen to have one GPIO pin free. :)
 

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
1,951
Reaction score
3,353
Location
Sacramento, CA area
Rating - 0%
0   0   0
I've heard this happening a few times and looked quite extensively for some code to reset the bus but yeah nothing. This hardware/code reset sounds really interesting, could you explain how it could be done? I would love to add this to my controller and I just happen to have one GPIO pin free. :)

The bare minimum would be something like this:

1611368441783.png



Sensor power and the pull-up are both controlled by a single PFET. In this design, you could actually skip the PFET and power it directly from a Pi pin, but not preferred. However, this runs the sensor at 3.3V, and some of the cheap sensors really run better at 5V... so this is the bells and whistles version:

1611368728035.png


In this case, a high signal on the Pi Pin will turn on the sensor, and pull-up the 1-wire line via R1.

R2 is to pull the PFET gate up to 5V, which will keep it switched off unless Q2 is turned on. When Q2 is turned on by the high signal from the Pi, the gate of Q1 goes low so it turns on, and R2 limits current to ground.

R3 and C1 are the extra bonus parts - R3 will make sure any charge is bled away from the sensor (it may latch in a very low current state and may take awhile to reset), and C1 is good practice to decouple the power line.

1Wire sensors can be powered parasitically, so it may be valuable to add a large value (100k+) pull-down on the 1Wire bus line at all times. In theory you could do so by simply setting the 1Wire pin as a low output on the Pi, but the kernel driver owns the pin so its not straight forward.
 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
952
Reaction score
1,281
Location
Edmonton, Canada
Rating - 0%
0   0   0
The bare minimum would be something like this:

1611368441783.png



Sensor power and the pull-up are both controlled by a single PFET. In this design, you could actually skip the PFET and power it directly from a Pi pin, but not preferred. However, this runs the sensor at 3.3V, and some of the cheap sensors really run better at 5V... so this is the bells and whistles version:

1611368728035.png


In this case, a high signal on the Pi Pin will turn on the sensor, and pull-up the 1-wire line via R1.

R2 is to pull the PFET gate up to 5V, which will keep it switched off unless Q2 is turned on. When Q2 is turned on by the high signal from the Pi, the gate of Q1 goes low so it turns on, and R2 limits current to ground.

R3 and C1 are the extra bonus parts - R3 will make sure any charge is bled away from the sensor (it may latch in a very low current state and may take awhile to reset), and C1 is good practice to decouple the power line.

1Wire sensors can be powered parasitically, so it may be valuable to add a large value (100k+) pull-down on the 1Wire bus line at all times. In theory you could do so by simply setting the 1Wire pin as a low output on the Pi, but the kernel driver owns the pin so its not straight forward.

Wow that bells and whistle version looks great, thanks!

I can see when the sensor enable signal is high power makes it way to the sensor and I assume the script would control the signal from that GPIO but how does that reset the bus? Is there a line of code that will report if the bus isn't responding and act accordingly? Is the idea the sensor needs to be unplugged to reset the bus? That's what it looks like this does as the 1wire isn't pulled high anymore and no power to sensor.
 

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 know reef-pi supports the SHT31-D but how about the SHT31? How important is the D? I can't find what that represents. Someone asked me about this sensor but I'm unsure, anyone know? I assume its ok but...

Rob, the SHT31-D I believe is the Adafruit breakout board part number. If you are looking for the part number for the digital chip, it's SHT31-DIS-P2.5KS. They're about 5 bucks on digikey. Careful, they are tiny. about 2.5 mm sq.

A real pain to solder. I had my reflow gun turned almost all the way down on the lowest airflow and it still wanted to blow it all around.
 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
952
Reaction score
1,281
Location
Edmonton, Canada
Rating - 0%
0   0   0
Rob, the SHT31-D I believe is the Adafruit breakout board part number. If you are looking for the part number for the digital chip, it's SHT31-DIS-P2.5KS. They're about 5 bucks on digikey. Careful, they are tiny. about 2.5 mm sq.

A real pain to solder. I had my reflow gun turned almost all the way down on the lowest airflow and it still wanted to blow it all around.

Thanks! I was thinking something like that but wanted to confirm as I'm just passing the info on to someone else. I'm not making anything with them. I have been caught off guard by chip size though, never look at dimensions and well the picture looks big haha.
 

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
1,951
Reaction score
3,353
Location
Sacramento, CA area
Rating - 0%
0   0   0
Wow that bells and whistle version looks great, thanks!

I can see when the sensor enable signal is high power makes it way to the sensor and I assume the script would control the signal from that GPIO but how does that reset the bus? Is there a line of code that will report if the bus isn't responding and act accordingly? Is the idea the sensor needs to be unplugged to reset the bus? That's what it looks like this does as the 1wire isn't pulled high anymore and no power to sensor.
Basically a turn off and on, aka mimic an unplug. The pull-up power is also removed as 1-wire devices are supposed to work on a parasitic mode, powered only by a pull up. A lot of clone sensors can’t be powered like this, but in case a sensor is getting powered... (unlikely if it’s also holding the bus low).

As for detecting this, I recommend a quick script that just reads each sensor, and if it’s failing initiate a reset (off, wait a second, on).
 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
952
Reaction score
1,281
Location
Edmonton, Canada
Rating - 0%
0   0   0
Basically a turn off and on, aka mimic an unplug. The pull-up power is also removed as 1-wire devices are supposed to work on a parasitic mode, powered only by a pull up. A lot of clone sensors can’t be powered like this, but in case a sensor is getting powered... (unlikely if it’s also holding the bus low).

As for detecting this, I recommend a quick script that just reads each sensor, and if it’s failing initiate a reset (off, wait a second, on).
Thanks! Ah so when a bus locks a Pi power cycle isn't required, just need to unplug and reattach all sensors connected? When you referred to a power cycle I thought you meant the Pi not the sensor.
 

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
1,951
Reaction score
3,353
Location
Sacramento, CA area
Rating - 0%
0   0   0
Thanks! Ah so when a bus locks a Pi power cycle isn't required, just need to unplug and reattach all sensors connected? When you referred to a power cycle I thought you meant the Pi not the sensor.

Thats the operating theory. The Pi is basically just using a GPIO with the 1 wire kernel driver - there isn't any hardware state. That doesn't mean the kernel deadlocks somewhere in the driver state machine, but thats a different debugging problem :)
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,056
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I’m curious , can we do this straight on the ds12b20 driver ? When checksum or missing probe is detected, toggle a gpio twice, which in turn cycles the 3.3 v power (using a common non transistor )
 

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
1,951
Reaction score
3,353
Location
Sacramento, CA area
Rating - 0%
0   0   0
> I’m curious , can we do this straight on the ds12b20 driver ? When checksum or missing probe is detected, toggle a gpio twice, which in turn cycles the 3.3 v power (using a common non transistor )

yup!
 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
952
Reaction score
1,281
Location
Edmonton, Canada
Rating - 0%
0   0   0
Thats the operating theory. The Pi is basically just using a GPIO with the 1 wire kernel driver - there isn't any hardware state. That doesn't mean the kernel deadlocks somewhere in the driver state machine, but thats a different debugging problem :)
Well if you think this can help with some cases I think it's worth it, I'm going to add it to my boards and that's awesome Ranjib might work it into the driver. Thanks again for the schematic, I would have never thought the pullup could go to a GPIO, that could be really useful for changing port configuration through software. That'll be useful when I have my dream controller finished in 10 years. :)
 

DanTheReefer

Active Member
View Badges
Joined
Dec 2, 2019
Messages
493
Reaction score
508
Rating - 0%
0   0   0
Hey everyone still seem to be having an issue where my ph calibration button is grayed out and pi is not detecting any readings? Any tips on whether this is probably more a hardware or software config issue?

Figured it out, I hadn't put the EZO in I2C mode
 
Last edited:

Martin Lowry

Community Member
View Badges
Joined
Sep 19, 2017
Messages
60
Reaction score
66
Location
Dover, NH
Rating - 0%
0   0   0
Settings bucket has the Prometheus enabled/disabled option, set it to false and start reef-pi, then update the relevant equipment name and enable Prometheus again
@Ranjib @Tom Bishop

Worked! Awesome! Thanks.
But, I didn't see a settings bucket so I deleted the Fans/Cooler in the equipment bucket and all is well now.
 

brian.badge

Active Member
View Badges
Joined
Apr 19, 2019
Messages
143
Reaction score
79
Rating - 0%
0   0   0
I have 2 heaters in my tank that have internal digital controls. I want to use the heater's internal control as primary and configure reef pi to act as a failsafe. Best situation would be reef pi shutting down the outlets to both at a certain high temp. Looking at the UI it wasn't clear how to accomplish this and my attempts at finding the answer online have bee fruitless. Can anyone point me in the right direction?
Anybody?
 
Back
Top