Disabling BT controller does not lower consumption
Posted: Fri May 18, 2018 12:19 pm
I'm trying to develop a Bluetooth beacon, that broadcasts for a few seconds (less than 10) and then goes into deep sleep until it is awaken by an external event. Unfortunately, consumption remains very high even in deep sleep mode. I developed the smallest possible code to try to show the problem (see below). I'm using ESP-IDF v3.0 and I tested with two ESP-WROOM32 (ESP32D0WDQ6 rev 0 & 1) and one ESP32-PICO-D4 and I get the same results.
- Before enabling BT controller, consumption is around 30 mA
- After enabling BT controller, consumption is above 60 mA
- After disabling BT controller, consumption is still above 60 mA
- After entering deep sleep, consumption is still above 60 mA (although not completely stable)
- Before enabling BT controller, consumption is around 30 mA
- After enabling BT controller, consumption is above 60 mA
- After disabling BT controller, consumption is still above 60 mA
- After entering deep sleep, consumption is still above 60 mA (although not completely stable)
Code: Select all
void app_main()
{
ESP_ERROR_CHECK(nvs_flash_init());
ESP_ERROR_CHECK(esp_bt_controller_mem_release(ESP_BT_MODE_CLASSIC_BT));
esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
vTaskDelay(5000 / portTICK_PERIOD_MS); // Before enabling BT controller, current around 30 mA
esp_bt_controller_init(&bt_cfg);
esp_bt_controller_enable(ESP_BT_MODE_BLE);
vTaskDelay(5000 / portTICK_PERIOD_MS); // After enabling BT controller, current is above 60 mA
esp_bt_controller_disable();
esp_bt_controller_deinit();
vTaskDelay(5000 / portTICK_PERIOD_MS); // After disabling BT controller, current is still abover 60 mA
esp_deep_sleep_start(); // When in deep sleep, current remains above 60 mA
}