Hi,
I am development an application with ESP32-WROOM-32(M103QH2800PH3Q0) - 16 MB. I have a problem when i using the functions esp_light_sleep_start and esp_deep_sleep_start, the board consumes the same mA regardless if i use the function esp_light_sleep_start or the function esp_deep_sleep_start . Why with the esp_deep_sleep_start function it does not consume less compared to the esp_light_sleep_start function ? Can you help me.
I using the follows code :
void sleep_board ( void )
{
/* Wake up in 2 seconds, or when button is pressed */
esp_sleep_enable_timer_wakeup ( TIME_TO_SLEEP * uS_TO_S_FACTOR ) ;
printf ( "Entering in sleep mode.\n" ) ;
/* To make sure the complete line is printed before entering sleep mode,
* need to wait until UART TX FIFO is empty:
*/
uart_tx_wait_idle ( CONFIG_CONSOLE_UART_NUM ) ;
/* Get timestamp before entering sleep */
int64_t t_before_us = esp_timer_get_time ( ) ;
/* Enter sleep mode */
// ! Note : I use or function esp_light_sleep_start or esp_deep_sleep_start !
esp_light_sleep_start ( ) ;
// esp_deep_sleep_start ( ) ;
/* Execution continues here after wakeup */
/* Get timestamp after waking up from sleep */
int64_t t_after_us = esp_timer_get_time ( ) ;
/* Determine wake up reason */
const char * wakeup_reason ;
switch ( esp_sleep_get_wakeup_cause ( ) )
{
case ESP_SLEEP_WAKEUP_TIMER :
wakeup_reason = "timer" ;
break ;
case ESP_SLEEP_WAKEUP_GPIO :
wakeup_reason = "pin" ;
break ;
default :
wakeup_reason = "other" ;
break ;
}
printf ( "Returned from light sleep, reason: %s, t=%lld ms, slept for %lld ms\n" ,
wakeup_reason , t_after_us / 1000 , ( t_after_us - t_before_us ) / 1000 ) ;
vTaskDelay ( 10 / portTICK_PERIOD_MS ) ;
}
Thanks,
Problem with deep and light sleep
Re: Problem with deep and light sleep
Hi gianmarco_scar,
What is the current consumption of the board after you call esp_light_sleep_start?
Normally in light sleep mode you should be seeing 0.8-1.2 mA, and in deep sleep mode it should be 5-10uA depending on the configured wakeup sources.
If you are seeing the current consumption significantly larger than 1mA in light sleep mode, then it is likely the issue with either of:
1. The chip is not actually entering the sleep mode. You can check this by adding some printf statement before entering sleep, and make sure that this line is printed on UART.
2. There is some other component on the board which draws extra current. Can confirm by running the same program on a bare WROOM-32 module, and measuring its current consumption.
3. There is some leakage current from ESP32 IOs. However this current is usually in uA range, and will not cause higher mA readings in light sleep mode.
If you share your board schematics via the customer support channels, we can review it and give additional advice.
What is the current consumption of the board after you call esp_light_sleep_start?
Normally in light sleep mode you should be seeing 0.8-1.2 mA, and in deep sleep mode it should be 5-10uA depending on the configured wakeup sources.
If you are seeing the current consumption significantly larger than 1mA in light sleep mode, then it is likely the issue with either of:
1. The chip is not actually entering the sleep mode. You can check this by adding some printf statement before entering sleep, and make sure that this line is printed on UART.
2. There is some other component on the board which draws extra current. Can confirm by running the same program on a bare WROOM-32 module, and measuring its current consumption.
3. There is some leakage current from ESP32 IOs. However this current is usually in uA range, and will not cause higher mA readings in light sleep mode.
If you share your board schematics via the customer support channels, we can review it and give additional advice.
Re: Problem with deep and light sleep
Thanks for noticing boarchuz! Have edited my post.
Who is online
Users browsing this forum: Baldhead and 98 guests