I have a BLE peripheral device (for which I control the firmware) and two mobile apps acting as centrals, one on Android, the other on iOS 8.1.
The Android app works fine. The iOS does not. It will spontaneously disconnect some time after connection. The error is:
Code=6 "The connection has timed out unexpectedly."
The time between connection and this disconnection is random. I've measured from 40s to 4m30s.
All the peripheral device is doing with the BLE connection is writing some firmware logging messages to the mobile app UI. Just a few writes to that one characteristic in quick succession every few minutes. There is no error in the peripheral device firmware.
How do I find the cause of the disconnection?
After some extensive support from Nordic Semiconductor, the manufacturer of the BLE module on the peripheral, we're pretty sure the cause of this is an inaccurate clock on the iPhone 5C BLE module. That is, it's less accurate than stated in the connection request. Here's my question on the Nordic forums:
https://devzone.nordicsemi.com/question/51258/ios-8-disconnection-code6-the-connection-has-timed-out-unexpectedly/
So I was facing this problem with Microchip BM78 Bluetooth module talking with iOS. I found this tech note which was very helpful: https://developer.apple.com/library/archive/qa/qa1931/_index.html
These settings are flashed onto the BM78 module. Here are the Apple 'rules' from the above tech note:
My values (working well):
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With