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

Cannot connect to nRF52840 from iPhone/iPad running iOS 14 using nRF Connect App

Hi, 

As iOS developer, I'm facing a really strange issue : 

Using the nRF Connect app, I try to connect my BLE device, with success or not depending my iPhone/iPad configuration; you can see the detail below

  • iPad mini 1 - iOS 12.4.5 
  • iPad Air 3 - iOS 14 
  • iPad Air 4 - iOS 14.2 
  • iPad Pro 11 - iOS 14.2 
  • iPhone 6s - iOS 14.2  
  • iPhone 8 - iOS 13.3.1  
  • iPhone 8 - iOS 14.3 
  • iPhone 11 Pro - iOS 14.2 

All the devices which fails to connect (stuck in "connecting" state), are "Bluetooth 5.0 technology" according to Apple

Important thing to note, is that an iPhone 8 running on iOS 13 can succeed to connect. An iPhone 8 running on iOS 14 fails to connect.

These results are not random and produce the same output everytime.

To summarise, the problem seems linked only to iOS 14, but this is not true for all devices (It works perfectly fine on iPhone 6s and iPhone 11 Pro running iOS 14.2).

Could somebody guide me on why this is happening ?

Thanks for your input :)

  • Hi, 

    You can find some logs generate et tested with the original code from Nordic  (ble_thread_dyn_mtd_coap_cli) and nrfConnect. Chip used is nrf52840.

    Inside the .zip file, you will find logs from successful connection, but also logs where connection fails.

    Wireshark.zip

  • I am seeing the same behavior.

    With my peripheral embedded device under the debugger I can see a connection request go through and the connection seems to be properly established (from the peripheral's perspective). I have not seen any issues on an Android device. Curiously, the iPhone SE (1st Gen) works with both iOS 13 and 14. 

    's capture shows that the central app and peripheral device establish a connection and keep the connection alive with Empty PDU packets.

    Could it be that the iOS apps are not handling a connection event correctly which leaves it stuck in the "connecting" state?

    • iPhone 7 - iOS 13.5.1 
    • iPhone SE (1st Gen) - iOS 13.5.1 
    • iPhone SE (1st Gen) iOS 14.3 
    • iPhone 11 ProMax - iOS 14.0.1 
    • iPhone 11 - iOS 14.3 
    • iPad Air (4th Gen) - iOS 14.3 
    • Samsung Galaxy Note 20 - Android   
    • LG Nexus 5X - Android 8.1.0  
  • Sorry for the late reply.

    It looks like the issue is that your BLE device is not responding to LL_PHY_REQ which some IOS centrals are querrying for.

    Can you please add a response to that request as below in your ble_event_handler in you app

            case BLE_GAP_EVT_PHY_UPDATE_REQUEST:
            {
                NRF_LOG_DEBUG("PHY update request.");
                ble_gap_phys_t const phys =
                {
                    .rx_phys = BLE_GAP_PHY_AUTO,
                    .tx_phys = BLE_GAP_PHY_AUTO,
                };
                err_code = sd_ble_gap_phy_update(p_ble_evt->evt.gap_evt.conn_handle, &phys);
                APP_ERROR_CHECK(err_code);
            } br

    and see if that works.

  • Hi, thanks for your feedback,

    Indeed with little change, it's now working perfectly on my iOS devices !

    Thanks a lot ! 

  • Turns out I handle the BLE_GAP_EVT_PHY_UPDATE_REQUEST case in all of my embedded applications except for this one!

    Note that this also works with iOS if you want to use PHY2MBPS.

    case BLE_GAP_EVT_PHY_UPDATE_REQUEST:
        
        NRF_LOG_DEBUG("PHY update request.");
        ble_gap_phys_t const phys =
        {
            .rx_phys = BLE_GAP_PHY_2MBPS,
            .tx_phys = BLE_GAP_PHY_2MBPS, 
        };
        err_code = sd_ble_gap_phy_update(p_ble_evt->evt.gap_evt.conn_handle, &phys);
        APP_ERROR_CHECK(err_code);

Related