Hi,
I am currently working on a project where I need to have a Bluetooth connection with an app. My ESP32 is a secure GATT Server and I would like to get this behaviour:
- If the phone (the central) is not bonded yet, it can start the secure connection only if the user press a button (like a pairing button).
- If the phone is already bonded, it can connect to the esp32 without the need to press any button.
The BLE code is directly based on the Secure GATT Server Example, with MITM encryption and the Just Work method (I just have a button).
Does anyone have ever try to get this behaviour ?
BLE Pairing with a button
Re: BLE Pairing with a button
Hi,
you found a solution for this?
I'm working on a simmilar project like this.
you found a solution for this?
I'm working on a simmilar project like this.
Re: BLE Pairing with a button
Hi @all,
I have the same request/problem with denying devices to pair with the ESP32.
I've tried to return false with esp_ble_gap_security_rsp
on the GAP event ESP_GAP_BLE_SEC_REQ_EVT.
But this event seems to never occur.
Events on pairing are:
ESP_GAP_BLE_KEY_EVT
ESP_GAP_BLE_UPDATE_CONN_PARAMS_EVT
(Android).
Nevertheless, I don't see a possibility to deny a connection there....
Do you have any suggestions how to solve this problem?
Best regards
I have the same request/problem with denying devices to pair with the ESP32.
I've tried to return false with esp_ble_gap_security_rsp
on the GAP event ESP_GAP_BLE_SEC_REQ_EVT.
But this event seems to never occur.
Events on pairing are:
ESP_GAP_BLE_KEY_EVT
ESP_GAP_BLE_UPDATE_CONN_PARAMS_EVT
(Android).
Nevertheless, I don't see a possibility to deny a connection there....
Do you have any suggestions how to solve this problem?
Best regards
Re: BLE Pairing with a button
Another approach I was thinking of:
-) Use different advertising policies: ADV_FILTER_ALLOW_SCAN_ANY_CON_WLST or ADV_FILTER_ALLOW_SCAN_WLST_CON_WLST if no public pairing should be possible, ADV_FILTER_ALLOW_SCAN_ANY_CON_ANY if in pairing mode
-) If a connection is established, add the BT-MAC to the whitelist
BUT: whitelisting seems to be broken for random addresses (used on Android):
https://github.com/espressif/esp-idf/issues/1368
https://github.com/espressif/esp-idf/issues/2262
The comments of Espressif state, that this is a hardware bug?!?
It seems there is no possible fix for this.
@Espressif: any updates/roadmap for this bug? Or is the whitelist option simply not possible with ESP32D0WDQ6 rev0 and we have to wait for another chip revision?
-) Use different advertising policies: ADV_FILTER_ALLOW_SCAN_ANY_CON_WLST or ADV_FILTER_ALLOW_SCAN_WLST_CON_WLST if no public pairing should be possible, ADV_FILTER_ALLOW_SCAN_ANY_CON_ANY if in pairing mode
-) If a connection is established, add the BT-MAC to the whitelist
BUT: whitelisting seems to be broken for random addresses (used on Android):
https://github.com/espressif/esp-idf/issues/1368
https://github.com/espressif/esp-idf/issues/2262
The comments of Espressif state, that this is a hardware bug?!?
It seems there is no possible fix for this.
@Espressif: any updates/roadmap for this bug? Or is the whitelist option simply not possible with ESP32D0WDQ6 rev0 and we have to wait for another chip revision?
-
- Posts: 125
- Joined: Fri May 24, 2019 2:02 am
Re: BLE Pairing with a button
Has anyone looked at this again with IDF 4.4?
Who is online
Users browsing this forum: Google [Bot] and 144 guests