[nRF Connect SDK] How to recover BLE connection when BLE lost its pairing?

Target nRF52832(nrf52dk_nrf52832)
SDK NCS v2.0.0

Hello.

I'm doing my project based on peripheral_hids_keyboard sample.

Issue: cannot make connection again

Steps
1. make connection with win 10.
2. make sure data transfer
3. delete pairing ble side.
4. win 10 try to connect but connection failed until pairing of win 10 is removed. so I should make connection again.

[Expectation]
BLE recognize ble pairing is removed, so that pairing initiate pairing process automatically.

[log]
Advertising successfully started
Connected D4:25:8B:54:71:5C (public)
Advertising successfully started
Disconnected from D4:25:8B:54:71:5C (public) (reason 19)
Advertising continued
Connected D4:25:8B:54:71:5C (public)
Advertising successfully started
Disconnected from D4:25:8B:54:71:5C (public) (reason 19)
Advertising continued
Connected D4:25:8B:54:71:5C (public)
Advertising successfully started
Disconnected from D4:25:8B:54:71:5C (public) (reason 19)
Advertising continued
Connected D4:25:8B:54:71:5C (public)
Advertising successfully started
W: opcode 0x2032 status 0x1a
E: Failed LE Set PHY (-5)
Disconnected from D4:25:8B:54:71:5C (public) (reason 19)
Advertising continued
Connected D4:25:8B:54:71:5C (public)
Advertising successfully started
Disconnected from D4:25:8B:54:71:5C (public) (reason 19)
Advertising continued
Connected D4:25:8B:54:71:5C (public)
Advertising successfully started
W: opcode 0x2032 status 0x1a
E: Failed LE Set PHY (-5)
Disconnected from D4:25:8B:54:71:5C (public) (reason 19)
Advertising continued
Connected D4:25:8B:54:71:5C (public)
Advertising successfully started
Disconnected from D4:25:8B:54:71:5C (public) (reason 19)
Advertising continued
Connected D4:25:8B:54:71:5C (public)
Advertising successfully started
Disconnected from D4:25:8B:54:71:5C (public) (reason 19)
Advertising continued

Parents
  • Hi,

    If the peer lost the bonding information, you either need to delete the bond on the nRF, or allow an existing bond to be replaced. The latter can be achieved by using CONFIG_BT_SMP_ALLOW_UNAUTH_OVERWRITE=y.

  • *** Booting Zephyr OS build v3.0.99-ncs1  ***
    Starting Bluetooth Peripheral HIDS keyboard example
    I: 6 Sectors of 4096 bytes
    I: alloc wra: 0, fd0
    I: data wra: 0, 1c
    D:
    I: SoftDevice Controller build revision:
    I: 33 78 2a 18 20 f5 61 61 |3x*. .aa
    I: a6 8b 77 60 62 83 39 2a |..w`b.9*
    I: 7c f1 14 e4             ||...
    D:
    D:
    D:
    D:
    D:
    D:
    D:
    D:
    D:
    D:
    D:
    D:
    D:
    I: HW Platform: Nordic Semiconductor (0x0002)
    I: HW Variant: nRF52x (0x0002)
    I: Firmware: Standard Bluetooth controller (0x00) Version 51.10872 Build 1643454                                              488
    D:
    D:
    I: No ID address. App must call settings_load()
    Bluetooth initialized
    D:
    D:
    I: Identity: F5:67:03:7E:52:21 (random)
    I: HCI: version 5.3 (0x0c) revision 0x1136, manufacturer 0x0059
    I: LMP: version 5.3 (0x0c) subver 0x1136
    D:
    D:
    D:
    D:
    D: disconnected -> connecting-adv
    D: handle 0 ref 1 -> 2
    D:
    D: handle 0 ref 2 -> 1
    Advertising successfully started
    
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: connecting-adv -> connected
    Connected 14:AB:C5:AE:75:17 (public)
    D:
    D: Adding conn 0x20001900 to poll list
    D:
    D: Adding conn 0x20001900 to poll list
    D:
    D: Adding conn 0x20001900 to poll list
    D: disconnected -> connecting-adv
    D: handle 0 ref 1 -> 2
    D:
    D: Adding conn 0x20001900 to poll list
    D: handle 0 ref 2 -> 1
    Advertising successfully started
    D:
    D: Adding conn 0x20001900 to poll list
    D:
    D: Adding conn 0x20001900 to poll list
    W: opcode 0x2032 status 0x1a
    E: Failed LE Set PHY (-5)
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D:
    D: Adding conn 0x20001900 to poll list
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: connected -> disconnect-complete
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: disconnect-complete -> disconnected
    D: conn 0x20001900
    D: handle 0 ref 2 -> 1
    D:
    D: conn 0x20001900
    Disconnected from 14:AB:C5:AE:75:17 (public) (reason 19)
    Advertising continued
    D: handle 0 ref 1 -> 0
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: connecting-adv -> connected
    Connected 14:AB:C5:AE:75:17 (public)
    D:
    D: Adding conn 0x200019c8 to poll list
    D:
    D: Adding conn 0x200019c8 to poll list
    D:
    D: Adding conn 0x200019c8 to poll list
    D: disconnected -> connecting-adv
    D: handle 0 ref 1 -> 2
    D:
    D: Adding conn 0x200019c8 to poll list
    D: handle 0 ref 2 -> 1
    Advertising successfully started
    D:
    D: Adding conn 0x200019c8 to poll list
    D:
    D: Adding conn 0x200019c8 to poll list
    D: handle 1 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 1 ref 1 -> 2
    D: handle 1 ref 2 -> 1
    D:
    D: Adding conn 0x200019c8 to poll list
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 1 ref 1 -> 2
    D: connected -> disconnect-complete
    D: handle 1 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 1 ref 1 -> 2
    D: disconnect-complete -> disconnected
    D: conn 0x200019c8
    D: handle 1 ref 2 -> 1
    D:
    D: conn 0x200019c8
    Disconnected from 14:AB:C5:AE:75:17 (public) (reason 19)
    Advertising continued
    D: handle 1 ref 1 -> 0
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: connecting-adv -> connected
    Connected 14:AB:C5:AE:75:17 (public)
    D:
    D: Adding conn 0x20001900 to poll list
    D:
    D: Adding conn 0x20001900 to poll list
    D:
    D: Adding conn 0x20001900 to poll list
    D: disconnected -> connecting-adv
    D: handle 0 ref 1 -> 2
    D:
    D: Adding conn 0x20001900 to poll list
    D: handle 0 ref 2 -> 1
    Advertising successfully started
    D:
    D: Adding conn 0x20001900 to poll list
    D:
    D: Adding conn 0x20001900 to poll list
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D:
    D: Adding conn 0x20001900 to poll list
    D: handle 0 ref 1 -> 2
    D: connected -> disconnect-complete
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: disconnect-complete -> disconnected
    D: conn 0x20001900
    D: handle 0 ref 2 -> 1
    D:
    D: conn 0x20001900
    Disconnected from 14:AB:C5:AE:75:17 (public) (reason 19)
    Advertising continued
    D: handle 0 ref 1 -> 0
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: connecting-adv -> connected
    Connected 14:AB:C5:AE:75:17 (public)
    D:
    D: Adding conn 0x200019c8 to poll list
    D:
    D: Adding conn 0x200019c8 to poll list
    D:
    D: Adding conn 0x200019c8 to poll list
    D: disconnected -> connecting-adv
    D: handle 0 ref 1 -> 2
    D:
    D: Adding conn 0x200019c8 to poll list
    D: handle 0 ref 2 -> 1
    Advertising successfully started
    D:
    D: Adding conn 0x200019c8 to poll list
    D:
    D: Adding conn 0x200019c8 to poll list
    W: opcode 0x2032 status 0x1a
    E: Failed LE Set PHY (-5)
    D: handle 1 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 1 ref 1 -> 2
    D: handle 1 ref 2 -> 1
    D:
    D: Adding conn 0x200019c8 to poll list
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 1 ref 1 -> 2
    D: connected -> disconnect-complete
    D: handle 1 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 1 ref 1 -> 2
    D: disconnect-complete -> disconnected
    D: conn 0x200019c8
    D: handle 1 ref 2 -> 1
    D:
    D: conn 0x200019c8
    Disconnected from 14:AB:C5:AE:75:17 (public) (reason 19)
    Advertising continued
    D: handle 1 ref 1 -> 0
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: connecting-adv -> connected
    Connected 14:AB:C5:AE:75:17 (public)
    D:
    D: Adding conn 0x20001900 to poll list
    D:
    D: Adding conn 0x20001900 to poll list
    D:
    D: Adding conn 0x20001900 to poll list
    D: disconnected -> connecting-adv
    D: handle 0 ref 1 -> 2
    D:
    D: Adding conn 0x20001900 to poll list
    D: handle 0 ref 2 -> 1
    Advertising successfully started
    D:
    D: Adding conn 0x20001900 to poll list
    D:
    D: Adding conn 0x20001900 to poll list
    W: opcode 0x2032 status 0x1a
    E: Failed LE Set PHY (-5)
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D:
    D: Adding conn 0x20001900 to poll list
    D: handle 0 ref 1 -> 2
    D: connected -> disconnect-complete
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: disconnect-complete -> disconnected
    D: conn 0x20001900
    D: handle 0 ref 2 -> 1
    D:
    D: conn 0x20001900
    Disconnected from 14:AB:C5:AE:75:17 (public) (reason 19)
    Advertising continued
    D: handle 0 ref 1 -> 0
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: connecting-adv -> connected
    Connected 14:AB:C5:AE:75:17 (public)
    D:
    D: Adding conn 0x200019c8 to poll list
    D:
    D: Adding conn 0x200019c8 to poll list
    D:
    D: Adding conn 0x200019c8 to poll list
    D: disconnected -> connecting-adv
    D: handle 0 ref 1 -> 2
    D:
    D: Adding conn 0x200019c8 to poll list
    D: handle 0 ref 2 -> 1
    Advertising successfully started
    D:
    D: Adding conn 0x200019c8 to poll list
    D:
    D: Adding conn 0x200019c8 to poll list
    W: opcode 0x2032 status 0x1a
    E: Failed LE Set PHY (-5)
    D: handle 1 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 1 ref 1 -> 2
    D: handle 1 ref 2 -> 1
    D:
    D: Adding conn 0x200019c8 to poll list
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 1 ref 1 -> 2
    D: connected -> disconnect-complete
    D: handle 1 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 1 ref 1 -> 2
    D: disconnect-complete -> disconnected
    D: conn 0x200019c8
    D: handle 1 ref 2 -> 1
    D:
    D: conn 0x200019c8
    Disconnected from 14:AB:C5:AE:75:17 (public) (reason 19)
    Advertising continued
    D: handle 1 ref 1 -> 0
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: connecting-adv -> connected
    Connected 14:AB:C5:AE:75:17 (public)
    D:
    D: Adding conn 0x20001900 to poll list
    D:
    D: Adding conn 0x20001900 to poll list
    D:
    D: Adding conn 0x20001900 to poll list
    D: disconnected -> connecting-adv
    D: handle 0 ref 1 -> 2
    D:
    D: Adding conn 0x20001900 to poll list
    D: handle 0 ref 2 -> 1
    Advertising successfully started
    D:
    D: Adding conn 0x20001900 to poll list
    D:
    D: Adding conn 0x20001900 to poll list
    W: opcode 0x2032 status 0x1a
    E: Failed LE Set PHY (-5)
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D:
    D: Adding conn 0x20001900 to poll list
    D: handle 0 ref 1 -> 2
    D: connected -> disconnect-complete
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: disconnect-complete -> disconnected
    D: conn 0x20001900
    D: handle 0 ref 2 -> 1
    D:
    D: conn 0x20001900
    Disconnected from 14:AB:C5:AE:75:17 (public) (reason 19)
    Advertising continued
    D: handle 0 ref 1 -> 0
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: connecting-adv -> connected
    Connected 14:AB:C5:AE:75:17 (public)
    D:
    D: Adding conn 0x200019c8 to poll list
    D:
    D: Adding conn 0x200019c8 to poll list
    D:
    D: Adding conn 0x200019c8 to poll list
    D: disconnected -> connecting-adv
    D: handle 0 ref 1 -> 2
    D:
    D: Adding conn 0x200019c8 to poll list
    D: handle 0 ref 2 -> 1
    Advertising successfully started
    D:
    D: Adding conn 0x200019c8 to poll list
    D:
    D: Adding conn 0x200019c8 to poll list
    W: opcode 0x2032 status 0x1a
    E: Failed LE Set PHY (-5)
    D: handle 1 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 1 ref 1 -> 2
    D: handle 1 ref 2 -> 1
    D:
    D: Adding conn 0x200019c8 to poll list
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 1 ref 1 -> 2
    D: handle 1 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 1 ref 1 -> 2
    D: connected -> disconnect-complete
    D: handle 1 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 1 ref 1 -> 2
    D: disconnect-complete -> disconnected
    D: conn 0x200019c8
    D: handle 1 ref 2 -> 1
    D:
    D: conn 0x200019c8
    Disconnected from 14:AB:C5:AE:75:17 (public) (reason 19)
    Advertising continued
    D: handle 1 ref 1 -> 0
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: connecting-adv -> connected
    Connected 14:AB:C5:AE:75:17 (public)
    D:
    D: Adding conn 0x20001900 to poll list
    D:
    D: Adding conn 0x20001900 to poll list
    D:
    D: Adding conn 0x20001900 to poll list
    D: disconnected -> connecting-adv
    D: handle 0 ref 1 -> 2
    D:
    D: Adding conn 0x20001900 to poll list
    D: handle 0 ref 2 -> 1
    Advertising successfully started
    D:
    D: Adding conn 0x20001900 to poll list
    D:
    D: Adding conn 0x20001900 to poll list
    W: opcode 0x2032 status 0x1a
    E: Failed LE Set PHY (-5)
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D:
    D: Adding conn 0x20001900 to poll list
    D: handle 0 ref 1 -> 2
    D: connected -> disconnect-complete
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: disconnect-complete -> disconnected
    D: conn 0x20001900
    D: handle 0 ref 2 -> 1
    D:
    D: conn 0x20001900
    Disconnected from 14:AB:C5:AE:75:17 (public) (reason 19)
    Advertising continued
    D: handle 0 ref 1 -> 0
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: connecting-adv -> connected
    Connected 14:AB:C5:AE:75:17 (public)
    D:
    D: Adding conn 0x200019c8 to poll list
    D:
    D: Adding conn 0x200019c8 to poll list
    D:
    D: Adding conn 0x200019c8 to poll list
    D: disconnected -> connecting-adv
    D: handle 0 ref 1 -> 2
    D:
    D: Adding conn 0x200019c8 to poll list
    D: handle 0 ref 2 -> 1
    Advertising successfully started
    D:
    D: Adding conn 0x200019c8 to poll list
    D:
    D: Adding conn 0x200019c8 to poll list
    W: opcode 0x2032 status 0x1a
    E: Failed LE Set PHY (-5)
    D: handle 1 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 1 ref 1 -> 2
    D: handle 1 ref 2 -> 1
    D:
    D: Adding conn 0x200019c8 to poll list
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 1 ref 1 -> 2
    D: handle 1 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 1 ref 1 -> 2
    D: connected -> disconnect-complete
    D: handle 1 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 1 ref 1 -> 2
    D: disconnect-complete -> disconnected
    D: conn 0x200019c8
    D: handle 1 ref 2 -> 1
    D:
    D: conn 0x200019c8
    Disconnected from 14:AB:C5:AE:75:17 (public) (reason 19)
    Advertising continued
    D: handle 1 ref 1 -> 0
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: connecting-adv -> connected
    Connected 14:AB:C5:AE:75:17 (public)
    D:
    D: Adding conn 0x20001900 to poll list
    D:
    D: Adding conn 0x20001900 to poll list
    D:
    D: Adding conn 0x20001900 to poll list
    D: disconnected -> connecting-adv
    D: handle 0 ref 1 -> 2
    D:
    D: Adding conn 0x20001900 to poll list
    D: handle 0 ref 2 -> 1
    Advertising successfully started
    D:
    D: Adding conn 0x20001900 to poll list
    D:
    D: Adding conn 0x20001900 to poll list
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D:
    D: Adding conn 0x20001900 to poll list
    D: handle 0 ref 1 -> 2
    D: connected -> disconnect-complete
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: disconnect-complete -> disconnected
    D: conn 0x20001900
    D: handle 0 ref 2 -> 1
    D:
    D: conn 0x20001900
    Disconnected from 14:AB:C5:AE:75:17 (public) (reason 19)
    Advertising continued
    D: handle 0 ref 1 -> 0
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: connecting-adv -> connected
    Connected 14:AB:C5:AE:75:17 (public)
    D:
    D: Adding conn 0x200019c8 to poll list
    D:
    D: Adding conn 0x200019c8 to poll list
    D:
    D: Adding conn 0x200019c8 to poll list
    D: disconnected -> connecting-adv
    D: handle 0 ref 1 -> 2
    D:
    D: Adding conn 0x200019c8 to poll list
    D: handle 0 ref 2 -> 1
    Advertising successfully started
    D:
    D: Adding conn 0x200019c8 to poll list
    D:
    D: Adding conn 0x200019c8 to poll list
    W: opcode 0x2032 status 0x1a
    E: Failed LE Set PHY (-5)
    D: handle 1 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 1 ref 1 -> 2
    D: handle 1 ref 2 -> 1
    D:
    D: Adding conn 0x200019c8 to poll list
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 1 ref 1 -> 2
    D: connected -> disconnect-complete
    D: handle 1 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 1 ref 1 -> 2
    D: disconnect-complete -> disconnected
    D: conn 0x200019c8
    D: handle 1 ref 2 -> 1
    D:
    D: conn 0x200019c8
    Disconnected from 14:AB:C5:AE:75:17 (public) (reason 19)
    Advertising continued
    D: handle 1 ref 1 -> 0
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: connecting-adv -> connected
    Connected 14:AB:C5:AE:75:17 (public)
    D:
    D: Adding conn 0x20001900 to poll list
    D:
    D: Adding conn 0x20001900 to poll list
    D:
    D: Adding conn 0x20001900 to poll list
    D: disconnected -> connecting-adv
    D: handle 0 ref 1 -> 2
    D:
    D: Adding conn 0x20001900 to poll list
    D: handle 0 ref 2 -> 1
    Advertising successfully started
    D:
    D: Adding conn 0x20001900 to poll list
    D:
    D: Adding conn 0x20001900 to poll list
    W: opcode 0x2032 status 0x1a
    E: Failed LE Set PHY (-5)
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D:
    D: Adding conn 0x20001900 to poll list
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: connected -> disconnect-complete
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: disconnect-complete -> disconnected
    D: conn 0x20001900
    D: handle 0 ref 2 -> 1
    D:
    D: conn 0x20001900
    Disconnected from 14:AB:C5:AE:75:17 (public) (reason 19)
    Advertising continued
    D: handle 0 ref 1 -> 0
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: connecting-adv -> connected
    Connected 14:AB:C5:AE:75:17 (public)
    D:
    D: Adding conn 0x200019c8 to poll list
    D:
    D: Adding conn 0x200019c8 to poll list
    D:
    D: Adding conn 0x200019c8 to poll list
    D: disconnected -> connecting-adv
    D: handle 0 ref 1 -> 2
    D:
    D: Adding conn 0x200019c8 to poll list
    D: handle 0 ref 2 -> 1
    Advertising successfully started
    D:
    D: Adding conn 0x200019c8 to poll list
    D:
    D: Adding conn 0x200019c8 to poll list
    W: opcode 0x2032 status 0x1a
    E: Failed LE Set PHY (-5)
    D: handle 1 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 1 ref 1 -> 2
    D: handle 1 ref 2 -> 1
    D:
    D: Adding conn 0x200019c8 to poll list
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 1 ref 1 -> 2
    D: handle 1 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 1 ref 1 -> 2
    D: connected -> disconnect-complete
    D: handle 1 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 1 ref 1 -> 2
    D: disconnect-complete -> disconnected
    D: conn 0x200019c8
    D: handle 1 ref 2 -> 1
    D:
    D: conn 0x200019c8
    Disconnected from 14:AB:C5:AE:75:17 (public) (reason 19)
    Advertising continued
    D: handle 1 ref 1 -> 0
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: connecting-adv -> connected
    Connected 14:AB:C5:AE:75:17 (public)
    D:
    D: Adding conn 0x20001900 to poll list
    D:
    D: Adding conn 0x20001900 to poll list
    D:
    D: Adding conn 0x20001900 to poll list
    D: disconnected -> connecting-adv
    D: handle 0 ref 1 -> 2
    D:
    D: Adding conn 0x20001900 to poll list
    D: handle 0 ref 2 -> 1
    Advertising successfully started
    D:
    D: Adding conn 0x20001900 to poll list
    D:
    D: Adding conn 0x20001900 to poll list
    W: opcode 0x2032 status 0x1a
    E: Failed LE Set PHY (-5)
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D:
    D: Adding conn 0x20001900 to poll list
    D: handle 0 ref 1 -> 2
    D: connected -> disconnect-complete
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: disconnect-complete -> disconnected
    D: conn 0x20001900
    D: handle 0 ref 2 -> 1
    D:
    D: conn 0x20001900
    Disconnected from 14:AB:C5:AE:75:17 (public) (reason 19)
    Advertising continued
    D: handle 0 ref 1 -> 0
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: connecting-adv -> connected
    Connected 14:AB:C5:AE:75:17 (public)
    D:
    D: Adding conn 0x200019c8 to poll list
    D:
    D: Adding conn 0x200019c8 to poll list
    D:
    D: Adding conn 0x200019c8 to poll list
    D: disconnected -> connecting-adv
    D: handle 0 ref 1 -> 2
    D:
    D: Adding conn 0x200019c8 to poll list
    D: handle 0 ref 2 -> 1
    Advertising successfully started
    D:
    D: Adding conn 0x200019c8 to poll list
    D:
    D: Adding conn 0x200019c8 to poll list
    W: opcode 0x2032 status 0x1a
    E: Failed LE Set PHY (-5)
    D: handle 1 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 1 ref 1 -> 2
    D: handle 1 ref 2 -> 1
    D:
    D: Adding conn 0x200019c8 to poll list
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 1 ref 1 -> 2
    D: handle 1 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 1 ref 1 -> 2
    D: connected -> disconnect-complete
    D: handle 1 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 1 ref 1 -> 2
    D: disconnect-complete -> disconnected
    D: conn 0x200019c8
    D: handle 1 ref 2 -> 1
    D:
    D: conn 0x200019c8
    Disconnected from 14:AB:C5:AE:75:17 (public) (reason 19)
    Advertising continued
    D: handle 1 ref 1 -> 0
    D: handle 0 ref 1 -> 2
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: connecting-adv -> connected
    Connected 14:AB:C5:AE:75:17 (public)
    D:
    D: Adding conn 0x20001900 to poll list
    D:
    D: Adding conn 0x20001900 to poll list
    D:
    D: Adding conn 0x20001900 to poll list
    D: disconnected -> connecting-adv
    D: handle 0 ref 1 -> 2
    D:
    D: Adding conn 0x20001900 to poll list
    D: handle 0 ref 2 -> 1
    Advertising successfully started
    D:
    D: Adding conn 0x20001900 to poll list
    D:
    D: Adding conn 0x20001900 to poll list
    W: opcode 0x2032 status 0x1a
    E: Failed LE Set PHY (-5)
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: connected -> disconnect-complete
    D: handle 0 ref 2 -> 1
    D: handle 0 ref 1 -> 2
    D: disconnect-complete -> disconnected
    D: conn 0x20001900
    D: handle 0 ref 2 -> 1
    D:
    D: conn 0x20001900
    Disconnected from 14:AB:C5:AE:75:17 (public) (reason 21)
    Advertising continued
    D: handle 0 ref 1 -> 0
    
    

    Thanks for updating. But it still remain disconnected.(nothing different)
    Attached log is about "CONFIG_BT_SMP_ALLOW_UNAUTH_OVERWRITE=y."

    BTW I add those two lines to initiate pairing process again when connected.

    bt_set_bondable(true);
    bt_conn_set_security(conn, BT_SECURITY_L4);
    It was not effective for me. "security failed" log is added.

    Do you have another idea? 

    [Log]
    Security failed: 14:AB:C5:AE:75:17 (public) level 1 err 2

  • Hi,

    I was unsuccessfully trying to reproduce this, but now I wonder if I misread the original issue. Did you remove the pairing on Windows or the nRF? If you remove the pairing on the nRF then you must also remove the pairing on Windows in order to proceed. Windows (like iOS and Android) will not allow you to replace an existing bond. (This is because it is a security risk as an attacker can spoof the address of the bonded device and replace the bond).

Reply
  • Hi,

    I was unsuccessfully trying to reproduce this, but now I wonder if I misread the original issue. Did you remove the pairing on Windows or the nRF? If you remove the pairing on the nRF then you must also remove the pairing on Windows in order to proceed. Windows (like iOS and Android) will not allow you to replace an existing bond. (This is because it is a security risk as an attacker can spoof the address of the bonded device and replace the bond).

Children
Related