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

    Have you tried doing what Vidar first recommends in the ticket you link to, to clear the cache by forgetting nRF devices in the Bluetooth settings before trying to connect? From the log, it doesn't seem like the error is triggered until you try enabling notifications for one of the characteristics, so it doesn't seem like the discovery process is the issue to me. Unfortunately it seems to report an "Unknown error" code, which doesn't tell us much of value. Do you have an nRF52 DK you can try using as a peripheral, so we can get a log from the nRF side as well? Maybe that's able to tell us more about what exactly is failing? You can also try taking a sniffer trace (using the nRF Sniffer for example) so we can get some details of what's going on over the air exactly.

    Regarding the MTU size that is mentioned, iOS devices generally won't accept MTU sizes larger than 184 bytes if I recall correctly, so if your nRF52 is trying to set it higher than this, that might be what's going wrong in your connection.

    Best regards,

    Simon

  • Hi Simonr,

    Did you get a chance to look into this? It is bit urgent. Any help is highly appreciated.

    Thanks

    Lakshmi

  • Also I have programmed my nRF52840 dongle with blinky application and check. But I am seeing same errors as my custom application. 

    Attached is the iOS nRF connect log. 

    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.

Reply
  • Also I have programmed my nRF52840 dongle with blinky application and check. But I am seeing same errors as my custom application. 

    Attached is the iOS nRF connect log. 

    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.

Children
No Data
Related