BLE low power in continuous scanning mode

john3k
Posts: 2
Joined: Sat Feb 27, 2021 8:41 am

BLE low power in continuous scanning mode

Postby john3k » Sat Feb 27, 2021 9:08 am

Hello everyone,

I am looking for ideas to reduce the power consumption in BLE continuous scanning mode. In my application I only use BLE and I stay in constant scanning mode (I never establish a connection) analyzing broadcast packets. However, I need to significantly reduce my power consumption.

My starting point is the GATTC demo project. I have tried a few things, but they are not enough:
- I changed scan_type to BLE_SCAN_TYPE_PASSIVE
- I lowered the CPU frequency to 80MHz
- I mess a little with scan_interval (0x500), scan_window (0x300),
- I used light sleep by calling power management API (it doesn't seem to have a big impact on BLE scanning)

My platform is ESP32-WROOM-32D.
I am thinking about manual sleep but I do not know how to get it along with scanning (ESP32 is a relatively new experience for me).
I will try the Solo-1 module as soon as it arrives by mail, but would prefer to stay at wroom 32.

All suggestions are welcome, thank you.


john3k
Posts: 2
Joined: Sat Feb 27, 2021 8:41 am

Re: BLE low power in continuous scanning mode

Postby john3k » Mon Mar 01, 2021 8:00 pm

Thank you for your answer. I found this link earlier (one of the first ones that google throws). I am already using the power management API.

  1. #if CONFIG_PM_ENABLE
  2.         esp_pm_config_esp32_t pm_config = {
  3.                 .max_freq_mhz = 80,
  4.                 .min_freq_mhz = 40,
  5.     #if CONFIG_FREERTOS_USE_TICKLESS_IDLE
  6.                 .light_sleep_enable = true
  7.     #endif
  8.         };
  9.         ESP_ERROR_CHECK( esp_pm_configure(&pm_config) );
  10.     #endif

I am not using the Modem sleep function yet because in my current project I use crystal pins for other functions. I need to move these pins and try the Modem sleep feature. I'm just afraid that the scan will not be affected in proportion to the effort, but I have plans to try.
I have tightened the scan times by adjusting them to packets that I want to receive and not miss (1s interval, 310ms scan). As you can see below, scan_window is the biggest power consumer.

DS1Z_QuickPrint1.png
DS1Z_QuickPrint1.png (45.58 KiB) Viewed 2370 times

The measurement is on the 5V power, because it's easier for me to measure it in the system. Then I have a stepdown converter to 3.3V for ESP, but you can already see what's going on.

I only use one core for all threads (except BLE I only have one with some logic and UART communication). Can I turn off the second core (if it makes sense)?

Before I run the 32.768MHz quartz, maybe someone will have some suggestions on how to reduce the current during the scan, since I can not shorten the scan_window?

Who is online

Users browsing this forum: No registered users and 154 guests