Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions ports/espressif/common-hal/wifi/Radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,16 @@ void common_hal_wifi_radio_set_enabled(wifi_radio_obj_t *self, bool enabled) {
#endif
self->started = true;
common_hal_wifi_radio_set_tx_power(self, CIRCUITPY_WIFI_DEFAULT_TX_POWER);
#ifdef CONFIG_ESP_HOSTED_ENABLED
// Temporary workaround: default to no power save on ESP-Hosted co-processors.
//
// With some APs, inbound traffic stalls in MIN_MODEM power save. A likely cause is
// the ESP32-C6 missing broadcast and ARP frames from the AP in power save.
// TODO: Remove when fixed upstream.
// https://github.com/espressif/esp-idf/issues/16096
// https://github.com/adafruit/circuitpython/issues/11682
esp_wifi_set_ps(WIFI_PS_NONE);
#endif
return;
}
}
Expand Down
7 changes: 7 additions & 0 deletions shared-bindings/wifi/Radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,15 @@ MP_PROPERTY_GETSET(wifi_radio_tx_power_obj,
(mp_obj_t)&wifi_radio_get_tx_power_obj,
(mp_obj_t)&wifi_radio_set_tx_power_obj);

// TODO: Remove the ESP-Hosted exception below when the upstream bug is fixed.
// https://github.com/espressif/esp-idf/issues/16096
// https://github.com/adafruit/circuitpython/issues/11682
//| power_management: PowerManagement
//| """Wifi power management setting. See `wifi.PowerManagement`. The default is `wifi.PowerManagement.MIN`.
//|
//| On Espressif boards whose WiFi runs on an ESP-Hosted co-processor, such as the Metro ESP32-P4,
//| the default is `wifi.PowerManagement.NONE`. This is a temporary workaround for a bug in power
//| save mode; see `#11682 <https://github.com/adafruit/circuitpython/issues/11682>`_.
//| """
static mp_obj_t wifi_radio_get_power_management(mp_obj_t self_in) {
wifi_radio_obj_t *self = MP_OBJ_TO_PTR(self_in);
Expand Down
Loading