New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ble taking too much power (IDFGH-769) #947
Comments
I have the same issue. Even running the demo heats the chips a lot. |
@joicetm BLE power consumption improvements (i.e. modem sleep mode) are not planned for 3.0. 80-90mA is the best that can be achieved in the current version. |
Do you know what is the release target for the modem sleep mode ? Where can we find the project roadmap and estimate dates? |
This is an important issue for me. I would be using the ESP32 in my project right now if I could run the ble_spp_server demo using less than 10mA. |
@MS-elug @mobilinkd The BLE modem sleep will be release at the next version(v3.1), thank you for your concern about ESP32. |
That's great news, @Yulong-espressif ! Are you able to characterize the current consumption with this enhancement? |
Hi, I am using ESP-WROOM-32 with Arduino IDE. I want to know is there any way to reduce power consumption of BLE peripheral? I made a test on power consumption during BLE advertising which was consuming 112mA current when CPU set at 80Mhz. I want to reduce the current consumption to at least 1mA but BLE should keep on advertise. Please help me in this regards. |
@Yulong-espressif can you tell us a release date for BLE modem sleep (version 3.1)? Moreover I would be interested in the current consumption in BLE modem sleep mode. We are planning to develop a low power product, therefore the current consumption is the most critical part of the project. |
@Yulong-espressif Is BLE wakeup going to be in the next version? |
@sargun Yes, will be release in the version 3.1 |
Actually, both BR/EDR and BLE power save will be released in release/v3.1. |
Thanks for the update, TianHao-Espressif . |
Features has been implemented few days ago. I tried it and it works. With the exactly same features (time interval=50ms, 15B per packet, notify enabled) power consumption passed from 102mA to 35-40mA. Data exchange is not fluid ad before, but don't know the cause. |
@frax84 , the BLE/BR/EDR sleep current and related performance is in test. And what "not fluid" present. Could you provide your test case? |
@TianHao-Espressif Hi Tiao! Actually was not a complain but was just informing the others in this post. By the way, your explanation is very interesting. This is my use case:
With the term "no fluid" i mean that while before (was using BLE with BTDM mode) data were coming evenly time-spaced ("1-2-3-4-5-6-7-8-9-10") now they tend to come less evenly spaced (i.e. "1-2---34--5-6-7--8---9-10"). I have not test data to show but what i'm saying is clearly visible with eye (while with previous settings it was ok) I have two questions.
Thank you EDIT: edited some typos and added more infos about my use case |
Hi All, I have been optimising our ESP32 application for low power at the moment. The lowest consumption with BLE enabled (BT-classic disabled) is around 28-32mA when advertising with a 200ms interval Im just wondering if i am at the limit of what the ESP32 can currently do. I understand that as this chip supports BLE and WiFi the power consumption during transmit and Reception will be higher than a BLE only chip. However since BLE operates on the connection interval paradigm, if there is a 40ms connection interval or a 200ms advertising interval, surely the radio could be disabled between connection intervals saving power during these periods? This would likely result in a much lower average current. Thanks in advance for your response. |
@lucashutchinson Did you try to change TX power? By default it is setup pretty high (+3dBm). Remember that you can decrease TX power for advertising only if you want. |
hi all: |
Hi @chegewara @Weijian-Espressif Yes I have tried changing the TX power between N12 and P9, no real difference was noticed. however i am going to do a few more tests. I have enable bluetooth modem sleep options, and have tried both ORIG and EVED modes. I have also called the functions: Do you have any internal test results of low power bluetooth that can be shared? Thanks for your responses! |
@lucashutchinson . 30mA is in accord with our internal test result for BLE advertising in current stage. In order to further optimize the bluetooth power consumption, we are trying to resolve the issue in the combination use of bluetooth modem sleep and Dynamic Frequency Scaling(DFS) as well as Automatic light sleep. which can hopefully be completed in a month. |
@lucashutchinson Could you help share if any updates for this issue? Thanks. |
1 similar comment
@lucashutchinson Could you help share if any updates for this issue? Thanks. |
There are no updates that I have had from espressif. |
Hi, a commit on optimization of Bluetooth power consumption was merged into ESP-IDF recently. The merge commit is(git describe --tag): v4.0-dev-684-gb859584. An external 32.768kHz crystal is required to take advantage of this feature. Here is the description for this commit and a brief manual. Feature: Bluetooth modem sleep with external 32.768kHz xtal under light sleepOverviewBluetooth modem sleep could work under DFS but could not work under light sleep in previous implementation, which is largely due to the sleep clock source. Sleep clock must provide enough accuracy for BLE to maintain time during sleep.
This patch resolves the issue that Bluetooth modem sleep is not allowed to work with light sleep with external 32kHz crystal. In this case a menuconfig option is provided to set the BLE SCA used to estimate RX window widening during connection events. User guideTo use bluetooth modem sleep with light sleep, please follow the below instructions. ESP-IDF menuconfig options:
Note: Tickless idle needs to be enabled to allow automatic light sleep. FreeRTOS will enter light sleep if no tasks need to run
Note that the "additional current" option is a workaround for a hardware issue on ESP32 that the crystal can fail in oscillating.
Enable light sleep by calling power management API in application:
Test resultBelow are some power consumption statistics on typical BLE use scenario:
|
Hi @mywang-espressif Could you confirm some values? From what i see in some cases with
VS
Min and max values are lower, but average current draw is higher with 80MHz. Anyway thanks for new feature and comprehensive update about it. PS only what is missing is comparison with current draw without light sleep enabled. |
Hello the ESP32-C3 https://www.espressif.com/en/news/ESP32_C3 is described in datasheet as "Ultra-Low-Power SoC" can we expect significant improvements in BLE use case (like lasting weeks/months on battery instead of hours/days) or is it still on same level as ESP32? |
Has anyone done any testing on IDF version 4.3-beta now that 5.0 is supported ? |
But you understand ble 5 is only on C3 and S3 in future? |
No I was not aware of this. |
I tested the setup which is considered by @mywang-espressif in #947 (comment) and I also added some GPIO outputs at btdm_sleep_enter_phase2_wrapper (low) and btdm_sleep_exit_phase3_wrapper (high). I was monitoring the output and can see a low time of roughly about 30ms and a high time of 6ms. It seems that the sleep mode work but my current consumption tells me something else. Im using the same scenario as @Ben79543 in #947 (comment) PlatformIO with ESP-IDF and Arduino component. In my case, im using the esp_pm_configure as described above. Im using the BLE server example. The first thing: I had to insert a delay to the loop function, otherwise the watchdog is always triggered by the loop function:
without delay, my avg current consumption was about 64mA. If I was adding a short delay of 10ms, I did not received a trigger message anymore and the current consumption decreased to 46mA. If im increasing the delay in the loop function to, lets say 1 second, the current consumption decreases again (30mA). This was the best I could achieve. But how could I get the 3 mA? I would say that this got something to do with the Arduino core. I am doing something wrong (except of using Arduino ;) )? |
Any one can share the code used by mywang-espressif during the test? |
Hi, can I get example usage for this? esp_pm_config_esp32c3_t pm_config = {
ESP_ERROR_CHECK( esp_pm_configure(&pm_config) ); I have used like this, but got stack size error. |
Hi,
thanks for sharing this guide! I am working with an external 32.768kHz crystal and configured everything like mentioned above but while uisng BLE I've got the error message: lld_pdu_get_tx_flush_nb HCI packet count mismatch (0, 1) I am using sleep mode directly with calling esp_light_sleep_start(); and waiting for a wake up with timer (while (esp_sleep_get_wakeup_cause() != ESP_SLEEP_WAKEUP_TIMER)) which I have configured with esp_sleep_enable_timer_wakeup. Is there anything else to consider or is the guide above current? Edit: I am using the BLE library of arduino vergot to say. |
Hi, I've configured everything as @mywang-espressif specified above and am indeed getting fairly low current consumptions. However, I have couple of questions:
Here's a screenshot from my scope when ESP32 is in ADV with advertisement period set to ~1sec: https://i.imgur.com/kICSLIZ.jpg PS. I'm using Arduino with recompiled core. I've added a 13ms delay into the main loop to utilize light sleep as much as possible. If I go over 13ms BLE communication drops all the time and becomes unusable.
To change advertisiment interval I used this:
0x640 = 1600 => 1600 x 0.625 = 1000 ms |
@mywang-espressif Hi dear Karl I used the external xtal light sleep, it works well. But I read the bt.c code and found in"/Low Power Clock Selection/" there's a "BTDM_LPCLK_SEL_8M" option. so I wonder if it's doable to use the internal 8M as the LPCLK source. I tried to modify some of the codes but it didn't work. So, is the LPCLK only for the bt controller or it's also used to generate the RF carrier wave? if it's the first situation, why it needs so much accuracy??? Is there still some possibility to use internal 8M as the LPCLK source if some unsteady is acceptable? |
@mywang-espressif Using bluetooth classic with HFP profile, automatic light sleep seems to be impossible? Chip seems to never wake up and BT connection is dropped. Is this feature only applicable using BLE? If so, are there any plans to also implement it for BT classic? I really need to get sniff current consuption down to a minimum for connected HFP with no active call. At the moment I get around 23mA - 30mA sniff current edit: I am using IDF v4.3 |
Hi @CarlosDerSeher , I tested using IDF V4.3, and the ESP32 can enter light sleep and wake up. Thanks |
@xiongweichao using the HFP example with 32k crystal mounted to the right pins and setting everything as explained here #947 (comment) results in 10mA current consuption and a freezed esp32 after entering sniff mode. Which example did you use to verify esp32 can enter light sleep? edit: tick rate in freeRTOS is set to 1000Hz |
Hi @CarlosDerSeher , You can check if the esp_sleep_start() API is called. If this API is not called, light sleep is not entered. Thanks |
@xiongweichao ok, seems there has to be some improvement. I checked out the version you linked from git and it seems like everything is working there. You stated to check if esp_sleep_start() is called, but this isn't available in v4.3. Correct me if I am wrong... Thank you though, will keep testing with https://github.com/espressif/esp-idf/tree/220590d599e134d7a5e7f1e683cc4550349ffbf8 edit: I meant I was using the release tagged with v4.3 |
Hi @CarlosDerSeher , Sorry, the architecture of v4.3 and master is a bit different. The esp_sleep_start() of v4.3 is here esp-idf/components/esp_system/sleep_modes.c Line 439 in e493a4c
Thanks |
It seems that the related API is |
It's static function, you cannot call that function out-side of sleep_modes.c. |
@mywang-espressif So i consider about added 32.768KHz crystal in my PCB. Before implementation, I have question about above solution. |
WiFi & BLE (modem sleep) can coexist, but only when both enter the modem sleep will the RF be turned off. Thanks |
Then wifi & ble coexist might be impossible.... Thank you for answering :) |
Hi,
I wish to know when can i expect the low power modes in ble? would this feature be added in the next release v3.0?
currently i observe that with single core and 80 Mhz, the device consumes around 80-90 mA.[minimum i was able to achieve]
is it the best we can achieve ? or is there any way to improve the power consumption with current idf version?
The text was updated successfully, but these errors were encountered: