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

nRF Connect for android disconnects with Error 22: 'gatt conn terminate local host'

Hi,

I'm testing stability of my firmware. As a part of tests I'm trying to maintain long term (multiple days) connection between nRF52 and nRF Connect for Android app running on Xiaomi Mi 2 (BLE5.0 capable hardware with Android 8.0). Every 24h or so I'm getting Error 22 code and nRF Connect disconnects. From nRF52 side everything looks ok, no asserts or error codes. Softdevice events look as Android phone has gracefully shut down the connection. What might be an issue? How could I approach debugging this further?

Parents
  • Hi, did you try with a different phone? Was your phone connected to power during the test? Could it be the Doze mode? 

    Are you using bonding? If so, you could advertise directly when it gets disconnected and Android should reconnect, I guess.

    nRF Connect doesn't disconnect. It just displays events that it receives from the system...

  • The phone was connected to the charger. I'm pretty confident that this is not doze related issue because nRFConnect is added to power saving exceptions and as far as I can tell the app wasn't killed (unless this works differently in Android 8.0). I'll try different phone next week just to be sure. 

    This setup doesn't use bonding. As for reconnecting there will be auto reconnect procedure in the app but point of this exercise is to detect if nRF52 reboots or hangs. Early versions of this firmware had tendency to disappear from BLE after several weeks (no connection, no advertising).

    I'll try to record sniffer trace of the disconnection, maybe this will tell us more.

Reply
  • The phone was connected to the charger. I'm pretty confident that this is not doze related issue because nRFConnect is added to power saving exceptions and as far as I can tell the app wasn't killed (unless this works differently in Android 8.0). I'll try different phone next week just to be sure. 

    This setup doesn't use bonding. As for reconnecting there will be auto reconnect procedure in the app but point of this exercise is to detect if nRF52 reboots or hangs. Early versions of this firmware had tendency to disappear from BLE after several weeks (no connection, no advertising).

    I'll try to record sniffer trace of the disconnection, maybe this will tell us more.

Children
Related