Describe the bug
I've updated an example to use bonding and it's getting stuck in an infinite loop with the following repeated constantly...
[00:00:21.499] LOG -- sm.c.2923: sm_run: state 23
[00:00:21.504] LOG -- sm.c.1575: sm peer addr type 0, peer addres B8:27:EB:28:CA:9A
[00:00:21.512] LOG -- btstack_tlv_flash_bank.c.408: Found tag '4254440f' at position 692
[00:00:21.520] LOG -- sm.c.1583: Re-bonding, emit GAP_SUBEVENT_BONDING_DELETED
I'm bonding with a RPI device via a Bleak python script.
if I remove the following code in sm_process_bonding_information, then the bonding completes and the program works.
// emit GAP_SUBEVENT_BONDING_DELETED and remove address resolution entry if it was bonded before
+#if 0
if (le_db_index >= 0) {
log_info("Re-bonding, emit GAP_SUBEVENT_BONDING_DELETED");
// emit event via hci
@@ -1591,6 +1592,7 @@ static void sm_process_bonding_information(sm_connection_t * sm_conn){
hci_remove_le_device_db_entry_from_resolving_list(le_db_index);
#endif
}
+#endif
To Reproduce
The example has been modified in this PR raspberrypi/pico-examples#765
Steps to reproduce the behavior:
- run the example on a Pico 2 W. On startup press W to wipe everything including all saved bonding stuff
- On a Pi device, make sure the device is not in its bonding store, e.g. bluetoothctl remove 2C:CF:67:BE:08:05
- Run the set_credentials.py script, e.g. python set_credentials.py "ssid" "password" 2C:CF:67:BE:08:05
Expected behavior
Bonding should complete and the program should try to connect to the ssid with the details it was sent via ble.
Definitely shouldn't get into an infinite loop?
HCI Packet Logs
See the attached "bad" log which shows the problem and "good" log where I have modified sm_process_bonding_information.
minicom_btstack_inf_bad.pklg.zip
minicom_btstack_inf_good.pklg.zip
Environment: (please complete the following information):
- Current BTstack branch: v1.8.2
- Bluetooth Controller CYW43 43439
- Remote device: RPI 5 running bookworm
Additional context
Add any other context about the problem here.
Describe the bug
I've updated an example to use bonding and it's getting stuck in an infinite loop with the following repeated constantly...
[00:00:21.499] LOG -- sm.c.2923: sm_run: state 23
[00:00:21.504] LOG -- sm.c.1575: sm peer addr type 0, peer addres B8:27:EB:28:CA:9A
[00:00:21.512] LOG -- btstack_tlv_flash_bank.c.408: Found tag '4254440f' at position 692
[00:00:21.520] LOG -- sm.c.1583: Re-bonding, emit GAP_SUBEVENT_BONDING_DELETED
I'm bonding with a RPI device via a Bleak python script.
if I remove the following code in sm_process_bonding_information, then the bonding completes and the program works.
To Reproduce
The example has been modified in this PR raspberrypi/pico-examples#765
Steps to reproduce the behavior:
Expected behavior
Bonding should complete and the program should try to connect to the ssid with the details it was sent via ble.
Definitely shouldn't get into an infinite loop?
HCI Packet Logs
See the attached "bad" log which shows the problem and "good" log where I have modified sm_process_bonding_information.
minicom_btstack_inf_bad.pklg.zip
minicom_btstack_inf_good.pklg.zip
Environment: (please complete the following information):
Additional context
Add any other context about the problem here.