sockets communication btwn 2 ESP32's ?
Posted: Sun Jul 26, 2020 7:45 pm
Ok so,
I have built a display unit consisting of two columns of 32 leds each (an East column & a West column). 64 LEDS total, which are connected to an ESP32 via a MAX7219 display driver.
I have uPython code to light a single LED anywhere in each stack depending on a East or West variable ranging in value 0 - 4096.
I have two linear taper 10k ohm potentiometers connected to the ESP32's at ADC pins 34 & 35, which create the values of the above variables.
I can dial the pots end to end and achieve an analogous single lit LED, positioned in the appropriate E / W display stack.
VIDEO
I have a means of mechanically linking the rotation of the pots to my 2 garage doors East & West.
The plan is to use this display to indicate the real time position of each of my garage doors. (Yes I realize its overkill and a simple pair of closed / open lights would be sufficient, but wtf, I'm retired, what else is worth doing?)
I want the display to be remote from the garage, say in the kitchen, so that we can know where each garage door is without having to go to the garage to look.
My plan is to use a second ESP32 to read the pots and then relay the positonal data to the display ESP32 via some wifi protocol.
I am drawing a blank however on the best way to achieve this part and the usual googling around doesn't seem to be turning up the golden nuggets I need to proceed on my own. It seems to me that UDP communications might be sufficient but bluetooth (distance?), espNOW (uPython support?) also suggest themselves as does TCP. (Even MQTT might be a contender but it seems a stretch to me as I don't have a broker running locally and don't want to be dependent on cloud resources.)
Also seems to me that I'd like to have the ESP32 at the garage 'push' the data to the display unit and not have the display blindly initiating the data transactions. Also, to minimize net traffic, I'd like things to go quiet, unless a change in garage door position is detected. Although an "I'm still here" watchdog indicator at the display end might be useful to keep me assured that the units are still in good with each other. (and my OCD at bay)
I am not well versed in the use of sockets to achieve this and I'd like to hear some suggestions from the experts on how best to proceed. I need to extend the envelope of my learning curve a bit here, which is the whole point of this project really. So, you experts . . . .
Your thoughts?
Thanks, cheers and good health!
Brian H.
Uxbridge Ont Canada
I have built a display unit consisting of two columns of 32 leds each (an East column & a West column). 64 LEDS total, which are connected to an ESP32 via a MAX7219 display driver.
I have uPython code to light a single LED anywhere in each stack depending on a East or West variable ranging in value 0 - 4096.
I have two linear taper 10k ohm potentiometers connected to the ESP32's at ADC pins 34 & 35, which create the values of the above variables.
I can dial the pots end to end and achieve an analogous single lit LED, positioned in the appropriate E / W display stack.
VIDEO
I have a means of mechanically linking the rotation of the pots to my 2 garage doors East & West.
The plan is to use this display to indicate the real time position of each of my garage doors. (Yes I realize its overkill and a simple pair of closed / open lights would be sufficient, but wtf, I'm retired, what else is worth doing?)
I want the display to be remote from the garage, say in the kitchen, so that we can know where each garage door is without having to go to the garage to look.
My plan is to use a second ESP32 to read the pots and then relay the positonal data to the display ESP32 via some wifi protocol.
I am drawing a blank however on the best way to achieve this part and the usual googling around doesn't seem to be turning up the golden nuggets I need to proceed on my own. It seems to me that UDP communications might be sufficient but bluetooth (distance?), espNOW (uPython support?) also suggest themselves as does TCP. (Even MQTT might be a contender but it seems a stretch to me as I don't have a broker running locally and don't want to be dependent on cloud resources.)
Also seems to me that I'd like to have the ESP32 at the garage 'push' the data to the display unit and not have the display blindly initiating the data transactions. Also, to minimize net traffic, I'd like things to go quiet, unless a change in garage door position is detected. Although an "I'm still here" watchdog indicator at the display end might be useful to keep me assured that the units are still in good with each other. (and my OCD at bay)
I am not well versed in the use of sockets to achieve this and I'd like to hear some suggestions from the experts on how best to proceed. I need to extend the envelope of my learning curve a bit here, which is the whole point of this project really. So, you experts . . . .
Your thoughts?
Thanks, cheers and good health!
Brian H.
Uxbridge Ont Canada