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

Using Android BLE library, getting into a connecting -> disconnecting (timeout) situation. nRF app seems to help.

Hi,

We're using the Android BLE library from Nordic. It really helped us handle a lot of the things we didn't want to think about handling on the bluetooth stack. (Thank you)

We've been experiencing some weird issues where the sensors will get into a connecting -> disconnecting issues, effectively timing out on connect.

The flow is : 

  • we scan for devices using the compact scanner (nordic)
  • we try to connect to one or more devices
  • the connection attempt would time out

The interesting thing we've found is that if we use nRF connect application (Android) on the same device (phone), and try to connect to the device it works. And surprisingly, right after connecting and disconnecting using nRF connect app, the devices will connect to the Android app (also using BLE library from Nordic) successfully as well. Are we missing to do anything properly. What are the steps on nRF connect app on connect and disconnect? We are thinking it might be that we got the driver or the sensor into a weird state and nRF connect app connection fixes it somehow?

Running out of ideas because we're tried many different things such as putting delays in possible places. Thanks!

Related