QUERY · ISSUE
example->bluetooth->ble_bonding_peripheral.py error with NUCLEO-WB55
bugport-stm32
Hi,
i have tried example/bluetooth/ble_bonding_peripheral.py with NUCLEO-WB55.
The first connection and pairing are done correctly, I can read from the feature, the device is associated with my iPhone SE (2nd Gen), but when disconnected, all subsequent connections fail.
I attach photos and logs for more details.
MicroPython v1.18-99-g203ec8ca7-dirty on 2022-02-05; NUCLEO-WB55 with STM32WB55RGV6
Type "help()" for more information.
>>> import stm
>>> stm.rfcore_fw_version(0)
(1, 2, 0, 0, 0)
>>> stm.rfcore_fw_version(1)
(1, 13, 0, 0, 5)
>>> stm.rfcore_status()
0
>>> from ble_bonding_peripheral import demo
>>> demo()
no secrets available
get secret: 2 0 None
get secret: 10 0 b'irk'
set secret: (10, b'irk') b'\xcd\xdc\xbfZQuq/\x99\x01\x00\x0e\xc9\xb2B\xae'
get secret: 2 0 None
get secret: 2 0 None
get secret: 2 0 None
passkey action 2049 4 607677
accept? 607677
encryption update 2049 1 1 1 16
set secret: (1, b'\x00\xfc-\x95\x9f\xf3\x00') b'\x00\xfc-\x95\x9f\xf3\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00D\xf9\x86\xdd\xd3\x926\xa3&\xf3\x96as\x16,D\x01\xcd\xdc\xbfZQuq/\x99\x01\x00\x0e\xc9\xb2B\xae\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x00\x00'
set secret: (2, b'\x00\xfc-\x95\x9f\xf3\x00') b'\x00\xfc-\x95\x9f\xf3\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00D\xf9\x86\xdd\xd3\x926\xa3&\xf3\x96as\x16,D\x01\xe52\xcd\xf1\x9f\xe1\xf6\x88{\xb0\x054!\xaa\xec\x1c\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x00\x00'
get secret: 1 0 b'\x00\x00\x00\x00\x00\x00\x00'
get secret: 1 0 b'\x00\x00\x00\x00\x00\x00\x00'
Pairing success:
Paired with iOS device:


Error in second attempt of connection

CANDIDATE · PULL REQUEST
extmod/modbluetooth: Add pairing/bonding support (v2)
extmod
This builds on #6651 . Changes to that PR are:
- rebase on latest master (to get new CI to run)
- fix build on esp32
- minor updates to docs
- fix bug in example with
i += 1 - added basic multitests for pairing and for pairing+bonding