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

NFC BLE pairing connection issue

Hi all,

I'm testing the ble_nfc_pairing_reference example from SDK 15.2.0

I have installed microECC and then run succesfully the application using Segger Embedded Studio on Windows.

At the first pairing, my Samsung g6 Android Smartphone can connect with the nrf52832 board, but they disconnect almost immediately (about 1 or 2 seconds). The RTT log captured from Debug interface are:

"<info> app: NFC Connection Handover BLE peripheral device example started.
<info> BUTTONS_M: LESC OOB MODE!
<info> BLE_M: Fast advertising.
<info> BLE_M: Connected.
<info> nrf_ble_lesc: Calling sd_ble_gap_lesc_dhkey_reply on conn_handle: 0
<info> BLE_M: BLE_GAP_EVT_CONN_SEC_UPDATE
<info> BLE_M: Security mode: 2
<info> peer_manager_handler: Connection secured: role: Peripheral, conn_handle: 0, procedure: Bonding
<info> BLE_M: BLE_GAP_EVT_AUTH_STATUS
<info> BLE_M: Authorization succeeded!
<info> BLE_M: Disonnected"

And then, at the next pairing, they can not connect:

"<info> BLE_M: Connected.
<info> peer_manager_handler: Connection security failed: role: Peripheral, conn_handle: 0x0, procedure: Bonding, error: 133
<info> BLE_M: BLE_GAP_EVT_AUTH_STATUS
<info> BLE_M: Authorization failed with code: 133!
<info> peer_manager_handler: Connection security failed: role: Peripheral, conn_handle: 0x0, procedure: Bonding, error: 133
<info> BLE_M: BLE_GAP_EVT_AUTH_STATUS
<info> BLE_M: Authorization failed with code: 133!
<info> BLE_M: Disonnected "

I have tried also with Nexus 7 and found the same problem. So, I have 2 questions:

1. At the first pairing, why they disconnect almost immediately after a successful pairing? How we can do to keep the connection

2. Why they can not reconnect after losing the connection ? Do you have any ideas what could cause these errors? I wonder if I have missed an important step in configuration and coding.

Can you help me?
Many thanks in advance.

  • Hi Nguyen,

    Sorry for the late reply. Yes, I don't have any issues when testing with my phone. But as I said, from the log output you attached you can see the phone is trying to connect using another security mode than the one in the example. Can you attach the log output when you use legacy OOB and legacy just works mode so I can see what it looks like?

    Best Regards,

    Marjeris

  • Hi Marjeris,

    I copy below the log output for 3 modes:

    <info> app: NFC Connection Handover BLE peripheral device example started.
    <info> BUTTONS_M: LESC OOB MODE!
    <info> BLE_M: Fast advertising.
    <info> BLE_M: Connected.
    <info> nrf_ble_lesc: Calling sd_ble_gap_lesc_dhkey_reply on conn_handle: 0
    <info> BLE_M: BLE_GAP_EVT_CONN_SEC_UPDATE
    <info> BLE_M: Security mode: 2
    <info> peer_manager_handler: Connection secured: role: Peripheral, conn_handle: 0, procedure: Bonding
    <info> BLE_M: BLE_GAP_EVT_AUTH_STATUS
    <info> BLE_M: Authorization succeeded!
    <info> BLE_M: Disconnected
    <info> BLE_M: Disconnect reason: 19

    <info> app: NFC Connection Handover BLE peripheral device example started.
    <info> BUTTONS_M: LEGACY OOB MODE!
    <info> BLE_M: Fast advertising.
    <info> BLE_M: Connected.
    <info> peer_manager_handler: Connection security failed: role: Peripheral, conn_handle: 0x0, procedure: Bonding, error: 132
    <info> BLE_M: BLE_GAP_EVT_AUTH_STATUS
    <info> BLE_M: Authorization failed with code: 132!
    <info> BLE_M: Disconnected
    <info> BLE_M: Disconnect reason: 19

    <info> app: NFC Connection Handover BLE peripheral device example started.
    <info> BUTTONS_M: LEGACY JUST WORKS MODE!
    <info> BLE_M: Fast advertising.
    <info> BLE_M: Connected.
    <info> BLE_M: BLE_GAP_EVT_CONN_SEC_UPDATE
    <info> BLE_M: Security mode: 2
    <info> peer_manager_handler: Connection secured: role: Peripheral, conn_handle: 0, procedure: Bonding
    <info> BLE_M: BLE_GAP_EVT_AUTH_STATUS
    <info> BLE_M: Authorization succeeded!
    <info> BLE_M: Disconnected
    <info> BLE_M: Disconnect reason: 19

    Hope that you can find something.

    I can not connect directly with the phone, so I must use Adafruit Tag Reader + BLE central device as an intermediate device and the phone will send the command and data to the peripheral through this central device. But it is much more complicated.

  • Hi, any way you can provide a ble sniffer log that shows what is happening on air when using legacy OOB and legacy just works? Both the initial bond and the failing reconnect.

  • Hi Marjeris,

    I do exactly face the problem you indicate that it definitely fails to connect the same device for the second time. Will it be fixed in the future or Are there any workaround solutions for this issue ? Thanks in advice.

  • Hi,
    This is most likely an issue with the phone implementation, Please try to capture sniffer logs and create a new thread if you are seeing similar behavior.

Related