How does light sleep work?
Posted: Wed Aug 28, 2024 10:15 pm
Hi there,
I am working on a low-power project using the ESP32-C3, where the product will be configurable by the user. As part of this project, I plan to utilize both light sleep and deep sleep modes. During my tests, I observed something interesting about the light sleep mode, and I wanted to clarify my findings.
According to the ESP32-C3 datasheet and the "Sleep Modes" section in the ESP-IDF API references, it is mentioned that Wi-Fi is supposed to disconnect when light sleep is enabled, and the application must manage this. However, in my current implementation, I am using light sleep with periods of less than 60 seconds, without explicitly stopping Wi-Fi or Bluetooth. Surprisingly, I found that Wi-Fi does not disconnect from the Access Point (AP). As a result, when the ESP32 wakes from sleep, it can immediately take sensor data and send it over MQTT, usually within a second. This seems to be very efficient, as I measured the current consumption and found it drops to 130 microamperes, consistent with the datasheet specifications.
This working mode seems quite effective, especially since modem sleep appears to consume more power during sleep periods of around 30 seconds, and deep sleep takes too much time to reinitialize all the peripherals. However, my concern is that this approach is not mentioned or recommended anywhere, and the API reference suggests that the application must stop Wi-Fi and Bluetooth before entering light sleep.
Could this approach cause any issues in the future, or are there any potential risks associated with not explicitly stopping Wi-Fi and Bluetooth before entering light sleep?
Thank you for your time and assistance.
I am working on a low-power project using the ESP32-C3, where the product will be configurable by the user. As part of this project, I plan to utilize both light sleep and deep sleep modes. During my tests, I observed something interesting about the light sleep mode, and I wanted to clarify my findings.
According to the ESP32-C3 datasheet and the "Sleep Modes" section in the ESP-IDF API references, it is mentioned that Wi-Fi is supposed to disconnect when light sleep is enabled, and the application must manage this. However, in my current implementation, I am using light sleep with periods of less than 60 seconds, without explicitly stopping Wi-Fi or Bluetooth. Surprisingly, I found that Wi-Fi does not disconnect from the Access Point (AP). As a result, when the ESP32 wakes from sleep, it can immediately take sensor data and send it over MQTT, usually within a second. This seems to be very efficient, as I measured the current consumption and found it drops to 130 microamperes, consistent with the datasheet specifications.
This working mode seems quite effective, especially since modem sleep appears to consume more power during sleep periods of around 30 seconds, and deep sleep takes too much time to reinitialize all the peripherals. However, my concern is that this approach is not mentioned or recommended anywhere, and the API reference suggests that the application must stop Wi-Fi and Bluetooth before entering light sleep.
Could this approach cause any issues in the future, or are there any potential risks associated with not explicitly stopping Wi-Fi and Bluetooth before entering light sleep?
Thank you for your time and assistance.