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,

    I am thinking maybe there is a possibility that the phones you are trying to pair to do not support pairing through "LE secure". Which phones are you using? Nexus 7 and Samsung galaxy S6? From the log output you can see the phone try to connect using security mode 2, they should use security mode 4 (LE Secure).

    LE secure pairing was introduce with Bluetooth 4.2, and from what I found on the internet Samsung S6 only supports Bluetooth 4.1. You can try pairing through Legacy OOB (Button 3) and see if you get the same problem.

    And to find more information while debugging you can change the debug level in the sdk_config.h file to "Debug"

    // <o> NRF_LOG_DEFAULT_LEVEL  - Default Severity level
     
    // <0=> Off 
    // <1=> Error 
    // <2=> Warning 
    // <3=> Info 
    // <4=> Debug 
    
    #ifndef NRF_LOG_DEFAULT_LEVEL
    #define NRF_LOG_DEFAULT_LEVEL 4
    #endif

    And set the Build configuration to the "Debug".

    Best Regards,

    Marjeris

  • Hello I have the same exact problem that HDuc has, and I am using a samsung galaxy s7, which supports Bluetooth 4.2 LE, so the problem is in Nordic MCU Dk side of development. There has to be an issue in the C code, or MCU design.

  • Hi msromero,

    Thank you for your reply.

    I have tested all 3 options: LESC OOB MODE, LEGACY OOB MODE, LEGACY JUST WORKS MODE, but I found the same problem. So, this issue maybe not related to the pairing support through "LE secure". I think almost due to bonding problems.

    When debugging, it asks me about the "nfc_t2t_lib.c" file; I can not find it in the sdk folder, I do not know it's important or not.

  • Hei Nguyen,

    The debugging message about "nfc_t2t_lib.c" is normal. NFC lib is delivered as a linkable library, so we don't have any source files available, just ignore the message.

    Ok so I think I found the problem now. Did you touch the kit with the phone two times? Android erase the bonds the second time the NFC touch the kit, while the LTK is still stored in the DK. So you need to run a "erase all" on the kit before trying again.

    Best Regards,

    Marjeris

  • Hi Marjeris,

    I touch only one time, it connects and disconnects immediately. I do "erase all" on the kit every time before trying. Really, I still can not figure out the reason.

    Have you tried with your android telephone? 

    Is there a problem with the android version or telephone?

Related