Page 1 of 1

Does the Light-sleep function disable the wifi radio?

Posted: Wed Oct 12, 2022 4:48 pm
by MMliam
According the the specification (see attached table image) current draw during light-sleep should max out at about 2ma. For this low current draw the wifi radio must be disabled. Does this occur as part of the light-sleep function call, or must the wifi radio be disabled prior to calling the light-sleep function.

Re: Does the Light-sleep function disable the wifi radio?

Posted: Wed Oct 12, 2022 9:46 pm
by ESP_igrr
According to the documentation (https://docs.espressif.com/projects/esp ... leep-modes), Wi-Fi and BT should be stopped before calling esp_light_sleep_start.

(Note that there is also an "automatic light sleep" feature which allows maintaining Wi-Fi connection and entering light sleep during the idle periods. It is described in https://docs.espressif.com/projects/esp ... ement.html)

Re: Does the Light-sleep function disable the wifi radio?

Posted: Wed Oct 12, 2022 11:44 pm
by MMliam
From the referenced document:
In Deep-sleep and Light-sleep modes, the wireless peripherals are powered down. Before entering Deep-sleep or Light-sleep modes, the application must disable Wi-Fi and Bluetooth using the appropriate calls (i.e., esp_bluedroid_disable(), esp_bt_controller_disable(), esp_wifi_stop()). Wi-Fi and Bluetooth connections will not be maintained in Deep-sleep or Light-sleep mode, even if these functions are not called.
There seems to be some confusion between "powered down" and "disabled".
As the first sentence says
the wireless peripherals are powered down
Just entering Light-sleep, (or Deep-sleep) will power down the radio, but good practice is to disable the interface, prior to "power down", but as the last sentence says
Wi-Fi and Bluetooth connections will not be maintained in Deep-sleep or Light-sleep mode, even if these functions are not called.
.
Whether you disable or not the connections won't be maintained; the radio is powered down.

The way this reads to me, and the table indicates, just entering light, or deep sleep will power down the radio.

Re: Does the Light-sleep function disable the wifi radio?

Posted: Thu Oct 13, 2022 6:44 am
by ESP_igrr
The problem is that if esp_wifi_stop is not called, the connection to the AP would not be shut down gracefully, which may cause issues (slow down) with the subsequent reconnection.
Also some analog circuits in the chip might not be brought into the default state unless esp_wifi_stop is called, which would lead to some amount of leakage after the power-down.

Re: Does the Light-sleep function disable the wifi radio?

Posted: Sat Oct 15, 2022 2:56 pm
by MMliam
It still appears, according to the Espressif spec graceful shutdown should be part of Light-sleep, or Deep-sleep.

As I use microPython, would the equivalent of "esp_wifi_stop" be net.active(false) [where "net" is a user instance of a network object]?

BTW: I'm not actually using wifi connections, I'm using Espressif's ESPNow protocol that does use the wifi radio. The connect/send/response turnaround time is 25ms.

MM