No Connecting After going away

Hi everyone,

I implement nrf5_SDK_17.0.2 ble_app_uart example and I use an android app like nRF_Connect to receive the uart data on my phone.

My problem is that when I go away from the place I cannot connect again after coming back. So I need to reset my nrf52840 DK first, and then I can connect my phone to my nrf52840 DK.

What is the trick?

Thanks.

  • Hello,

    My problem is that when I go away from the place I cannot connect again after coming back. So I need to reset my nrf52840 DK first, and then I can connect my phone to my nrf52840 DK.

    What is the trick?

    Have you verified that the peripheral device is still advertising when you return to it? How long are you gone for?
    Could it be that the advertising duration has expired, and so the device has stopped advertising and gone into SYSTEM_OFF sleep? This is the default behavior of the BLE NUS example, if you have not changed this.

    Best regards,
    Karl

  • Hi Karl,

    Thanks for your replay. I came back sooner, so I could connect my phone to the DK.

  • rezaei said:
    Thanks for your replay.

    No problem at all, I am happy to help!

    rezaei said:
    I came back sooner, so I could connect my phone to the DK.

    Great, so then it likely was that the advertising timed out. To avoid this being an issue in the future you could either increase the advertising duration, or set it to 0 which means unlimited advertising duration - which never times out. The main drawback of this is that the device will use a lot of power over time, if there is little to no chance for a connection happening for a certain duration of time.

    Best regards,
    Karl

  • Thank you from your description.

    I have a question. I want to know when I'm going away from the ble area. How can I know that? I want to show this notification.

  • rezaei said:
    I have a question. I want to know when I'm going away from the ble area. How can I know that? I want to show this notification.

    By this, do you mean that you would like to show a notification in your application when you are getting further away from the device, or that would like to show this notification once you are too far away from the device - i.e the connection is broken?
    In the former case, you could potentially use RSSI to judge this, but RSSI is not a very reliable estimate for distance since it is influenced by so many other factors such as line of sight, environment noise, packet reflections etc.

    Best regards,
    Karl

Related