1st connection is bonded authenticated encrypted link, but 2nd connection becomes not bonded unencrypted link

I use nRF Connect to connect to nRF52832 device. 1st connection is bonded authenticated encrypted link, but 2nd connection becomes not bonded unencrypted link. Why 1st and 2nd connection are different?

The following is log message of nRF52832 device.

00> <info> app: POWER_ON.
00> <debug> nrf_ble_gatt: Requesting to update ATT MTU to 185 bytes on connection 0x0.
00> <info> app: BLE_GAP_EVT_CONNECTED (1st connection)
00> <debug> app: state=1
00> <debug> nrf_ble_gatt: ATT MTU updated to 185 bytes on connection 0x0 (response).
00> <debug> app: _securityRequestHandler
00> <info> app: BLE_GAP_EVT_SEC_PARAMS_REQUEST
00> <info> app: PM_EVT_CONN_SEC_SUCCEEDED
00> <info> app: Connection secured: role: 1, conn_handle: 0x0, procedure: 1.
00> <debug> nrf_ble_gatt: Requesting to update ATT MTU to 185 bytes on connection 0x0.
00> <info> app: PM_EVT_BONDED_PEER_CONNECTED
00> <info> app: BLE_GAP_EVT_CONNECTED (2nd connection)
00> <debug> app: state=1
00> <debug> nrf_ble_gatt: ATT MTU updated to 185 bytes on connection 0x0 (response).

Parents
  • The ble_app_ancs_c supports bonding out of the box, so if you are using an unmodified version of that, you should be good.''

    Can you do this?

    1. Ensure that you are testing with an unmodified ble_app_ancs_c. If in doubts, program a pre-built hex file from <SDK>\examples\ble_peripheral\ble_app_ancs_c\hex\
    2. Use nRF Connect to connect and initiate pairing. As this should just work I am having problems understanding what you are doing, I suggest making a screen recording showing exactly how you do it.
    3. Please click "OPEN LOG FILE" in the lower bar and upload the complete log here (use Insert - Insert image/video/file). Also, check the log on the nRF side and upload here. That should hopefully tell us more.
Reply
  • The ble_app_ancs_c supports bonding out of the box, so if you are using an unmodified version of that, you should be good.''

    Can you do this?

    1. Ensure that you are testing with an unmodified ble_app_ancs_c. If in doubts, program a pre-built hex file from <SDK>\examples\ble_peripheral\ble_app_ancs_c\hex\
    2. Use nRF Connect to connect and initiate pairing. As this should just work I am having problems understanding what you are doing, I suggest making a screen recording showing exactly how you do it.
    3. Please click "OPEN LOG FILE" in the lower bar and upload the complete log here (use Insert - Insert image/video/file). Also, check the log on the nRF side and upload here. That should hopefully tell us more.
Children
  • 00> BLE_ADV_EVT_WHITELIST_REQUEST
    00> BLE_ADV_EVT_FAST
    00> Hello World!..
    nRF_Connect_ANCS_pairing.txt

  • Hi,

    A few observations.

    1. This is not from the unmodified example, but your code modified code. Can you try an unmodified example first, so that you know that how you do things with nRF Connect for Desktop is correct? Please do this to limit the number of unknowns at a singe time.
    2. The procedure you use from nRF Connect is correct, with one important exception. After clicking the "Pair" button you click "Close" before the operation finishes. Please wait until you see the pairing text go green like this:  . That means the operation has completed (alternatively you will see an error).
    3. After you have tested with the unmodified example, fix you project like I explained in before the weekend. The code you have uploaded here will not work, and pairing will never succeed, as explained then (because you are blocking in your main loop).
  • I click "Close" after the operation finishes this time. But the following error occurred.

     Authentication failed with status BLE_GAP_SEC_STATUS_TIMEOUT

Related