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, i have the same problem. And i'm really curious to know the answer to the previous question: "I'm not sure how is it possible to receive Indications if i'm not enabling any client feature in my device" ?

    Thx

  • Hi,

    To sum up, the issue is that the smartphone app has a GATT server, and it sends indications to the nRF device, even if the nRF device has changed application to something not expecting indications?

    Note that the nRF device, by default, will always use the same BLE address. So it might be the smartphone remembering from a previous session that the device of that address had enabled indications. However, from what I understand that should not happen unless the device is bonded... So if that is indeed what is happening then there is something wrong either in the app or in the BLE stack of the smartphone. It would still be worth trying the workaround from a previous answer in this thread:

    ivnn said:
    to solve this issue go to Android Settings->Bluetooth->Paired devices-> and unpair your dev

    Regards,
    Terje

Reply
  • Hi,

    To sum up, the issue is that the smartphone app has a GATT server, and it sends indications to the nRF device, even if the nRF device has changed application to something not expecting indications?

    Note that the nRF device, by default, will always use the same BLE address. So it might be the smartphone remembering from a previous session that the device of that address had enabled indications. However, from what I understand that should not happen unless the device is bonded... So if that is indeed what is happening then there is something wrong either in the app or in the BLE stack of the smartphone. It would still be worth trying the workaround from a previous answer in this thread:

    ivnn said:
    to solve this issue go to Android Settings->Bluetooth->Paired devices-> and unpair your dev

    Regards,
    Terje

Children
No Data
Related