WLED icon indicating copy to clipboard operation
WLED copied to clipboard

No Disable WiFi sleep creates slow updates in Hyperion

Open sansillusion opened this issue 5 years ago • 8 comments

Hi, thanks again !

I have had no issues with my two esp32 with wled since I disabled current limiting in led setting. So I decided to remove the "Disable WiFi sleep" setting in wifi to see if I had crashes without it. I did not but I noticed that my Hyperion setup was very lagging, took me a while of debugging until I realized it might be that.

As soon that I check the checkbox and saved settings my Hyperion runs ultra smooth. Not really a bug but if someone else is having issues with very stiff/lagging wifi updates it's a good thing to try since it fixes all lags I get even with home assistant or plain web interface too.

sansillusion avatar Sep 04 '20 00:09 sansillusion

Interesting, thank you for the insight!

My suspicion is that the sleep mode is too aggressive and will kick in way too early so that the module is in a continuous wake/sleep cycle. That is all good for occasional transmissions, but with realtime there is indeed a potential that wifi retransmissions become necessary or packets get dropped entirely which obviously causes lag.

Aircoookie avatar Sep 04 '20 09:09 Aircoookie

Yes sounds like exactly what's happening. If you want I can make a video to show the "huge" difference. But just so others know it's soooo smooth without sleep mode that it makes a world of difference on real-time reception.

sansillusion avatar Sep 04 '20 17:09 sansillusion

I know this is old, but I had been plagued with connectivity issues to my two Dig Quad deployments with ESP32 boards. For the most part, things would be OK, but I would see dropouts and laggy performance all the time. Ping times would be all over the place (50ms then 700ms, then 300ms etc) and I would see periodic "No Reply" messages. I recently upgraded to the latest version of the Dig Uno with the external antenna thinking it was a wifi connectivity issue. When I still experienced the same issues, I dug deeper. As soon as I enabled "Disable WiFi Sleep", my issues went away. Ping times are now consistently under 5ms and everything is responding well.

kenlasko avatar Jun 03 '21 20:06 kenlasko

I personally think the default should be wifi sleep disabled. I am sure most wled setup rnu on power supplies anyway. and it would be easy to change for a battery setup.

sansillusion avatar Jun 03 '21 20:06 sansillusion

I will set the new default to disabled on ESP32 and enabled on ESP8266. On 8266, it quarters the power draw while there is a lot less decrease on ESP32. Considering these issues on 32, I believe the benefits of disabling it by default outweight the drawback of maybe saving a tiny bit of power.

Aircoookie avatar Jun 07 '21 22:06 Aircoookie

I agree, and it still remains an option so if someone has the need for it, it can still be enabled.

sansillusion avatar Jun 08 '21 02:06 sansillusion

WiFi sleep will force AP to queue UDP packets (as discovered by @willmmiles) and as such will interfere with any UDP broadcast (i.e. Hyperion).

blazoncek avatar Jun 23 '24 09:06 blazoncek

We might consider adding an "auto" mode to wifi sleep that leaves it on normally, but disables it when any UDP sync mode is active. It won't fix 100% of cases (since every node has to disable sleep to avoid having the AP buffer multicast packets) but it might cut back on the number of support cases.

I can sketch a PR when I get tired of fighting PWM issues ;)

willmmiles avatar Jun 23 '24 14:06 willmmiles