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

Authorization NFC BLE pairing issues

HI all,

I'm trying to use the ble_nfc_pairing_reference example from SDK 15.0.0

I installed microECC and can now build the example using GCC on Windows.

A first pairing of Huawei Android Smartphone and the Rigado BMD-350 Eval Board is working as expected.

However, everytime I'm trying to re-connect the two devices, the smartphone shows me one of the following errors:

* Invalid PIN or

* Connection rejected

While debugging the code I was able to track these two issues down to authorization error codes 132 and 133 in ble_evt_handler (ble_m.c).

Do you have any ideas what could cause these errors?

Thanks in advance,

Lea

  • Hi,

    This most likely happens because the phone does not recognize the service that is running on the board and does not store bonding information. The nRF board stores bonding data when the devices connect, but on second attempt, the phone is not able to provide the correct LTK.

    Best regards,
    Jørgen

  • Hi Jørgen,

    What service do you mean? It seems to be exaclty as you describe it: The phone seems to 'forget' the board / not store the bonding information at all, BUT it does display it in the list of 'Paired Devices'..!?

    Do you have an idea how we could deal with the behaviour of the smartphone (Android 7 btw). It seems to be our only chance to find an appropriate solution on the board, as we won't be able to change Android's BT connection dialog...

    Best,

    Lea

  • I mean the BLE service, in this case the Heart Rate Service (HRS). I did some more testing. Actually, the phone seems to store the LTK. If you do the initial pairing/bonding with NFC, and then touch the NFC again, the example will try to bond again. This will be rejected, as there is conflicting devices stored. If you reset the board, you can still touch the phone to the NFC antenna to start advertising on the board. You can then open nRF Connect on the phone and connect with the already bonded device.

  • Actually we're not using the HRS example but the "ble_nfc_pairing_Reference" project. We are experiencing the same as you did, but this is not a behaviour that we are willing to publish to customers (having to reset the board before every re-connect). Instead, we are looking for a solution that can be used over and over again.

    We've been testing some existing products and compared their behaviour to the current state of the demo project. I tried to sketch both cases below to illustrate our expectations and our problems with the eval board / demo project.

    Can you give me a hint, how we can achieve a behaviour comparable to the example device in the drawing without having to manipulate your library functions?

  • I think you misunderstood me. There is no need to reset the board. What I meant is that even if you reset the board, you can still connect with an app (for instance nRF Connect) after you have touched the NFC to start advertising. I did some more testing and it seems that it is default behavior in Android to delete the bonding information when new pairing data is received on NFC. 

    What service(s) are you running on the device? There is no autoconnect feature on the phone for any service, this is only available for natively supported services (for instance HID service, etc.). You will have to implement autoconnect yourself in your app on the phone.

    You will have to modify the firmware to not do pairing when there is an already paired device, or only pair if a button is pressed etc. You can then implement "advertising on NFC field detect"/disconnect when NFC is touched and in connection.

    The NFC pairing library is created only for that purpose, to do pairing. It is not intended for connecting/disconnecting like you describe in the figure.

Related