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

nrf52dk and nrf connect, Autoconnect after bluetooth adapter turned off and on

Hi,

I tried nrf connect and nrf hrs example. I used nrf52DK.
I bonded the device, and connected with autoconnect.
I turned off the nrf 52 DK, and turn on. The nrf connect app on the phone can saw the state when disconnect, and can reconnected after some seconds, so the autoconnect feature worked.
But the autoconnect feature not worked in this scenario:
If when connected together, (phone writes: connected) i turned off the bluetooth adapter (the app wrote bluetooth adapter not turned on, and device state is changed to disconnected), and turned on the bluetooth adapter on my phone (the program not wrote the bluetooth adapter off error), and wait, but the phone not connect automaticaly to nrf 52 DK. If i push the connect button, its working.
So auto connect feature not work properly. If i turn off and on the dev kit, autoconnect works, but if i turn off and on the phones bluetooth adapter, nrf connect not connect automaticaly.
Its an error? Why not work? What can i do to connect automaticaly, after the bluetooth adapter turned off and on?
I want to make an app, which task is reconnect, every scenario, and want to use the autoconnect feature, but its not working as expected.
Can you help?

Thanks,
Janos

Parents
  • Hi Einar,

    I using bonding, and the autoconnect feature not work with bluetooth off and on, and airplane mode. And the nrf hrs example using bonding too, but not working as expected, not reconnect automaticaly if i toggle airplane mode or bluetooth. But i bonded the nrf52dk with the phone, and not working. I tried my custom app, but i tried with nrf connect app too, and not working. Whats the problem? I using bonding. I connect with autoconnect=true. Why not reconnect after toggling bluetooth or airplane mode? Can you give a try with an nrf 52 dk and your phone, with nrf connect app? Try to bond, and connect with autoconnect. If you take the device out of range, the phone can connect after found the nrf52 dk, but if you toggle bluetooth or airplane mode, the phone not connect back automaticaly, you need to push to connect button. I think this is a bug in the nrf ble lib. You sayd the lib support this feature, and i see the broadcastReceiver in the lib, which can tell the lib if the bluetooth state changes. So if the lib supports this feature, and i use bonding, and connect with autoconnect=true, why not work?

    Thanks,
    Janos

Reply Children
No Data
Related