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

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
2,253
Reaction score
3,603
Location
Sacramento, CA area
Rating - 0%
0   0   0
I believe clock stretching is still an issue. I'm using the ATtiny85 for my pH circuit and due to problems with Pi I have the I2C bus slowed down to 10kHz. I don't see that as bad though unless I'm wrong in assuming a slower speed makes things more reliable overall? It would appear so as you need to slow down as cable is added.

Slower is fine, but it may not help in all cases as the points various controllers sample doesn’t get any slower - they are still gated by rise and fall time. If it’s to allow a slow controller to poke out the next byte, it helps.

What commonly kills I2C is bus capacitance - too much cable and load means the rise and fall times can’t be met. You can mitigate rise time with stronger pull-ups (I tend to use 2.2k), but fall time is all up to the chips driving the bus.
 

robsworld78

Valuable Member
View Badges
Joined
Feb 14, 2020
Messages
1,029
Reaction score
1,293
Location
Edmonton, Canada
Rating - 0%
0   0   0
Slower is fine, but it may not help in all cases as the points various controllers sample doesn’t get any slower - they are still gated by rise and fall time. If it’s to allow a slow controller to poke out the next byte, it helps.

What commonly kills I2C is bus capacitance - too much cable and load means the rise and fall times can’t be met. You can mitigate rise time with stronger pull-ups (I tend to use 2.2k), but fall time is all up to the chips driving the bus.
Back when I was trying to solve this I could clearly see on the I2C analyzer that the time for the overall transmission was much longer than at 100kHz which on a busy bus could be a problem but the time between each byte was increased so I figured that would help the master read it in iffy conditions but yeah as it's about rise, fall and edge probably doesn't help. Since I've seen that I've always recommended a person to slow down the bus no matter if required or not thinking that would help with "lost" bytes.
 

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
2,253
Reaction score
3,603
Location
Sacramento, CA area
Rating - 0%
0   0   0
Back when I was trying to solve this I could clearly see on the I2C analyzer that the time for the overall transmission was much longer than at 100kHz which on a busy bus could be a problem but the time between each byte was increased so I figured that would help the master read it in iffy conditions but yeah as it's about rise, fall and edge probably doesn't help. Since I've seen that I've always recommended a person to slow down the bus no matter if required or not thinking that would help with "lost" bytes.
This may be interesting:


Note the rise time maximums are 1000ns in standard mode - they won’t generally scale with the clock, as it’s not known to devices what the clock is.
The inductive undershoot is also relevant for systems with a lot of wire.
 

Simonv92

Active Member
View Badges
Joined
Oct 21, 2014
Messages
161
Reaction score
104
Location
Italy
Rating - 0%
0   0   0
I all! I'm thinking about using an Rpi Zero 2 (when I'll be able to find it :eek:) to run reef-pi.
I was thinking to add an ethernet port to my Rpi (as you know, cable is always better...). I've seen several guides in which is always use an ENC25J60 module.
This is a quite old 10Mbit Ethernet module, already in production by Microchip. Do you think it'll be ok or do I need to search for something more powerful in terms of speed (even if the limit is the SPI bus)?
I really don't want to use an Rpi 3 or more to run such a lightweight software, I've done some test with an Rpi Zero 1 and it seems to work fine so I'll use a Zero in the final version...
Any advice is appreciated! :)
 

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
2,253
Reaction score
3,603
Location
Sacramento, CA area
Rating - 0%
0   0   0
I all! I'm thinking about using an Rpi Zero 2 (when I'll be able to find it :eek:) to run reef-pi.
I was thinking to add an ethernet port to my Rpi (as you know, cable is always better...). I've seen several guides in which is always use an ENC25J60 module.
This is a quite old 10Mbit Ethernet module, already in production by Microchip. Do you think it'll be ok or do I need to search for something more powerful in terms of speed (even if the limit is the SPI bus)?
I really don't want to use an Rpi 3 or more to run such a lightweight software, I've done some test with an Rpi Zero 1 and it seems to work fine so I'll use a Zero in the final version...
Any advice is appreciated! :)

Attach Ethernet to the USB port.

Its how every Pi has it attached that isn't the Zero :)
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,409
Reaction score
1,726
Location
Missouri
Rating - 0%
0   0   0
I all! I'm thinking about using an Rpi Zero 2 (when I'll be able to find it :eek:) to run reef-pi.
I was thinking to add an ethernet port to my Rpi (as you know, cable is always better...). I've seen several guides in which is always use an ENC25J60 module.
This is a quite old 10Mbit Ethernet module, already in production by Microchip. Do you think it'll be ok or do I need to search for something more powerful in terms of speed (even if the limit is the SPI bus)?
I really don't want to use an Rpi 3 or more to run such a lightweight software, I've done some test with an Rpi Zero 1 and it seems to work fine so I'll use a Zero in the final version...
Any advice is appreciated! :)
Eh I would just go wireless, if you really want to go wired I would go with a model that has a fixed ethernet port on it. I'm sure you can get it to work with some usb adapter but i've not had any issues with the wireless units they have been solid.
 

Simonv92

Active Member
View Badges
Joined
Oct 21, 2014
Messages
161
Reaction score
104
Location
Italy
Rating - 0%
0   0   0
Attach Ethernet to the USB port.

Its how every Pi has it attached that isn't the Zero :)
Thank you very much! I'm planning to build a pcb with the Rpi Zero mounted on it. So I really want something that I could integrate on my pcb. I've seen some solution based on RTL8152 chip from Realtek but I couldn't find any official schematic...
In this way I can mount my Rpi without any cable connected and use pogopin to touch the usb pad under the board...
 

Simonv92

Active Member
View Badges
Joined
Oct 21, 2014
Messages
161
Reaction score
104
Location
Italy
Rating - 0%
0   0   0
I think that the easiest solution will be to go wireless..
Just for knowledge, do you think that a 10Mbit ethernet connection can cause any trouble in normal usage of reef-pi? I don't think that there is so much activity on network...
 

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
2,253
Reaction score
3,603
Location
Sacramento, CA area
Rating - 0%
0   0   0
Thank you very much! I'm planning to build a pcb with the Rpi Zero mounted on it. So I really want something that I could integrate on my pcb. I've seen some solution based on RTL8152 chip from Realtek but I couldn't find any official schematic...
In this way I can mount my Rpi without any cable connected and use pogopin to touch the usb pad under the board...

If you want to go down this route, see if you can source a compute module (CM4).

Pogo pins to the USB connector isn't the worst idea, but its easier to just align a super short cable IMO.
 

GaryE

Well-Known Member
View Badges
Joined
Mar 12, 2020
Messages
992
Reaction score
1,321
Location
Coatesville, Indiana
Rating - 0%
0   0   0
Made progress on this board.. most things work properly now. The dosing control is still not quite there.. Don't really need it on the tank this is on though.


1644767693063.png


This has a DS18B20 on board for internal box temp, controls a fan on the cover. On the left you can see my sht31d breakout board that gets my room temp / humidity. Bottom right is 24v input power. Bottom left is one of the tank temp sensors, the other one is on the bottom right below the two PWM driven Chinese black box lights. the middle two two wire connectors are powering 24v actinic led bars. they run on an interval schedule so they are on in the AM and PM only.


There were a few issues with this board once I got it populated that needed to be addressed. The main issue was powering the pca9685 with 5v. That and the one wire connectors for temp sensing were on that power rail. I had to scab in a jumper to power them on 3.3v. Then there were various solder joints that were bad.

The 3.3v issue and the issues causing the dosing to not function have been resolved in the next revision of the board.

I should have that one in the next few weeks. Once I'm able to source parts, I will be able to let these out into the wild.


Here's a graph of everything from this install: (the black out on the right is from having it down today to put the new board in place.)

1644769275950.png
 
Last edited:
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Made progress on this board.. most things work properly now. The dosing control is still not quite there.. Don't really need it on the tank this is on though.


1644767693063.png


This has a DS18B20 on board for internal box temp, controls a fan on the cover. On the left you can see my sht31d breakout board that gets my room temp / humidity. Bottom right is 24v input power. Bottom left is one of the tank temp sensors, the other one is on the bottom right below the two PWM driven Chinese black box lights. the middle two two wire connectors are powering 24v actinic led bars. they run on an interval schedule so they are on in the AM and PM only.


There were a few issues with this board once I got it populated that needed to be addressed. The main issue was powering the pca9685 with 5v. That and the one wire connectors for temp sensing were on that power rail. I had to scab in a jumper to power them on 3.3v. Then there were various solder joints that were bad.

The 3.3v issue and the issues causing the dosing to not function have been resolved in the next revision of the board.

I should have that one in the next few weeks. Once I'm able to source parts, I will be able to let these out into the wild.


Here's a graph of everything from this install: (the black out on the right is from having it down today to put the new board in place.)

1644769275950.png
looking good. the graphs will look much better as time pass. This is state of the art observability (grafana+prometheus)
 

waynel

Active Member
View Badges
Joined
May 22, 2020
Messages
266
Reaction score
257
Location
Kentucky
Rating - 0%
0   0   0
the Zero W (version 1) is just fine.. Zero 2 W is a bit faster..
I have the zero w ( don't know what version), and want to enable remote access with vnc (so I can access it over the internet from anywhere). The one I have is not fast enough to do this. Which rpi is recommended for this?
 

GaryE

Well-Known Member
View Badges
Joined
Mar 12, 2020
Messages
992
Reaction score
1,321
Location
Coatesville, Indiana
Rating - 0%
0   0   0
I have the zero w ( don't know what version), and want to enable remote access with vnc (so I can access it over the internet from anywhere). The one I have is not fast enough to do this. Which rpi is recommended for this?
I wouldn't run an GUI on the Zero.. Rpi 3 or 4 are fine for GUI though.

You can SSH into the zero with out issue..
 

ColoredRock

Well-Known Member
View Badges
Joined
Aug 9, 2021
Messages
856
Reaction score
976
Location
Murrieta, CA (North of San Diego)
Rating - 0%
0   0   0
Made progress on this board.. most things work properly now. The dosing control is still not quite there.. Don't really need it on the tank this is on though.


1644767693063.png


This has a DS18B20 on board for internal box temp, controls a fan on the cover. On the left you can see my sht31d breakout board that gets my room temp / humidity. Bottom right is 24v input power. Bottom left is one of the tank temp sensors, the other one is on the bottom right below the two PWM driven Chinese black box lights. the middle two two wire connectors are powering 24v actinic led bars. they run on an interval schedule so they are on in the AM and PM only.


There were a few issues with this board once I got it populated that needed to be addressed. The main issue was powering the pca9685 with 5v. That and the one wire connectors for temp sensing were on that power rail. I had to scab in a jumper to power them on 3.3v. Then there were various solder joints that were bad.

The 3.3v issue and the issues causing the dosing to not function have been resolved in the next revision of the board.

I should have that one in the next few weeks. Once I'm able to source parts, I will be able to let these out into the wild.


Here's a graph of everything from this install: (the black out on the right is from having it down today to put the new board in place.)

1644769275950.png
Do you guys mind sharing your query on equipment status... im a bone head.. and missing something.
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,409
Reaction score
1,726
Location
Missouri
Rating - 0%
0   0   0
I have the zero w ( don't know what version), and want to enable remote access with vnc (so I can access it over the internet from anywhere). The one I have is not fast enough to do this. Which rpi is recommended for this?

I wouldn't run an GUI on the Zero.. Rpi 3 or 4 are fine for GUI though.

You can SSH into the zero with out issue..

This is just my opinion and I am sure lots of folks do certain things but I would never open anything on my local network to the internet at large. I am probably biased since Cyber security is my day job but I would never recommend doing that. If you want or have a need for remote access look into getting a router that supports a vpn of some sort, or some sort of Reverse proxy feature like https://guacamole.apache.org/ but depending on your level getting a replacement router that supports a vpn might be the easiest.

again just my .02 :)
 

waynel

Active Member
View Badges
Joined
May 22, 2020
Messages
266
Reaction score
257
Location
Kentucky
Rating - 0%
0   0   0
This is just my opinion and I am sure lots of folks do certain things but I would never open anything on my local network to the internet at large. I am probably biased since Cyber security is my day job but I would never recommend doing that. If you want or have a need for remote access look into getting a router that supports a vpn of some sort, or some sort of Reverse proxy feature like https://guacamole.apache.org/ but depending on your level getting a replacement router that supports a vpn might be the easiest.

again just my .02 :)
I was looking at doing the realvnc cloud based solution, nothing to open on the router or firewalls and uses 2fa and I've changed all default passwords. Any thoughts or suggestions on this approach? Having the remote access back to monitor and make some changes as needed would be useful.
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,409
Reaction score
1,726
Location
Missouri
Rating - 0%
0   0   0
I was looking at doing the realvnc cloud based solution, nothing to open on the router or firewalls and uses 2fa and I've changed all default passwords. Any thoughts or suggestions on this approach? Having the remote access back to monitor and make some changes as needed would be useful.
What that means based on how you have described it then realvnc is hosting a connection in the cloud that you connect to. In other words, it establishes an outbound active connection from the deivce and then you connect to it from a remote session. I would think then it comes down to how much you trust that cloud based service, im old and untrustworthy of most cloud based stuff but thats just me. I'd rather be in control of my security vs some service, but again thats just me. There are many firewalls out there that will let you do a VPN connection which I would consider a better solution but just my opinion.

Eh...get off my lawn...;)
 

TOP 10 Trending Threads

WHAT AMOUNT OF LIVE ROCK AND SAND SHOULD BE PRIORITIZED FOR OPTIMAL BIODIVERSITY/FILTRATION?

  • 100% live rock + bagged sand

    Votes: 38 27.3%
  • 100% dry rock + 100% live sand

    Votes: 47 33.8%
  • 50/50 live/dry rock, 50/50 live/bagged sand

    Votes: 30 21.6%
  • 75% live rock, 25% live sand

    Votes: 14 10.1%
  • 25% live rock, 75% live sand

    Votes: 10 7.2%
Back
Top