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

Bonded phone with iOS 13.4 unable to connect to the nRF52 with deleted bonding information

Hello there,

We faced the new issue after the iPhones are updated to the iOS 13.4. I tried to find the issue solving on the forum and looks like it is the new one.

We have the following environment:

  1. MCU nRF52832
  2. nRF SDK 13.1
  3. SoftDevice nRF52 s132 4.0.5

The issue can be reproduced as follows:

  1. Pair and bond the iPhone with the device.
  2. Delete the peer information from the device.
  3. Attempt to connect the iPhone to the device.

Before the iPhone was updated to the iOS 13.4 all works fine, the repairing process is started, peer data updated on the iPhone. For now the iPhone is not able to finish the connection process, it shows the error: "Peer removed pairing information".

I performed some debugging and can see that from starting of connection to fail the device handles 3 ble events (p_ble_evt->header.evt_id):

16 - BLE_GAP_EVT_CONNECTED

20 - BLE_GAP_EVT_SEC_INFO_REQUEST

17 - BLE_GAP_EVT_DISCONNECTED

I debugged the handler with evt_id = 20 and can see, that the peer manager does not find the peer, sends reply and starts security process (source code bellow marked green):

    // All return values from the following can be safely ignored.
    err_code = sd_ble_gap_sec_info_reply(p_gap_evt->conn_handle, p_enc_info, NULL, NULL);

    if (err_code != NRF_SUCCESS)
    {
        evt.evt_id                        = SMD_EVT_ERROR_UNEXPECTED;
        evt.params.error_unexpected.error = err_code;

        evt_send(&evt);
    }
    else if (p_enc_info == NULL)
    {
        evt.evt_id                                  = SMD_EVT_LINK_ENCRYPTION_FAILED;
        evt.params.link_encryption_failed.error     = PM_CONN_SEC_ERROR_PIN_OR_KEY_MISSING;
        evt.params.link_encryption_failed.error_src = BLE_GAP_SEC_STATUS_SOURCE_LOCAL;

        evt_send(&evt);

        sec_proc_start(p_gap_evt->conn_handle, peer_id, false, false, false);
    }
    else
    {
        sec_start_send(p_gap_evt->conn_handle, PM_LINK_SECURED_PROCEDURE_ENCRYPTION);

        sec_proc_start(p_gap_evt->conn_handle, peer_id, err_code == NRF_SUCCESS, false, false);
    }

The next event we got the disconnection event.

For now we are not able affect this behavior somehow from the device and phone sides. The only possible solution is to go to the BL settings on the phone and forget the device. It is not good way - the best way to handle this without the user interaction.

Probalby you already have a solution how to handle this without the user interaction. Can you, please, help with solving this issue?

Parents
  • Hi.

    What you are seeing is the expected behavior here. If the bond information is erased on the nRF and the peer manager doens't have a stored bond for the phone, it will decline the connection.

    You would need to erase the bond information on the phone as well in order to reconnect. I tested with an iOS device on iOS 13.3 and I'm seeing the same as you.

    A workaround could be to change the address on the device, as that would make the device appear as a new device on the phone, but in my opinion that seems to be just as much work as simply deleting the bond information on the phone side.

    Note; You can set allow_repair = true. This will allow you to repair the phone if the bond information is deleted on only the phone and not the nRF device. However, this will not help for the case you described above.

    Best regards,
    Joakim

  • Hi Joakim,

    We tested again the repairing with the device from iPhone with iOS 13.3.1 and it works fine. The iPhone updated its bonding information.

    Starting iOS 13.4 something changed and the phone after failed connection does not restart the repairing process. I checked this with the SDK 16 version, the issue is reproduced.

    Asking the user to delete the bonded device in the settings is not good experience for him. We need this issue fixed or may be at least some workaround.

    Can you please help us solve this?

    Regards, Aleksey.

  • Hi again.

    Did some research and talked to some colleagues about this.

    I still stand by my statements below, that the phone will not and should not connect and re-pair automatically if the bonding information is deleted on the nRF. This is implemented as a security feature.

Reply Children
Related