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

Android NFC Pairing Issue

Hello,

I am trying to test using NFC pairing with the nRF52840, but I am having trouble connecting to the device with the built-in android NFC Pairing prompt without the NRF Connect App. I am using the ble_nfc_pairing_reference example and a Google Pixel 3a phone as well.

When I try to connect to the board with the phone, the board will give the following log which appears to be saying the NFC pairing was successful.

<info> app_timer: RTC: initialized.
<info> app: NFC Connection Handover BLE peripheral device example started.
<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: 4
<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> peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Bonding data, action: Update
<info> peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Peer rank, action: Update
<info> peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Central address resolution, action: Update

However, the phone will not actually connect to the device and claim it could not connect. The phone does seem to successfully bond though. (Whenever I try this, I will be mindful of deleting the previous bond information as well)

Now, if I try pairing the board with the NRF connect app, it will work fine. I will bond and connect to the board through the app entirely.

Is there any way I could get the phone to pair successfully with only the Android built-in NFC pairing?

Parents
  • Thank you for confirming this wasn't a phone specific issue. I just tried this example on my Nokia 8.1 and was able to connect with a DK running the ble_nfc_pairing_reference example. I see the same message as you from the board's log, and my phone is able to connect to it. The screenshot below shows that it is connected via Bluetooth in the default Bluetooth menu (sorry about the Norwegian language, but it says "connected devices". 

    What error/message do you see on your phone exactly? I had to disable Bluetooth on my phone in order to discover the NFC device at all, but I think this might be a phone-specific bug.

    Best regards,

    Simon

  • Hi, so I re-evaluated the way my Google Pixel 3a connects and I may be seeing some of the behavior that you are seeing on your phone, but with some quirks in the behavior.

    So as mentioned before, when I try to use the default Bluetooth NFC, my phone is able to successfully bond to the board.

    My phone will say "PAIRING Nordic_NFC_PAIR_REF" and once paired it will say "Connecting Nordic_NFC_PAIR_REF"

    When I look in my bluetooth settings, I see that the device is listed as a "Connected Device"

    But, when I look at the device in my bluetooth settings, the phone does not recognize that it is connected to the board. In this context, I believe the Android OS is using the term "Connected Device" to refer to devices that is has bonded with.

    After a few seconds go by, my phone will send the message "Could not connect Nordic_NFC_PAIR_REF" and when I relook at my Connected devices list, I no longer see the board as a bonded device.

      

    I found a similar issue where something like this was documented on his thread https://devzone.nordicsemi.com/f/nordic-q-a/56739/ble-nfc-pairing-issue 

    The thread seems to suggest that my phone is disconnecting from the board because it does not recognize the service. Is there a work around for this that would allow a phone to recognize the service and stay connected? Specifically a work around for compatibility with the default Android Bluetooth.

    Also when you run the project and connect to it with your phone, does the connection last or does it disconnect after a little while like it is on my phone?

Reply
  • Hi, so I re-evaluated the way my Google Pixel 3a connects and I may be seeing some of the behavior that you are seeing on your phone, but with some quirks in the behavior.

    So as mentioned before, when I try to use the default Bluetooth NFC, my phone is able to successfully bond to the board.

    My phone will say "PAIRING Nordic_NFC_PAIR_REF" and once paired it will say "Connecting Nordic_NFC_PAIR_REF"

    When I look in my bluetooth settings, I see that the device is listed as a "Connected Device"

    But, when I look at the device in my bluetooth settings, the phone does not recognize that it is connected to the board. In this context, I believe the Android OS is using the term "Connected Device" to refer to devices that is has bonded with.

    After a few seconds go by, my phone will send the message "Could not connect Nordic_NFC_PAIR_REF" and when I relook at my Connected devices list, I no longer see the board as a bonded device.

      

    I found a similar issue where something like this was documented on his thread https://devzone.nordicsemi.com/f/nordic-q-a/56739/ble-nfc-pairing-issue 

    The thread seems to suggest that my phone is disconnecting from the board because it does not recognize the service. Is there a work around for this that would allow a phone to recognize the service and stay connected? Specifically a work around for compatibility with the default Android Bluetooth.

    Also when you run the project and connect to it with your phone, does the connection last or does it disconnect after a little while like it is on my phone?

Children
No Data
Related