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

No communication on second connection with iOS if using short connection interval

  • Processor: ANNA-B112 (nRF52832 based)
  • Embedded SDK: nRF5_SDK_15.3.0_59ac345
  • SoftDevice: s132_nrf52_6.1.1_softdevice.hex
  • iOS version: 12.4.1
  • mobile device: iPhone 5s
  • IDE: Segger Embedded Studio
  • Dev Platform: MacOS

I have firmware which works fine with my iOS app when using a slow connection interval (105 min, 210 max). When trying to improve throughput I am finding that while the first connection works fine the second does not always communicate. This appears dependent on the amount of data transferred during the first connection. (Small data transfer => success on subsequent connection, large data transfer => failure).

The value of the connection parameters adhere to the guidelines spelled out in Accessory Design Guidelines

Communication between the app and firmware is a command/response protocol using Google protobuf messages. On the second connection the app will send it's first command to the firmware, the firmware sends it's response and then nothing. (I'm seeing BLE_GATTS_EVT_HVN_TX_COMPLETE events for the response). Once the connections start failing in this way, the only means of getting things to work again is to delete the app, forget the peripheral, restart bluetooth and the firmware.

It is not clear to me which component is responsible for the problem and to be honest I am a loss at the procedure for determining the cause. I've been using Wireshark with the Nordic nRF Sniffer to collect packets but have been finding it difficult to interpret the results. (I've attached it for good measure sensor data then fail.pcapng)  It is especially annoying that the extension is unable to decrypt packets midway through the connection. Also, The extension only loads if I start Wireshark from the command line???)

At this point I believe the notifications are getting through to iOS but perhaps not being delivered to the app. Can anyone suggest any tools/debug settings which will tell me if this is or is not the case? 

I was not expecting to have to do forensics at this level.

Related