Reduce current consumption in BLE

leoleo93
Posts: 3
Joined: Wed Jan 10, 2018 1:21 pm

Reduce current consumption in BLE

Postby leoleo93 » Wed Jan 10, 2018 1:27 pm

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

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: Reduce current consumption in BLE

Postby ESP_igrr » Thu Jan 11, 2018 4:44 am

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.

athankok
Posts: 3
Joined: Thu Jan 11, 2018 6:38 am

Re: Reduce current consumption in BLE

Postby athankok » Thu Jan 11, 2018 6:40 am

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())?

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: Reduce current consumption in BLE

Postby ESP_igrr » Thu Jan 11, 2018 7:49 am

Yes, disabling bluetooth and going into deep sleep should work, however the existing connections will be terminated.

User avatar
ESP_krzychb
Posts: 394
Joined: Sat Oct 01, 2016 9:05 am
Contact:

Re: Reduce current consumption in BLE

Postby ESP_krzychb » Thu Jan 11, 2018 11:42 am

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

leoleo93
Posts: 3
Joined: Wed Jan 10, 2018 1:21 pm

Re: Reduce current consumption in BLE

Postby leoleo93 » Fri Jan 12, 2018 8:41 am

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 !!

User avatar
ESP_krzychb
Posts: 394
Joined: Sat Oct 01, 2016 9:05 am
Contact:

Re: Reduce current consumption in BLE

Postby ESP_krzychb » Sun Jan 14, 2018 11:49 am

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.

leoleo93
Posts: 3
Joined: Wed Jan 10, 2018 1:21 pm

Re: Reduce current consumption in BLE

Postby leoleo93 » Mon Jan 15, 2018 8:17 am

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 !! ;)

Who is online

Users browsing this forum: JamieC1 and 124 guests