Support config("pm")
Currently I can set the power management value for wlan (network cyw43) with the config function. But I can't query the current value. It would be useful to be able to do this for debugging.
applies to network cyw43 wifi
Requires a change to the driver https://github.com/georgerobotics/cyw43-driver/pull/8
I will push a change.
ports/esp32: Set ESPNow power management with ESPNow.config(pm=).
Control power management of the wifi radio during ESPNOW operation.
Control the ESPNOW power management parameters with the ESPNow.config(pm=(window, interval)).
These settings are used whenever the module is disconnected from a wifi Access Point. While connected to a wifi AP, the wifi power management settings will be used instead (WLAN.config(pm=WLAN.PM_POWERSAVE)).
Usage:
e.config(pm=(75, 200))sets the wake_window to 75ms and the wake_interval to 200ms, ie: turn on the radio for 75ms every 200ms (equivalent toWLAN.config(pm=WLAN.PM_PERFORMANCE))e.config(pm=(75, 300))sets the wake_window to 75ms and the wake_interval to 300ms (equivalent toWLAN.config(pm=WLAN.PM_POWERSAVE))
By default, when disconnected from a wifi Access Point the radio is left on continuously which may lead to undesirable power drain of battery operated devices. IDF v5.0 has introduced the esp_now_set_wake_window() and esp_wifi_connectionless_module_set_wake_interval() to control the duty cycle of the radio for listening to incoming messages while not connected to an AP.
For the results of some power consumption tests, see: https://github.com/glenn20/upy-esp32-experiments/tree/main/ESPNowPowerManagement.