Bonding information with bootloader

Hello all,

I have this problem:
when I add support for OTA my bonding information are canceled after power on. Without ota all is perfect.

Example:
- Turn on the device;
- pair it with phone;
- use the device (everything is good);
- turn it off;
- I turn the device on again, and it is no longer paired with the phone. I have to delete the pairing from the phone's Bluetooth list and pair them again. I have to do this procedure every time I turn off the device. Why is this happening? Is there a solution to avoid this?

Thanks in advance.

Best regards

Parents
  • Hi, 

    Do you use the Bluetooth setting for key storing in your application? Please take a look at this DevAcademy course Lesson 5 – Security in Bluetooth LE communication/Exercise 2.  

    Regards,
    Amanda H.

  • Hello Amanda,

    Thanks al lot. I was using setting for key storing.

    Now I have fixed it.
    Thanks again.

  • Hello Amanda,

    sorry to border you agan but i have this problem.
    I do not receive "disconnected" callback after bonding with Android.
    If I restart the device, everything is ok. I have this problem only after bonding and with Android.

    If I use iOS everything is ok.

    I have used the peripheral_lbs example, i have changed only:
    BT_GATT_PERM_WRITE to BT_GATT_PERM_WRITE_ENCRYPT (in lbs.h file) just to have the pairing when i'll go to write on that characteristic.

    Can you help me?

    Bluetooth initialized<CR><LF>
    I: Identity: E4:B3:9D:F1:7E:1F (random)<CR><LF>
    I: HCI: version 5.4 (0x0d) revision 0x118f, manufacturer 0x0059<CR><LF>
    I: LMP: version 5.4 (0x0d) subver 0x118f<CR><LF>
    Advertising successfully started<CR><LF>
    Connected<CR><LF>
    Passkey for 7B:AD:BF:A4:E9:EB (random): 588282<CR><LF>
    Security changed: 7B:AD:BF:A4:E9:EB (random) level 4<CR><LF>
    Pairing completed: 94:45:60:2A:DD:EA (public), bonded: 1<CR><LF>
    
    I have closed lightblue app. But I do not have received "disconnected" collaback
    
    
    Restart the device:
    <NUL>*** Booting nRF Connect SDK 3758bcbfa5cd ***<CR><LF>
    Starting Bluetooth Peripheral LBS example<CR><LF>
    I: 8 Sectors of 4096 bytes<CR><LF>
    I: alloc wra: 0, f88<CR><LF>
    I: data wra: 0, c0<CR><LF>
    I: SoftDevice Controller build revision: <CR><LF>
    I: 36 f0 e5 0e 87 68 48 fb |6....hH.<CR><LF>
    I: 02 fd 9f 82 cc 32 e5 7b |.....2.{<CR><LF>
    I: 91 b1 5c ed             |..\.    <CR><LF>
    I: HW Platform: Nordic Semiconductor (0x0002)<CR><LF>
    I: HW Variant: nRF52x (0x0002)<CR><LF>
    I: Firmware: Standard Bluetooth controller (0x00) Version 54.58864 Build 1214809870<CR><LF>
    I: No ID address. App must call settings_load()<CR><LF>
    Bluetooth initialized<CR><LF>
    I: Identity: E4:B3:9D:F1:7E:1F (random)<CR><LF>
    I: HCI: version 5.4 (0x0d) revision 0x118f, manufacturer 0x0059<CR><LF>
    I: LMP: version 5.4 (0x0d) subver 0x118f<CR><LF>
    Advertising successfully started<CR><LF>
    Connected<CR><LF>
    Security changed: 94:45:60:2A:DD:EA (public) level 4<CR><LF>
    Disconnected (reason 19)<CR><LF>
    
    Everything is working good

Reply
  • Hello Amanda,

    sorry to border you agan but i have this problem.
    I do not receive "disconnected" callback after bonding with Android.
    If I restart the device, everything is ok. I have this problem only after bonding and with Android.

    If I use iOS everything is ok.

    I have used the peripheral_lbs example, i have changed only:
    BT_GATT_PERM_WRITE to BT_GATT_PERM_WRITE_ENCRYPT (in lbs.h file) just to have the pairing when i'll go to write on that characteristic.

    Can you help me?

    Bluetooth initialized<CR><LF>
    I: Identity: E4:B3:9D:F1:7E:1F (random)<CR><LF>
    I: HCI: version 5.4 (0x0d) revision 0x118f, manufacturer 0x0059<CR><LF>
    I: LMP: version 5.4 (0x0d) subver 0x118f<CR><LF>
    Advertising successfully started<CR><LF>
    Connected<CR><LF>
    Passkey for 7B:AD:BF:A4:E9:EB (random): 588282<CR><LF>
    Security changed: 7B:AD:BF:A4:E9:EB (random) level 4<CR><LF>
    Pairing completed: 94:45:60:2A:DD:EA (public), bonded: 1<CR><LF>
    
    I have closed lightblue app. But I do not have received "disconnected" collaback
    
    
    Restart the device:
    <NUL>*** Booting nRF Connect SDK 3758bcbfa5cd ***<CR><LF>
    Starting Bluetooth Peripheral LBS example<CR><LF>
    I: 8 Sectors of 4096 bytes<CR><LF>
    I: alloc wra: 0, f88<CR><LF>
    I: data wra: 0, c0<CR><LF>
    I: SoftDevice Controller build revision: <CR><LF>
    I: 36 f0 e5 0e 87 68 48 fb |6....hH.<CR><LF>
    I: 02 fd 9f 82 cc 32 e5 7b |.....2.{<CR><LF>
    I: 91 b1 5c ed             |..\.    <CR><LF>
    I: HW Platform: Nordic Semiconductor (0x0002)<CR><LF>
    I: HW Variant: nRF52x (0x0002)<CR><LF>
    I: Firmware: Standard Bluetooth controller (0x00) Version 54.58864 Build 1214809870<CR><LF>
    I: No ID address. App must call settings_load()<CR><LF>
    Bluetooth initialized<CR><LF>
    I: Identity: E4:B3:9D:F1:7E:1F (random)<CR><LF>
    I: HCI: version 5.4 (0x0d) revision 0x118f, manufacturer 0x0059<CR><LF>
    I: LMP: version 5.4 (0x0d) subver 0x118f<CR><LF>
    Advertising successfully started<CR><LF>
    Connected<CR><LF>
    Security changed: 94:45:60:2A:DD:EA (public) level 4<CR><LF>
    Disconnected (reason 19)<CR><LF>
    
    Everything is working good

Children
Related