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

iOS BLE not showing passcode popup

Hi Guys,

I need to connect to a BLE device using NRF52480 using passcode (6 digit pincode)

on Android it works just fine, I attempt to connect and displays the popup for entering the code.

on iOS nothing happens, I can only see the UART service and cannot connect.. I also tried to read, write, subscribe to the cccd but nothing happens.

I have tried to discover services but I cannot because I am not connected... (see logs below)

I have searched everywhere and in all related question in Nordic Q&A forum and couldn't find any solution for my issue.
I have also checked the glucose example you provided and it failed.

This is very urgent for my company and I need to get this working ASAP. Please help me

I am using iPhone 11 with iOS 14.4

Is there a specific configuration that you know of that I need to set in the peripheral in order for it to work? I have tried a lot of combinations with no success.

I get the following errors on the mobile side:


discoverServices, ERROR: PlatformException(flutter_reactive_ble.Central.(unknown context at $1079e3cf0).Failure:1, The operation couldn’t be completed. (flutter_reactive_ble.Central.(unknown context at $1079e3cf0).Failure error 1.), {}, null)


flutter: readCharacteristic, err: Exception: GenericFailure<CharacteristicValueUpdateError>(code: CharacteristicValueUpdateError.unknown, message: "A peripheral F4A9ECC7-D985-E28A-18F6-9C35F931679A is unknown (make sure it has been discovered)")


flutter: readCharacteristic, err: Exception: GenericFailure<CharacteristicValueUpdateError>(code: CharacteristicValueUpdateError.unknown, message: "A peripheral F4A9ECC7-D985-E28A-18F6-9C35F931679A is unknown (make sure it has been discovered)")

Best regards,

Asaf

Parents
  • Hello,

    Try forgetting the device from the phone's settings.

    If you want the devices to pair using a passcode, you should have at least one characteristic that requires encryption with MITM protection. Have you specified this in one of your characteristics?

    Also make sure to delete the bonding information on the nRF. The easiest way to do that is to erase the chip using "nrfjprog --eraseall" (nRF Command Line Tools) and re-programming it.

    What may happen is that the phone was connected to this device earlier, and discovered and cached the services. If you added a service later, it may still think it only has the original services. Phones act a bit different on how long they keep this data. An easy way to check if this is the issue is to test with another phone and see if you get the same issue. Then try to erase the service data by forgetting the device. To be sure, you can also try to completely turn off the Bluetooth on the phone from the phones settings (not just the "drag up menu", which doesn't really turn the bluetooth off. It rather turns off some of the functionality. You will note that it is only whited out, and not turned off, as if you disable it from the settings).

    See if that helps, and let me know if it doesn't.

    Best regards,

    Edvin

  • Hi Edvin, thanks for the reply.

    The Rx/Tx characteristics are with MITM. The iPhone cannot discover these services. on Android I can see them without connecting


    The UART contains the 2 characteristics with the MITM.

    The Ble device is waiting for passcode, but when I attempt to connect using the iPhone nothing happens.. when I try to read, write or do anything it throws the errors from original post.

    We are also forgetting the bonding information, (pm_peers_delete)

    Do you have any idea what can go wrong? Where can we get an example of the configuration required for iPhone device to know that we require a passcode for bonding?

    Asaf

  • Hi Edvin - issue is solved.

    The problem was that the case of BLE_GAP_EVT_PHY_UPDATE_REQUEST event was under #ifdef S140, so it was a disabled code.

    Can you please explain what is the propose of this code, and how did it work with Android?

    Another fix was setting SEC_PARAM_MITM and SEC_PARAM_LESC to 1, and SEC_PARAM_IO_CAPABILITIES to BLE_GAP_IO_CAPS_DISPLAY_ONLY. Again - I can't understand how did it work with Android.

    Finally - under nfc_ble_pair_lib.c file - I had to set m_sec_param.mitm to 1, under case NFC_PAIRING_MODE_LESC_JUST_WORKS and NFC_PAIRING_MODE_LESC_OOB, even though I don't think it's the right thing to do, but it's the only way to fix that.

    Can you please give me your inputs regarding the fixes? Can I do something else regarding the last one?

    Thanks!! 

  • This is a bit outside the topic of the issue in this post. Probably, the reason that it behaved different was because one phone requested 2MBPS, and the other one didn't. 

     

    Roei said:
    I had to set m_sec_param.mitm to 1, under case NFC_PAIRING_MODE_LESC_JUST_WORKS

    Why are you using the NFC pairing file? Note that you didn't mention NFC until now. NFC is an OOB in itself, so it wouldn't typically prompt a passkey. I suggest you fetch your inspiration from the ble_app_gls example, which requires a passkey.

    Best regards,

    Edvin

  • Ok,

    Can you please tell me about BLE_GAP_EVT_PHY_UPDATE_REQUEST? What does it do and what is the reason that Android didn't require that?

    Thanks for your help!

  • That is also outside this topic, but it is a request to change the PHY (physical layer) from the default 1MBPS and probably to 2MBPS. It gives a more efficient link with higher throughput. As long as the devices are fairly close, it also gives a lower power consumption, because it spends less time on the radio transmitting the same amount of data.

  • Ok,

    Just to understand - in my application - under BLE_GAP_EVT_PHY_UPDATE_REQUEST, I can see that rx_phys and tx_phys are set to BLE_GAP_PHY_AUTO. What does that mean? Who will decide about the MBPS parameter in that case?

    Thanks!!

Reply Children
No Data
Related