This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Bonding connection on one side

Hello. I have build by application on nRF52832 based on ble_app_template example (SDK 15.1, softdevce s132 6.1.0).
I've configurated Peer Manager library as it recommended here with configurations Pairing, no bonding.

Sometimes, when I connect it to Android smartphone to nRF Connect or to my custom application or through bluetooth manager in the settings, smartphone bonded to device, but device not bonded smartphone (as it should be). Why this happens? Why smartphone bonding to device? Even if smartphone try to bonding to device, why smartphone think that connection is successfuly bonded? How can I control it?

The problem is that, in this case, smartphone staying subscribed in some characteristics, but device don't know about that. So, how can I disable bonding on smartphone side?

Parents
  • Hi Arsenii, 

    I assume you set SEC_PARAM_BOND = 0 in your configuration ? 

    What did you mean by " device not bonded smartphone (as it should be)" ? So you want to bond to the smart phone or not ? 

    I assume you want the link to be encrypted (pairing) but no bonding (each peer forgets the other after disconnection) 

    How did you check that the phone bonded to the device ? 

    Which phone did you use to test with ? Also please make sure you have service changed characteristic in your attribute table, to avoid any caching of the table. 

  • Hi Hung, thanks for reply.

    I assume you set SEC_PARAM_BOND = 0 in your configuration ? 

    Yes.

    What did you mean by " device not bonded smartphone (as it should be)" ? So you want to bond to the smart phone or not ? 

    I mean that device not bonded connection with smartphone and I expected this, but smartphone bonded this connection. So I don't want bondong to smartphone.

    I assume you want the link to be encrypted (pairing) but no bonding (each peer forgets the other after disconnection) 

    Yes, exactly.

    How did you check that the phone bonded to the device ? 

    I see my nRF52832 in rembered devices and also I see "BONDED" string in nRF Connect.

    Which phone did you use to test with ?

    I use Xiaomi Redmi 6 and Samsung J4.

    Also please make sure you have service changed characteristic in your attribute table, to avoid any caching of the table. 

    Hm..how can I check it?

  • I would suggest to capture a sniffer trace to see what actually happens over the air. 

    When you reconnect to the phone, do you see the phone re-pair to the device or it can actually re-use the bond information  ? 

    To enable service changed characteristic you can set NRF_SDH_BLE_SERVICE_CHANGED = 1 and PM_SERVICE_CHANGED_ENABLED  = 1 in sdk_config.h

  • I would suggest to capture a sniffer trace to see what actually happens over the air. 

    I'ven't got a sniffer trace.

    When you reconnect to the phone, do you see the phone re-pair to the device or it can actually re-use the bond information  ? 

    It actually re-use the bond information, because if before disconnection I've subscibed on some characteristics, when I reconnected, smartphone think that it still subscribed.

    To enable service changed characteristic you can set NRF_SDH_BLE_SERVICE_CHANGED = 1 and PM_SERVICE_CHANGED_ENABLED  = 1 in sdk_config.h

    Yes, it was established.

  • If you have a nRF52832 DK you can use it as a sniffer. If you have a nRF52832 custom board and you can connect the same UART pins to PC you can also use it as the sniffer. It would be very useful to have the sniffer trace. 

    I attached here a firmware of the proximity app with pairing and no bonding, please test on your device. Please note that you need to erase the chip completely before you test, otherwise if you have bond information on the device, the device will try to re-bond to the phone. 

    You need to flash softdevice S132 v6.1.0

     ble_app_prox_pair_nobond.hex

Reply Children
Related