<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>No Connecting After going away</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/83728/no-connecting-after-going-away</link><description>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</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 24 Jan 2022 10:49:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/83728/no-connecting-after-going-away" /><item><title>RE: No Connecting After going away</title><link>https://devzone.nordicsemi.com/thread/349198?ContentTypeID=1</link><pubDate>Mon, 24 Jan 2022 10:49:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7048e3c1-2008-4e8f-ae26-3fdbc88e5904</guid><dc:creator>Karl Ylvisaker</dc:creator><description>[quote user="rezaei"]I try to show RSSI in my app, but after connecting the RSSI is always 0.[/quote]
&lt;p&gt;If I recall correctly you will have to enable RSSI readings before using the get function, if you have not done so already. Also, RSSI is in relation to each packet that the device receives.&lt;br /&gt;&lt;br /&gt;Please keep in mind my earlier comment about RSSI being a poorly accurate measurement for distance. You can find multiple tickets here on the forum discussing this, and how other factors greatly contribute to the fluctuations in RSSI, but it mainly adds up to that the RSSI may be used to categorize the device as either &lt;em&gt;near&lt;/em&gt;, &lt;em&gt;far&lt;/em&gt;, or&amp;nbsp;&lt;em&gt;gone.&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No Connecting After going away</title><link>https://devzone.nordicsemi.com/thread/349050?ContentTypeID=1</link><pubDate>Sat, 22 Jan 2022 08:15:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:afea2c76-9a31-4876-81e1-af1d26583bd2</guid><dc:creator>rezaei</dc:creator><description>&lt;p&gt;Hi Karl,&lt;/p&gt;
&lt;p&gt;I try to show RSSI in my app, but after connecting the RSSI is always 0.&lt;/p&gt;
&lt;p&gt;This is my code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;BleManager.getInstance().connect(mac_id, new BleGattCallback() {
            @Override
            public void onStartConnect() {
                
            }

            @Override
            public void onConnectFail(BleDevice bleDevice, BleException exception) {

            }

            @Override
            public void onConnectSuccess(BleDevice bleDevice, BluetoothGatt gatt, int status) {
                Toast.makeText(getContext(), String.valueOf(bleDevice.getRssi()), Toast.LENGTH_LONG).show();
            }

            @Override
            public void onDisConnected(boolean isActiveDisConnected, BleDevice device, BluetoothGatt gatt, int status) {

            }
        })&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;What do you think?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No Connecting After going away</title><link>https://devzone.nordicsemi.com/thread/348223?ContentTypeID=1</link><pubDate>Tue, 18 Jan 2022 10:02:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9893a09a-2094-4f84-84ba-3f2bd2b6c69b</guid><dc:creator>Karl Ylvisaker</dc:creator><description>[quote user="rezaei"]I have a question. I want to know when I&amp;#39;m going away from the ble area. How can I know that? I want to show this notification.[/quote]
&lt;p&gt;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?&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No Connecting After going away</title><link>https://devzone.nordicsemi.com/thread/348137?ContentTypeID=1</link><pubDate>Mon, 17 Jan 2022 18:58:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f54104c-b3e0-433a-a887-4abc817b9173</guid><dc:creator>rezaei</dc:creator><description>&lt;p&gt;Thank you from your description.&lt;/p&gt;
&lt;p&gt;I have a question. I want to know when I&amp;#39;m going away from the ble area. How can I know that? I want to show this notification.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No Connecting After going away</title><link>https://devzone.nordicsemi.com/thread/348014?ContentTypeID=1</link><pubDate>Mon, 17 Jan 2022 12:05:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8862af1-41f1-489f-8ab4-1beb41075298</guid><dc:creator>Karl Ylvisaker</dc:creator><description>[quote user="rezaei"]Thanks for your replay.[/quote]
&lt;p&gt;No problem at all, I am happy to help!&lt;/p&gt;
[quote user="rezaei"]I came back sooner, so I could connect my phone to the DK.[/quote]
&lt;p&gt;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&amp;nbsp;&lt;em&gt;unlimited advertising duration&amp;nbsp;&lt;/em&gt;- 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.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No Connecting After going away</title><link>https://devzone.nordicsemi.com/thread/348002?ContentTypeID=1</link><pubDate>Mon, 17 Jan 2022 11:38:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e36e9f8b-c4c0-4d2a-b853-cb80143e5ab8</guid><dc:creator>rezaei</dc:creator><description>&lt;p&gt;Hi Karl,&lt;/p&gt;
&lt;p&gt;Thanks for your replay. I came back sooner, so I could connect my phone to the DK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No Connecting After going away</title><link>https://devzone.nordicsemi.com/thread/347977?ContentTypeID=1</link><pubDate>Mon, 17 Jan 2022 10:25:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63a3a89f-ca73-4ac5-95f4-d1f374c554dd</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user=""]&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;What is the trick?&lt;/p&gt;[/quote]
&lt;p&gt;Have you verified that the peripheral device is still advertising when you return to it? How long are you gone for?&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>