Double "Bluetooth pairing request" / GATT security server
Posted: Thu May 06, 2021 2:07 pm
Following the example of GATT security server, developed an Android App that is able to connect, pair, bond and perform data transfer with the ESP32 module.
https://github.com/espressif/esp-idf/tr ... ity_server
One annoying issue is the double "Bluetooth pairing request" popups when the Android GATT client fires the first connection to the GATT security server. The behavior can be repeated using nRF connect tool.
1. [ESP32] Run GATT security server
2. [nRF App] scan and found the ESP32's ESP_BLE_SECURITY GATT server
3. [nRF App] press connect to the GATT server
4. [ESP32] event ESP_GATTS_CONNECT_EVT is seen, i.e. connected
5. [Android] pops up "Bluetooth Pairing Request" as expected
6. [Android] User presses "OK" to confirm pairing
7. [Android] Step 6 has no effect
8. [Android] pops up "Bluetooth Pairing Request" the second time
9. [Android] User presses "OK" to confirm pairing the second time
10. [ESP32] ESP_GAP_BLE_KEY_EVT and ESP_GAP_BLE_AUTH_CMPL_EVT are seen. It shows bonding success
11. [Android] bonding is finished on the Android side as well
GATT Security info
Android version: Android 10 (Samsung)
I don't know if it is can be solved from ESP or Android side. Any suggestions? To end-users, it is very strange to confirm pairing twice.
https://github.com/espressif/esp-idf/tr ... ity_server
One annoying issue is the double "Bluetooth pairing request" popups when the Android GATT client fires the first connection to the GATT security server. The behavior can be repeated using nRF connect tool.
1. [ESP32] Run GATT security server
2. [nRF App] scan and found the ESP32's ESP_BLE_SECURITY GATT server
3. [nRF App] press connect to the GATT server
4. [ESP32] event ESP_GATTS_CONNECT_EVT is seen, i.e. connected
5. [Android] pops up "Bluetooth Pairing Request" as expected
6. [Android] User presses "OK" to confirm pairing
7. [Android] Step 6 has no effect
8. [Android] pops up "Bluetooth Pairing Request" the second time
9. [Android] User presses "OK" to confirm pairing the second time
10. [ESP32] ESP_GAP_BLE_KEY_EVT and ESP_GAP_BLE_AUTH_CMPL_EVT are seen. It shows bonding success
11. [Android] bonding is finished on the Android side as well
GATT Security info
Code: Select all
I (420) cpu_start: Application information:
I (425) cpu_start: Project name: sec_gatts_demo
I (430) cpu_start: App version: c118922-dirty
I (436) cpu_start: Compile time: May 5 2021 10:28:01
I (442) cpu_start: ELF file SHA256: 0ccdfd6a1a49f0db...
I (448) cpu_start: ESP-IDF: v4.1.1-44-g83aaee86d-dirty
I don't know if it is can be solved from ESP or Android side. Any suggestions? To end-users, it is very strange to confirm pairing twice.