<?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>Occasional Slow Disconnect</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/13049/occasional-slow-disconnect</link><description>We have an application that requires a fairly quick disconnect (under 250msec) when the RSSI exceeds a threshold, for example -80db. Unfortunately, around 1 out of every 4 disconnects is taking over 4sec. This is the time from when the Peripheral executes</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 12 Apr 2016 06:34:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/13049/occasional-slow-disconnect" /><item><title>RE: Occasional Slow Disconnect</title><link>https://devzone.nordicsemi.com/thread/49748?ContentTypeID=1</link><pubDate>Tue, 12 Apr 2016 06:34:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:946e90cc-1566-44fd-a82a-a51571a98aa8</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;Okay, I see. If you are able to transfer data, you should be able to disconnect the link as well. In that case, it would be very nice to use the sniffer, to check what is being transferred over the air. What goes wrong when you use the sniffer?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Occasional Slow Disconnect</title><link>https://devzone.nordicsemi.com/thread/49747?ContentTypeID=1</link><pubDate>Mon, 11 Apr 2016 15:08:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d51cba90-1adf-4aa3-9be8-7497ae0bb788</guid><dc:creator>karl</dc:creator><description>&lt;p&gt;Both Central and Peripheral devices are nRF51.  I&amp;#39;m measuring the RSSI on the Peripheral device.  The reason I was suspicious of the disconnect logic is because 200ms before the disconnect, I&amp;#39;m able to successfully transfer 12 20-byte data packets.  So if it was a weak signal issue preventing the disconnect packets from getting across, why are the data packets able to make it!?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Occasional Slow Disconnect</title><link>https://devzone.nordicsemi.com/thread/49749?ContentTypeID=1</link><pubDate>Mon, 11 Apr 2016 07:06:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41afcbd0-059a-455a-a80b-bf2ea4239a14</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;In BLE, all packets have to be ACKed in the link layer. If a transmitted packet hasn&amp;#39;t been ACKed, the transmitted packet will be re-transmitted until an ACK or until connection supervision timeout.
It seems likely that too far distance is the reason for the slow disconnect.&lt;/p&gt;
&lt;p&gt;At which device do you measure the -70 dBm RSSI? At the nRF51 or the other device?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Occasional Slow Disconnect</title><link>https://devzone.nordicsemi.com/thread/49746?ContentTypeID=1</link><pubDate>Fri, 08 Apr 2016 19:18:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77b94d9b-abcf-44e8-a67f-e7a52112011a</guid><dc:creator>karl</dc:creator><description>&lt;p&gt;You are correct, it appears a timeout is occurring.  The connection supervision timeout is set to 4sec and I do see the reason code 0x22 in the disconnect event when the problem happens.&lt;/p&gt;
&lt;p&gt;Also, sd_ble_gap_disconnect never returns an error.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve noticed the timeout appears to never happen if the RSSI is below -70db.  So that could indicate  either the disconnection request or response packets are getting lost.  Whats your logic for the disconnect? How robust is it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Occasional Slow Disconnect</title><link>https://devzone.nordicsemi.com/thread/49745?ContentTypeID=1</link><pubDate>Fri, 08 Apr 2016 08:57:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:82325ab8-83ff-4186-9c30-5dfc82b7f83c</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;When using sd_ble_gap_disconnect(..) the disconnect should be immediate. Which error code does sd_ble_gap_disconnect() return?&lt;/p&gt;
&lt;p&gt;If it takes 4s before the BLE_GAP_EVT_DISCONNECTED occur, a timeout could be the reason for the disconnect. What is the connection supervision timeout?&lt;/p&gt;
&lt;p&gt;When the BLE_GAP_EVT_DISCONNECTED occur, which disconnect reason does it contain?
(ble_evt_t -&amp;gt; ble_gap_evt_t -&amp;gt; ble_gap_evt_disconnected_t )&lt;/p&gt;
&lt;p&gt;What goes wrong when you try the sniffer? Which version of Wireshark do you use? The sniffer works best  with version 1.10, not one of the newer versions. The older versions can be downloaded here:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.wireshark.org/download/win32/all-versions/"&gt;www.wireshark.org/.../&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.wireshark.org/download/win64/"&gt;www.wireshark.org/.../&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>