← index #8941PR #8993
Related · high · value 5.648
QUERY · ISSUE

Support config("pm")

openby peterharperukopened 2022-07-21updated 2022-07-21
enhancement

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.

CANDIDATE · PULL REQUEST

ports/esp32-esp8266: Add support for set/get the wifi power saving mode.

mergedby glenn20opened 2022-07-31updated 2023-05-11
port-esp8266port-esp32

This PR adds support for setting and getting the wifi power saving mode.

Adds the pm option to WLAN.config() to support setting/getting the wifi power saving mode.

Also adds the PM_NONE, PM_MIN_MODEM and PM_MAX_MODEM constants to the WLAN class.

Example:

import network
sta = network.WLAN(0); sta.active(True)
sta.connect(ssid, password)
sta.config(pm=sta.PM_NONE)

This is especially useful for controlling power consumption on battery powered devices and is also required by PR #6515 (ESPNow support).

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied