-
-
Notifications
You must be signed in to change notification settings - Fork 347
Description
It has been noted #2977 (comment) that pinging Esp32 devices running Sming are much less responsive than, say, the Esp8266. Turns out this is because by default the Esp32 WiFi modem is configured to a 'light' power saving mode.
The Esp32 SDK provides an SDK call esp_wifi_set_ps(WIFI_PS_NONE); which massively improves ping responses. The call has three options (OFF WIFI_PS_NONE, MIN WIFI_PS_MIN_MODEM and MAX WIFI_PS_MAX_MODEM).
The Raspberry Pi Pico W (CYW43) WiFi API defines has similar power-saving control via cyw43_wifi_pm(), but with far more flexibility. Three presets are OFF CYW43_NONE_PM, MIN CYW43_PERFORMANCE_PM, MAX CYW43_AGGRESSIVE_PM which seem roughly analogous to the Esp32 ones.
The Esp8266 is much more crude in operation and requires application interaction, so there doesn't appear to be any automatic 'modem sleep' available.
I've opened this issue to make developers aware of this issue, and also perhaps to consider whether we might add a more generic API to Sming to support power saving. This would be entirely optional and advanced use-cases could just use the SDK calls. There are some potential complexities with this:
- Should we set Esp32 power saving be set to NONE by default?
- Do we need to track power saving mode state in case it's reset by reconfiguring WiFi or turning it off then on again?