I am running into an issue with Inter-ESPEasy UDP packet drops. About 1 in 20 SendTo commands get dropped.
This is my setup:
- 5 ESP8266 (Wemos D1 minis) in Inter-ESPEasy Network, controlling 10 roller shades
- each ESP controls 2 roller shade motors, the Wemos board is powered via buck converter from the motor's 12V supply
- unit 0 in the network is the master, and accepts events like "All_Up", "All_Down" from an external client via http
- it then relays those events to the individual units in the network via sendTo events like "unit1_up", "unit2_up", etc.
I am not sure yet, what causes the packet drop. I could think of:
- WIFI interference from the running motors - I think I ruled this out, as I added a delay between UDP communication and starting the motors.
- WIFI instability due to power issues, although the buck converter has a 220uF capacitor on the 5V side
- unstable core library - I found with ESPEasy builds post 2018 wifi got more unstable in general
I did enable the "Gratuitous ARP" option. What seems to help is to simply execute all sendTo commands twice.
So my question: Is there a way to increase reliability of sendTo? 5% packet drop seems high to me.
A TCP based ESPEasy network would be nice.
I was also thinking about using SendToHTTP since it is TCP based - but how do I find the IP addresses of all the units
in the ESPEasy network? The main config page lists the IP addresses of all detected units, is there a way to access those
in variables from rules?
sendTo UDP reliability
Moderators: grovkillen, Stuntteam, TD-er
Re: sendTo UDP reliability
You didn't say which ESPEasy version you're running. That's usually an important thing to know.
- Thomas
I believe unit 0 (and 255) numbering should be avoided. Anything in between those values is OK.- unit 0 in the network is the master, and {snip}
Yes, stability was horrible from mid-2018 to Early 2020. Constant reboots and lost WiFi connections. But the recent Mega releases are very stable, thank goodness. So upgrade all the nodes if you're running an older release.I found with ESPEasy builds post 2018 wifi got more unstable in general
- Thomas
Re: sendTo UDP reliability
As ThomasB already stated, unit numbers 0 and 255 should not be used.
UDP is by definition an 'unreliable' protocol, in that is doesn't guarantee the message will actually be delivered. It's Fire & Forget.mrh_icb wrote: ↑08 Nov 2020, 02:43 I am not sure yet, what causes the packet drop. I could think of:
- WIFI interference from the running motors - I think I ruled this out, as I added a delay between UDP communication and starting the motors.
- WIFI instability due to power issues, although the buck converter has a 220uF capacitor on the 5V side
- unstable core library - I found with ESPEasy builds post 2018 wifi got more unstable in general
So my question: Is there a way to increase reliability of sendTo? 5% packet drop seems high to me.
If available you could use an oscilloscope to inspect the actual 'steadyness' of the power provided to the ESP, don't forget to measure the dc voltage either, anything below 5V may cause less reliable working of WiFi on the Wemos's, especially those sourced directly from China.
Packet loss/network stability is related to the load of the ESP's and the network. If your network is very busy and the load of the (receiving) ESP is quite high, it is not uncommon to loose that percentage of UDP messages, but it could be lower. Signal strength may also be a factor here, low signal strength/quality will make UDP less reliable.
I've given my ESP's the same unit number as the 4th part of the (fixed) IP address, so this would be quite easy for me to implement, AFAIK there is no way to lookup the IP address of a unit, but you can ofcourse use UDP to send an event (twice?) to the receiving ESP to return the 4th part of their IP address (%ip4%) to the master ESP (send the %ip4% of the master as an argument where it should be returned for better reliability), store them either in an internal variable using let or a Dummy device using TaskValueSet (easier to monitor), so you can then send the payload using SendToHTTP.mrh_icb wrote: ↑08 Nov 2020, 02:43 A TCP based ESPEasy network would be nice.
I was also thinking about using SendToHTTP since it is TCP based - but how do I find the IP addresses of all the units
in the ESPEasy network? The main config page lists the IP addresses of all detected units, is there a way to access those
in variables from rules?
/Ton (PayPal.me)
Who is online
Users browsing this forum: No registered users and 109 guests