Page 1 of 1

What is this? BT_BTM: Advertising or scaning now, can't set privacy

Posted: Mon Dec 14, 2020 12:14 am
by DerrickLau
I am seeing the following output when I run idf.py -p COM5 -b 115200 monitor:

E (1986) BT_BTM: Advertising or scaning now, can't set privacy
V (1996) app_main(): ble_gap_event_handler() called.
V (1996) BtController::BleGapEventHandler(): called.
V (1996) BtController::BleGapEventHandler(): ESP_GAP_BLE_ADV_START_COMPLETE_EVT.
I (2006) BtController::BleGapEventHandler(): Start adv successfully

V (2006) BtController::BleGapEventHandler(): done.

What does that error "BT_BTM: Advertising or scaning now, can't set privacy" mean? What ESP-IDF API is throwing it?

Re: What is this? BT_BTM: Advertising or scaning now, can't set privacy

Posted: Mon Dec 14, 2020 9:41 am
by ESP_Jan
Hi DerrickLau,

This error is being thrown at:
https://github.com/espressif/esp-idf/bl ... gap.c#L857
This error is thrown if the function BTM_BleConfigPrivacy is called while the Bluetooth interface is not idle.

Re: What is this? BT_BTM: Advertising or scaning now, can't set privacy

Posted: Tue Dec 15, 2020 12:38 am
by DerrickLau
That function is called by esp_ble_gap_start_advertising() right? I only call that once in my current execution, which means the bluetooth interface was doing something during that?
Well, the thing is, I only call that method once, in my GAP event handler, when a ESP_GAP_BLE_SCAN_RSP_DATA_RAW_SET_COMPLETE_EVT event is received.

And what do you mean by bluetooth interface not idle? Does that mean the ESP32 should not be also listening for audio streaming connections?

The example I am using is a2dp_gatts_coex.

Re: What is this? BT_BTM: Advertising or scaning now, can't set privacy

Posted: Wed Dec 16, 2020 11:40 pm
by ESP_Jan
Hi DerrickLau,

I've just flashed the a2dp_gatts_coex example from IDF v4.1 to a ESP-WROVER-KIT board with the ESP32-WROVER-B module.
I connected my iPhone to the ESP using Bluetooth and was unable to produce the error you were experiencing.

What module are you using?
What is your IDF version? (run idf.py --version)