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?

  • Hello,

    I am using the default project the ble_nfc_pairing_reference example with "Just Works" Pairing.

    But I ended up trying the BLE NFC Pairing with the two other experimental projects (ble_app_hids_keyboard_pairing_nfc and ble_app_hrs_nfc_pairing) and I actually saw a successful connection with the ble_app_hids_keyboard_pairing_nfc project. But when I tried the ble_app_hrs_nfc_pairing project, I saw the same behavior I was getting with the ble_nfc_pairing_reference project. Also if I run the non-NFC version the ble_app_hrs project, I'll see a similar behavior where I connected to the device through BLE and when I check my connected device, it does not seem to be actually connected.

      

    I am suspecting that maybe on some phones (such as the Google Pixel 3a or the Samsung Galaxy 7), the default Android Bluetooth is only compatible with some services, otherwise it will disconnect/not connect fully. Hence the ble_app_hids_keyboard_pairing_nfc project was successful since my Google Pixel 3a and Samsung Galaxy 7 are compatible with that service.

    Would you be able to verify my suspicion?

  • Yes, this sounds reasonable. The same is the case for most Windows devices as well, filtering out Bluetooth devices that are "unknown" services, so I believe that's what you're seeing as well. You can test to confirm this by trying to connect to I.E. the ble_app_hrs example (the default one) using the Google Pixel's Bluetooth instead of nRFConnect. 

    Best regards,

    Simon

Related