I am working on a BLE project using an ESP32 where I want to control the bonding process programmatically. Specifically, when the ESP32 erases its bonding information, I want the connected master device (e.g., a laptop) to automatically forget the ESP32 and initiate a new pairing process.
Current Problem:
After the ESP32 erases its bonding information using esp_ble_remove_bond_device(), the previously connected master device still retains the bond information for the ESP32. As a result, the master device (laptop) shows an error or does not automatically start a new pairing process. To fix this, I currently have to manually remove the ESP32 from the Bluetooth settings on the laptop.
Objective:
I want the ESP32 to send a message or command to the master device (laptop) after it erases its bonding information, prompting the master device to:
1. Automatically remove the bonding information of the ESP32.
2. Re-initiate the pairing process without manual intervention.
Specific Use Case:
The goal is to create a BLE device where:
1. A user can long-press a button on the ESP32.
2. The ESP32 will disconnect from any currently connected device.
3. The ESP32 will erase its bonding information.
4. The master device should automatically forget the ESP32 and start a new pairing process.
Questions:
1. Is there a specific BLE Security Manager Protocol (SMP) message or sequence that the ESP32 can send to the master device to trigger the removal of its bonding information and initiate a new pairing process?
2. Are there other approaches or best practices to achieve automatic re-pairing between the ESP32 and the master device after bond erasure?
3.How can I implement a mechanism to ensure seamless reconnection without requiring manual intervention on the master device?
Any guidance or suggestions would be greatly appreciated!
Thank you!
How to Automatically Re-Initiate Pairing from ESP32 to a Master Device After Erasing Bonding Information?
Who is online
Users browsing this forum: Google [Bot] and 153 guests