← index #8263Issue #8264
Related · high · value 4.219
QUERY · ISSUE

example->bluetooth->ble_bonding_peripheral.py error with NUCLEO-WB55

openby dmazzellaopened 2022-02-05updated 2026-03-19
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:

IMG_5833

Paired with iOS device:

IMG_32F03F1DD77A-1
IMG_CA73068250EC-1

Error in second attempt of connection

IMG_56C763E58F8D-1

CANDIDATE · ISSUE

example->bluetooth->ble_bonding_peripheral.py error with PYBD-SF2 and PYBD_SF6

closedby dmazzellaopened 2022-02-05updated 2022-02-10

Hi,
i have tried example/bluetooth/ble_bonding_peripheral.py with PYBD-SF2 and PYBD_SF6 and this is the error I have.

MicroPython v1.18-99-g203ec8ca7-dirty on 2022-02-05; PYBD-SF2W with STM32F722IEK
Type "help()" for more information.
>>> 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'\xd1\xd1\x03d\x8434\x1c\xb5\xa0\x9f\xc3*C\x81\xec'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/flash/lib/ble_bonding_peripheral.py", line 179, in demo
  File "/flash/lib/ble_bonding_peripheral.py", line 76, in __init__
  File "/flash/lib/ble_bonding_peripheral.py", line 153, in _advertise
OSError: -513
MicroPython v1.18-99-g203ec8ca7-dirty on 2022-02-05; PYBD-SF6W with STM32F767IIK
Type "help()" for more information.
>>> 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'M\x9e\x9f\x02\xce\xed\r\x18.E,\x85g\xe5\xd0\xd9'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/flash/lib/ble_bonding_peripheral.py", line 179, in demo
  File "/flash/lib/ble_bonding_peripheral.py", line 76, in __init__
  File "/flash/lib/ble_bonding_peripheral.py", line 153, in _advertise
OSError: -513
>>> 

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied