nRF52 SDK16 device discovery problem in iOS

Hi Community, 

Recently I have started testing my BLE peripheral running HRS with iPhone. My device is running SDK16 on nRF52 SoC. This is working perfectly with Android mobiles. \

I searched the community for this issue and found below thread which mentioned MTU size exchange could be a problem.  

https://devzone.nordicsemi.com/f/nordic-q-a/66256/nrf52-sdk16-service-discovery-doesn-t-happen-on-ios

But MTU exchange is present in nrf_ble_gatt_on_ble_evt callback as shown below. 

case BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST:
on_exchange_mtu_request_evt(p_gatt, p_ble_evt);
break;

I have attached nRF connect log for reference. Can someone help me understand what could be the issue? 

NRF logs.eml

Best

Lakshmikanth. 

Parents
  • Hi

    I just tried the Blinky example from nRF5 SDK v16.0.0 myself on an iPhone 11, iOS v15.2.1 with the nRFConnect app and did not have any issues connecting and discovering its services, so this seems very strange. Here's the .hex file I used:

    5657.ble_app_blinky_pca10059_s140.hex

    Could it be that the bonding information to this Dongle is already stored on your iPhone perhaps. If so please try deleting bonding information before trying to connect again. Since this is a Dongle, you can also try recovering the Dongle entirely as described in the bottom part of our Dongle Programming tutorial here. If that doesn't help either, what iPhone and iOS version are you using specifically?

    Best regards,

    Simon

  • Thanks for the reply. 

    I am performing on and off Airplane mode to forget the bonding for every run. On every run iPhone starts scanning the devices and it only connects after I allow it to. Is there anything I need to perform to forget bonding? 

    I checked with the hex file provided by you. Observed same issue. I have attached nRF connect log from iOS for your reference. 

    Scanner On.
    Device Scanned.
    [Callback] centralManager(central, didDiscover: peripheral, advertisementData: ["kCBAdvDataLocalName": Nordic_Blinky, "kCBAdvDataIsConnectable": 1], rssi: -57)
    Device Appearance switched from Generic to Blinky.
    Attempting to connect...
    cbCentralManager.connect()
    [Callback] centralManager(central, didConnect: peripheral)
    Connected.
    Discovering Services...
    peripheral.discoverServices(nil)
    [Callback] peripheral(peripheral, didDiscoverServices: nil)
    Discovered Nordic LED and Button Service Services.
    Discovering Characteristics for Nordic LED and Button Service...
    peripheral.discoverCharacteristics(nil, for: 00001523-1212-EFDE-1523-785FEABCD123)
    [Callback] peripheral(peripheral, didDiscoverCharacteristicsFor: 00001523-1212-EFDE-1523-785FEABCD123, error: nil)
    Discovering Descriptors for Characteristic Blinky Button State...
    peripheral.discoverDescriptors(for: 00001524-1212-EFDE-1523-785FEABCD123)
    Discovered Characteristics Blinky Button State, Blinky LED State for Service Nordic LED and Button Service.
    Discovering Descriptors for Characteristic Blinky LED State...
    peripheral.discoverDescriptors(for: 00001525-1212-EFDE-1523-785FEABCD123)
    [Callback] peripheral(peripheral, didDiscoverDescriptorsFor: 00001524-1212-EFDE-1523-785FEABCD123, error: nil)
    Discovered Client Characteristic Configuration for Characteristic Blinky Button State
    [Callback] peripheral(peripheral, didDiscoverDescriptorsFor: 00001525-1212-EFDE-1523-785FEABCD123, error: nil)
    Characteristic Blinky LED State has no Descriptors.
    Writing 0x01 to Characteristic 00001524-1212-EFDE-1523-785FEABCD123
    peripheral.setNotifyValue(0x01, forCharacteristic: 00001524-1212-EFDE-1523-785FEABCD123)
    Setting Boolean true for Notifying Characteristic Blinky Button State
    [Callback] peripheral(peripheral, didUpdateNotificationStateFor: 00001524-1212-EFDE-1523-785FEABCD123, error: nil)
    Notifying State of Blinky Button State Changed to: true
    Writing 0x to Descriptor 2902
    peripheral.setNotifyValue(0x, forCharacteristic: 00001524-1212-EFDE-1523-785FEABCD123)
    Writing Boolean false to Descriptor Client Characteristic Configuration
    [Callback] peripheral(peripheral, didUpdateNotificationStateFor: 00001524-1212-EFDE-1523-785FEABCD123, error: nil)
    Notifying State of Blinky Button State Changed to: false
    Writing 0x to Characteristic 00001525-1212-EFDE-1523-785FEABCD123
    peripheral.writeValue(0x, forCharacteristic: 00001525-1212-EFDE-1523-785FEABCD123)
    Writing value Invalid Data to Characteristic Blinky LED State
    [Callback] peripheral(peripheral, didWriteValueForCharacteristic: 00001525-1212-EFDE-1523-785FEABCD123, error: nil)
    Scanner Off.
    [Callback] centralManager(central, didDisconnectPeripheral: peripheral, error: The connection has timed out unexpectedly.)
    Disconnected.
    Scanner On.
    Device Scanned.
    [Callback] centralManager(central, didDiscover: peripheral, advertisementData: ["kCBAdvDataLocalName": Nordic_Blinky, "kCBAdvDataIsConnectable": 1, "kCBAdvDataServiceUUIDs": <__NSArrayM 0x281d83030>(
    00001523-1212-EFDE-1523-785FEABCD123
    )
    ], rssi: -55)
    Device Appearance switched from Generic to Blinky.
    Attempting to connect...
    cbCentralManager.connect()
    [Callback] centralManager(central, didConnect: peripheral)
    Connected.
    Discovering Services...
    peripheral.discoverServices(nil)
    [Callback] peripheral(peripheral, didDiscoverServices: nil)
    Discovered Nordic LED and Button Service Services.
    Discovering Characteristics for Nordic LED and Button Service...
    peripheral.discoverCharacteristics(nil, for: 00001523-1212-EFDE-1523-785FEABCD123)
    [Callback] peripheral(peripheral, didDiscoverCharacteristicsFor: 00001523-1212-EFDE-1523-785FEABCD123, error: nil)
    Discovering Descriptors for Characteristic Blinky Button State...
    peripheral.discoverDescriptors(for: 00001524-1212-EFDE-1523-785FEABCD123)
    Discovered Characteristics Blinky Button State, Blinky LED State for Service Nordic LED and Button Service.
    Discovering Descriptors for Characteristic Blinky LED State...
    peripheral.discoverDescriptors(for: 00001525-1212-EFDE-1523-785FEABCD123)
    [Callback] peripheral(peripheral, didDiscoverDescriptorsFor: 00001524-1212-EFDE-1523-785FEABCD123, error: nil)
    Discovered Client Characteristic Configuration for Characteristic Blinky Button State
    [Callback] peripheral(peripheral, didDiscoverDescriptorsFor: 00001525-1212-EFDE-1523-785FEABCD123, error: nil)
    Characteristic Blinky LED State has no Descriptors.
    Scanner Off.
    Disconnecting...
    cbCentralManager.cancelPeripheralConnection()
    [Callback] centralManager(central, didDisconnectPeripheral: peripheral, error: nil)
    Disconnected.
    Attempting to connect...
    cbCentralManager.connect()
    [Callback] centralManager(central, didConnect: peripheral)
    Connected.
    Discovering Services...
    peripheral.discoverServices(nil)
    [Callback] peripheral(peripheral, didDiscoverServices: nil)
    Discovered Nordic LED and Button Service Services.
    Discovering Characteristics for Nordic LED and Button Service...
    peripheral.discoverCharacteristics(nil, for: 00001523-1212-EFDE-1523-785FEABCD123)
    [Callback] peripheral(peripheral, didDiscoverCharacteristicsFor: 00001523-1212-EFDE-1523-785FEABCD123, error: nil)
    Discovering Descriptors for Characteristic Blinky Button State...
    peripheral.discoverDescriptors(for: 00001524-1212-EFDE-1523-785FEABCD123)
    Discovering Descriptors for Characteristic Blinky LED State...
    peripheral.discoverDescriptors(for: 00001525-1212-EFDE-1523-785FEABCD123)
    [Callback] peripheral(peripheral, didDiscoverDescriptorsFor: 00001524-1212-EFDE-1523-785FEABCD123, error: nil)
    [Callback] peripheral(peripheral, didDiscoverDescriptorsFor: 00001525-1212-EFDE-1523-785FEABCD123, error: nil)
    Discovered Characteristics Blinky Button State, Blinky LED State for Service Nordic LED and Button Service.
    Discovered Client Characteristic Configuration for Characteristic Blinky Button State
    Characteristic Blinky LED State has no Descriptors.

    Since this is a Dongle, you can also try recovering the Dongle entirely as described in the bottom part of our Dongle Programming tutorial here.
    I don't understand the above. Could you please let me know why do we need to do this? I am able to program the dongle after I put it in boot mode by pressing reset.

    I am using iPhone 6 with Software version is 12.5.5. 

    Best

    Lakshmi

Reply
  • Thanks for the reply. 

    I am performing on and off Airplane mode to forget the bonding for every run. On every run iPhone starts scanning the devices and it only connects after I allow it to. Is there anything I need to perform to forget bonding? 

    I checked with the hex file provided by you. Observed same issue. I have attached nRF connect log from iOS for your reference. 

    Scanner On.
    Device Scanned.
    [Callback] centralManager(central, didDiscover: peripheral, advertisementData: ["kCBAdvDataLocalName": Nordic_Blinky, "kCBAdvDataIsConnectable": 1], rssi: -57)
    Device Appearance switched from Generic to Blinky.
    Attempting to connect...
    cbCentralManager.connect()
    [Callback] centralManager(central, didConnect: peripheral)
    Connected.
    Discovering Services...
    peripheral.discoverServices(nil)
    [Callback] peripheral(peripheral, didDiscoverServices: nil)
    Discovered Nordic LED and Button Service Services.
    Discovering Characteristics for Nordic LED and Button Service...
    peripheral.discoverCharacteristics(nil, for: 00001523-1212-EFDE-1523-785FEABCD123)
    [Callback] peripheral(peripheral, didDiscoverCharacteristicsFor: 00001523-1212-EFDE-1523-785FEABCD123, error: nil)
    Discovering Descriptors for Characteristic Blinky Button State...
    peripheral.discoverDescriptors(for: 00001524-1212-EFDE-1523-785FEABCD123)
    Discovered Characteristics Blinky Button State, Blinky LED State for Service Nordic LED and Button Service.
    Discovering Descriptors for Characteristic Blinky LED State...
    peripheral.discoverDescriptors(for: 00001525-1212-EFDE-1523-785FEABCD123)
    [Callback] peripheral(peripheral, didDiscoverDescriptorsFor: 00001524-1212-EFDE-1523-785FEABCD123, error: nil)
    Discovered Client Characteristic Configuration for Characteristic Blinky Button State
    [Callback] peripheral(peripheral, didDiscoverDescriptorsFor: 00001525-1212-EFDE-1523-785FEABCD123, error: nil)
    Characteristic Blinky LED State has no Descriptors.
    Writing 0x01 to Characteristic 00001524-1212-EFDE-1523-785FEABCD123
    peripheral.setNotifyValue(0x01, forCharacteristic: 00001524-1212-EFDE-1523-785FEABCD123)
    Setting Boolean true for Notifying Characteristic Blinky Button State
    [Callback] peripheral(peripheral, didUpdateNotificationStateFor: 00001524-1212-EFDE-1523-785FEABCD123, error: nil)
    Notifying State of Blinky Button State Changed to: true
    Writing 0x to Descriptor 2902
    peripheral.setNotifyValue(0x, forCharacteristic: 00001524-1212-EFDE-1523-785FEABCD123)
    Writing Boolean false to Descriptor Client Characteristic Configuration
    [Callback] peripheral(peripheral, didUpdateNotificationStateFor: 00001524-1212-EFDE-1523-785FEABCD123, error: nil)
    Notifying State of Blinky Button State Changed to: false
    Writing 0x to Characteristic 00001525-1212-EFDE-1523-785FEABCD123
    peripheral.writeValue(0x, forCharacteristic: 00001525-1212-EFDE-1523-785FEABCD123)
    Writing value Invalid Data to Characteristic Blinky LED State
    [Callback] peripheral(peripheral, didWriteValueForCharacteristic: 00001525-1212-EFDE-1523-785FEABCD123, error: nil)
    Scanner Off.
    [Callback] centralManager(central, didDisconnectPeripheral: peripheral, error: The connection has timed out unexpectedly.)
    Disconnected.
    Scanner On.
    Device Scanned.
    [Callback] centralManager(central, didDiscover: peripheral, advertisementData: ["kCBAdvDataLocalName": Nordic_Blinky, "kCBAdvDataIsConnectable": 1, "kCBAdvDataServiceUUIDs": <__NSArrayM 0x281d83030>(
    00001523-1212-EFDE-1523-785FEABCD123
    )
    ], rssi: -55)
    Device Appearance switched from Generic to Blinky.
    Attempting to connect...
    cbCentralManager.connect()
    [Callback] centralManager(central, didConnect: peripheral)
    Connected.
    Discovering Services...
    peripheral.discoverServices(nil)
    [Callback] peripheral(peripheral, didDiscoverServices: nil)
    Discovered Nordic LED and Button Service Services.
    Discovering Characteristics for Nordic LED and Button Service...
    peripheral.discoverCharacteristics(nil, for: 00001523-1212-EFDE-1523-785FEABCD123)
    [Callback] peripheral(peripheral, didDiscoverCharacteristicsFor: 00001523-1212-EFDE-1523-785FEABCD123, error: nil)
    Discovering Descriptors for Characteristic Blinky Button State...
    peripheral.discoverDescriptors(for: 00001524-1212-EFDE-1523-785FEABCD123)
    Discovered Characteristics Blinky Button State, Blinky LED State for Service Nordic LED and Button Service.
    Discovering Descriptors for Characteristic Blinky LED State...
    peripheral.discoverDescriptors(for: 00001525-1212-EFDE-1523-785FEABCD123)
    [Callback] peripheral(peripheral, didDiscoverDescriptorsFor: 00001524-1212-EFDE-1523-785FEABCD123, error: nil)
    Discovered Client Characteristic Configuration for Characteristic Blinky Button State
    [Callback] peripheral(peripheral, didDiscoverDescriptorsFor: 00001525-1212-EFDE-1523-785FEABCD123, error: nil)
    Characteristic Blinky LED State has no Descriptors.
    Scanner Off.
    Disconnecting...
    cbCentralManager.cancelPeripheralConnection()
    [Callback] centralManager(central, didDisconnectPeripheral: peripheral, error: nil)
    Disconnected.
    Attempting to connect...
    cbCentralManager.connect()
    [Callback] centralManager(central, didConnect: peripheral)
    Connected.
    Discovering Services...
    peripheral.discoverServices(nil)
    [Callback] peripheral(peripheral, didDiscoverServices: nil)
    Discovered Nordic LED and Button Service Services.
    Discovering Characteristics for Nordic LED and Button Service...
    peripheral.discoverCharacteristics(nil, for: 00001523-1212-EFDE-1523-785FEABCD123)
    [Callback] peripheral(peripheral, didDiscoverCharacteristicsFor: 00001523-1212-EFDE-1523-785FEABCD123, error: nil)
    Discovering Descriptors for Characteristic Blinky Button State...
    peripheral.discoverDescriptors(for: 00001524-1212-EFDE-1523-785FEABCD123)
    Discovering Descriptors for Characteristic Blinky LED State...
    peripheral.discoverDescriptors(for: 00001525-1212-EFDE-1523-785FEABCD123)
    [Callback] peripheral(peripheral, didDiscoverDescriptorsFor: 00001524-1212-EFDE-1523-785FEABCD123, error: nil)
    [Callback] peripheral(peripheral, didDiscoverDescriptorsFor: 00001525-1212-EFDE-1523-785FEABCD123, error: nil)
    Discovered Characteristics Blinky Button State, Blinky LED State for Service Nordic LED and Button Service.
    Discovered Client Characteristic Configuration for Characteristic Blinky Button State
    Characteristic Blinky LED State has no Descriptors.

    Since this is a Dongle, you can also try recovering the Dongle entirely as described in the bottom part of our Dongle Programming tutorial here.
    I don't understand the above. Could you please let me know why do we need to do this? I am able to program the dongle after I put it in boot mode by pressing reset.

    I am using iPhone 6 with Software version is 12.5.5. 

    Best

    Lakshmi

Children
No Data
Related