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 Janos,

    Kovacs.janos256 said:
    The autoconnection depends bonding, or not?

    You have to use bonding in this case. If you don't use bonding, then this is expected behavior. The android phone will typically flush all Bluetooth related information when you toggle airplane mode, and then it will not have any information about which to reconnect to. So the proper way to fix this is to use bonding.

    Kovacs.janos256 said:
    How can i get more information about my phones connection handling mechanics?

    It might be better to ask in a Android forum for Android specific questions, or contact the phone manufacturer for very specific questions related to specific devices. (This does not seem relevant here though, if the problem is just that you are not using bonding.).

    Kovacs.janos256 said:
    Can you give me more information about autoconnection, and the nordic lib autoconnection feature?

    There is not much more to say. It will auto connect, but not to non-bonded devices when you toggle airplane mode. I do not believe that is possible. You could however expand your app to scan in the background and connect to the device. Then it would not really be automatically, but you could probably implement this in your app so that it seems automatic for the user.

    Br,

    Einar

Reply
  • Hi Janos,

    Kovacs.janos256 said:
    The autoconnection depends bonding, or not?

    You have to use bonding in this case. If you don't use bonding, then this is expected behavior. The android phone will typically flush all Bluetooth related information when you toggle airplane mode, and then it will not have any information about which to reconnect to. So the proper way to fix this is to use bonding.

    Kovacs.janos256 said:
    How can i get more information about my phones connection handling mechanics?

    It might be better to ask in a Android forum for Android specific questions, or contact the phone manufacturer for very specific questions related to specific devices. (This does not seem relevant here though, if the problem is just that you are not using bonding.).

    Kovacs.janos256 said:
    Can you give me more information about autoconnection, and the nordic lib autoconnection feature?

    There is not much more to say. It will auto connect, but not to non-bonded devices when you toggle airplane mode. I do not believe that is possible. You could however expand your app to scan in the background and connect to the device. Then it would not really be automatically, but you could probably implement this in your app so that it seems automatic for the user.

    Br,

    Einar

Children
No Data
Related