Automatic Light Sleep

mtaz78
Posts: 14
Joined: Thu Nov 23, 2023 3:32 pm

Automatic Light Sleep

Postby mtaz78 » Tue Apr 09, 2024 9:26 am

Hi,
I am trying to implement automatic light sleep, I have followed all the indications in the ble/power_save example and the instructions in this discussion:

https://github.com/espressif/esp-idf/is ... -500312453.

Unfortunately I have a consumption that is about three times as high as with 'forced' light sleep. I have tried both ESP32S3 with main xtal and ESP32 with crystal. The connection and adv intervals are set at 800ms.

This is the output I receive with the command:

Code: Select all

esp_pm_dump_locks(stdout)
Screenshot (74).png
Screenshot (74).png (44.12 KiB) Viewed 1091 times
From this dump it would appear that the chip is sleeping, so what could be the reason for this high consumption?

I also tried to get the reason for waking up and I get 'timer' rather than 'bt'.

Thanks in advance.

MicroController
Posts: 1725
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Automatic Light Sleep

Postby MicroController » Tue Apr 09, 2024 10:03 am

mtaz78 wrote:
Tue Apr 09, 2024 9:22 am
what could be the reason for this high consumption?
https://docs.espressif.com/projects/esp ... fore-sleep:
FreeRTOS will enter light sleep mode if no tasks need to run for this number of ticks.
i.e. it will likely sleep less than in 'manual' mode because it doesn't go to sleep when it knows in advance it won't be sleeping for longer than 2 (min.) - 3 (default) ticks.

mtaz78
Posts: 14
Joined: Thu Nov 23, 2023 3:32 pm

Re: Automatic Light Sleep

Postby mtaz78 » Tue Apr 09, 2024 12:59 pm

Hi MicroController,

thank you for your answer.

Sorry I wasn't clear, I meant that when it sleeps, with automatic light sleep, the power consumption is higher than when it sleeps with manual light sleep, I'm not talking about total time sleeping or total consumption. I am only referring to power consumption during the sleep phase.

MicroController wrote: i.e. it will likely sleep less than in 'manual' mode because it doesn't go to sleep when it knows in advance it won't be sleeping for longer than 2 (min.) - 3 (default) ticks.
From the dump it looks like it sleeps, in fact having set the FreeRTOS ticks rate to 100Hz, in theory it should sleep after 3 ticks (30ms) idle, and since the ble connection interval is 800ms, it will surely sleep for more than 30ms (you can see light_sleep_rejected_counts = 0).

Who is online

Users browsing this forum: Bing [Bot] and 307 guests