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

HID over GATT on Android disconnects after 30 seconds

I am using nrf51822 with PCA 10001, SoftDevice S110 6.0 and SDK 5.2. I modified the HID example to send media keys, basically I just changed the report map and added a few functions for sending media keys. This all works great on iOS 7, I am able to connect and can send the media keys just fine. The iOS device will stay connected indefinitely.

However, on Android, I am seeing disconnection issues. I can connect just fine, and things work for about 30 seconds, but then it just disconnects. It does not matter if I press buttons (send media keys) or not, the connection is always lost after roughly 30 seconds. I looked at the ble_evt_t on disconnect and the reason code for disconnect is 8. As far as I can tell, that is HCI timeout.

I tried disabling the battery service, just to see if that helped. It didn't.

I tried using the sniffer application to capture the events. However, I must not be using it properly because nothing is captured once the android phone connects. I see the advertisements before the connection, but as soon as I connect, nothing. When the disconnect happens, I see hundreds of advertisements packets flood in from the nrf51822 to the Android phone, but I don't see anything while the connection is established.

Is there something different I need to do with Android to avoid this disconnection? Is there something else I can do to debug the problem? Right now, I am sort of stuck as I am not sure how to get more information about the problem. Please let me know. Thanks

Parents Reply Children
  • Thanks for the response. Yes, I already had it set to false, and I don't think it is directly related to the connection parameter update.

    I am keeping the interval between connection parameter updates extremely high. If I do that, and I have Wifi turned off in the Android phone, it will stay connected for a very long time. However, if I wait a few minutes press a button and send a HID key, there is about a 50% chance it will disconnect. Also, if I turn on Wifi in the Android handset, it will likely disconnect without any other action. So disconnects are happening outside of just connection parameter updates.

    I have tried the RFDuino, which is using nrf51822 and a custom service on GATT as far as I can tell, with this exact phone. It will stay connected forever even with Wifi on. So there must be a way to keep the connection up. Is there an Android specific example provided by Nordic?

Related