Does the Light-sleep function disable the wifi radio?

MMliam
Posts: 11
Joined: Thu Aug 04, 2022 12:31 am

Does the Light-sleep function disable the wifi radio?

Postby MMliam » Wed Oct 12, 2022 4:48 pm

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.
Attachments
Sleep-Mode Table.JPG
Sleep-Mode Table.JPG (38.98 KiB) Viewed 3598 times

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

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

Postby ESP_igrr » Wed Oct 12, 2022 9:46 pm

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)

MMliam
Posts: 11
Joined: Thu Aug 04, 2022 12:31 am

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

Postby MMliam » Wed Oct 12, 2022 11:44 pm

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.

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

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

Postby ESP_igrr » Thu Oct 13, 2022 6:44 am

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.

MMliam
Posts: 11
Joined: Thu Aug 04, 2022 12:31 am

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

Postby MMliam » Sat Oct 15, 2022 2:56 pm

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

Who is online

Users browsing this forum: Google [Bot] and 89 guests