Page 1 of 1

Reduce current consumption in BLE

Posted: Wed Jan 10, 2018 1:27 pm
by leoleo93
Hello !
Do you know how to reduce the current consumption (about 110 mA) when the ESP32 has the BLE activated?
Can I use one of the sleep mode (deep, light, modem) to make it mostly sleep and then turning on the BLE only for short periods?
Thank you

Re: Reduce current consumption in BLE

Posted: Thu Jan 11, 2018 4:44 am
by ESP_igrr
At the moment, BLE is not compatible with sleep modes. Some work is in progress to make modem sleep for BLE possible, with the first version to be finished before by mid February.

Re: Reduce current consumption in BLE

Posted: Thu Jan 11, 2018 6:40 am
by athankok
is it possible to turn off the BLE and then go to deep sleep ?(esp_err_t esp_bluedroid_deinit()
esp_err_t esp_bluedroid_disable())?

Re: Reduce current consumption in BLE

Posted: Thu Jan 11, 2018 7:49 am
by ESP_igrr
Yes, disabling bluetooth and going into deep sleep should work, however the existing connections will be terminated.

Re: Reduce current consumption in BLE

Posted: Thu Jan 11, 2018 11:42 am
by ESP_krzychb
athankok wrote:is it possible to turn off the BLE and then go to deep sleep ?(esp_err_t esp_bluedroid_deinit()
esp_err_t esp_bluedroid_disable())?
Adding to reply by ESP_igrr, I have an application of such scenario and it works very well in my case.
Whether it will work for you depends on how often you need to read the data. In my application It takes 1 - 2 s to reestablish BLE connection after each wake up but I am reading the data (from a heart rate sensor it this case) every 15 s.
Here are some sample trends of heart rate - https://github.com/krzychb/esp32-everes ... asurements

Re: Reduce current consumption in BLE

Posted: Fri Jan 12, 2018 8:41 am
by leoleo93
krzychb wrote:
athankok wrote:is it possible to turn off the BLE and then go to deep sleep ?(esp_err_t esp_bluedroid_deinit()
esp_err_t esp_bluedroid_disable())?
Adding to reply by ESP_igrr, I have an application of such scenario and it works very well in my case.
Whether it will work for you depends on how often you need to read the data. In my application It takes 1 - 2 s to reestablish BLE connection after each wake up but I am reading the data (from a heart rate sensor it this case) every 15 s.
Here are some sample trends of heart rate - https://github.com/krzychb/esp32-everes ... asurements
Thank you all !
krzychb I don't find where you start the BLE in your altimeter-main.c file. Can you explain me? Thanks !!

Re: Reduce current consumption in BLE

Posted: Sun Jan 14, 2018 11:49 am
by ESP_krzychb
leoleo93 wrote:krzychb I don't find where you start the BLE in your altimeter-main.c file. Can you explain me? Thanks !!
BLE is started by function update_heart_rate()

Then this function is doing two things:
1. Setting up a BLE callback implemented in component polar-h7-client.
2. Waiting couple of seconds for BLE to establish connection and return the heart rate by the callback.

The whole polar-h7-client component is a simple adaptation of ESP-IDF GATT CLIENT demo that now comes with a tutorial.

Re: Reduce current consumption in BLE

Posted: Mon Jan 15, 2018 8:17 am
by leoleo93
krzychb wrote:
leoleo93 wrote:krzychb I don't find where you start the BLE in your altimeter-main.c file. Can you explain me? Thanks !!
BLE is started by function update_heart_rate()

Then this function is doing two things:
1. Setting up a BLE callback implemented in component polar-h7-client.
2. Waiting couple of seconds for BLE to establish connection and return the heart rate by the callback.

The whole polar-h7-client component is a simple adaptation of ESP-IDF GATT CLIENT demo that now comes with a tutorial.
Thank you !! ;)