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

Custom BLE app failing to connect to device.

Hi There,


Custom xamarin bluetooth app [using Plugin.BLE] is failing to connect to the device using ConnectToKnownDeviceAsync approach. User uses tap-to-pair and tries to make a connection to the device.

When user does tap-to-pair we are getting device GUID from the nfc tag payload and trying to connect to the device using ConnectToKnownDeviceAsync method. What we have found is many times the connection fails, if we use nrfConnect app and make a connection and then try with our custom app then it will connect with out any issue.

we want to know what steps we are missing that nrfConnect app is enabling. This issue happens whenever we reboot the device. At this moment we are testing with Android 10.

Any help is highly appreciated.

Thanks,
Balaji

  • Hi Balaji

    So you're saying that you have to connect and pair over the nRFConnect app first in order to connect using your  custom app at all? I'm not an Android expert, but I think the ConnectToKnownDeviceAsync function will require you to be paired to the device in the first place in order to connect afterwards. Can you provide some more information on how you're doing pairing, both on the Android side and on your nRF52 device. 

    The fact that this issue happen when you're rebooting the device (I assume you refer to the nRF device) may suggest that the pairing information is deleted whenever you turn the device off. Or by "reboot" do you mean that you do a full flash erase and reprogram the nRF entirely? If so, it makes sense that the nRF won't be able to "connect to a known device" as it wouldn't be known anymore.

    Best regards,

    Simon

  • Hi Simon,

    sorry for the delay in replaying. I guess the bonding/pairing was not there after pairing the connection is happening. Thanks for your help.

    Regards,

    Balaji

Related