<?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>Error 8 (0x8): GATT CONN TIMEOUT</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/46874/error-8-0x8-gatt-conn-timeout</link><description>Code: Modified ble_app_hts SDK 15.2.0 (turned bonding off) 
 Phone: Android LG-M703, software ver 8.1.0. nRF Connect app ver 4.22.3 
 Hardware: nRF52832 DK, Fanstel EV BT832F 
 
 When I run my code on the nRF DK and connect using my phone everything works</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 06 May 2019 06:32:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/46874/error-8-0x8-gatt-conn-timeout" /><item><title>RE: Error 8 (0x8): GATT CONN TIMEOUT</title><link>https://devzone.nordicsemi.com/thread/185346?ContentTypeID=1</link><pubDate>Mon, 06 May 2019 06:32:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bbcb16c9-ca88-40f3-94e9-7990883bd9b6</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can find the disconnect reason when you get the&amp;nbsp;BLE_GAP_EVT_DISCONNECTED event. For instance, it&amp;nbsp;is done like this in the ble_app_hrs example in SDK 15.3:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;        case BLE_GAP_EVT_DISCONNECTED:
            NRF_LOG_INFO(&amp;quot;Disconnected, reason %d.&amp;quot;,
                          p_ble_evt-&amp;gt;evt.gap_evt.params.disconnected.reason);&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error 8 (0x8): GATT CONN TIMEOUT</title><link>https://devzone.nordicsemi.com/thread/185252?ContentTypeID=1</link><pubDate>Fri, 03 May 2019 16:45:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dbc126dc-d366-4e77-9104-1e9c3fc7c620</guid><dc:creator>mbards</dc:creator><description>&lt;p&gt;So I dropped the interval really low following your advice and that seemed to work. Thank you.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define MIN_CONN_INTERVAL MSEC_TO_UNITS(50, UNIT_1_25_MS)  /**&amp;lt; Minimum acceptable connection interval (0.5 seconds) */
#define MAX_CONN_INTERVAL MSEC_TO_UNITS(100, UNIT_1_25_MS) /**&amp;lt; Maximum acceptable connection interval (1 second). */
#define SLAVE_LATENCY 0                                     /**&amp;lt; Slave latency. */
#define CONN_SUP_TIMEOUT MSEC_TO_UNITS(4000, UNIT_10_MS)    /**&amp;lt; Connection supervisory timeout (4 seconds). */&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m very curious, what&amp;#39;s the best way to go about finding the disconnect reason on the nRF? Is there some sort of useful context information I could pass on through&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;NRF_SDH_BLE_OBSERVER(m_ble_observer, APP_BLE_OBSERVER_PRIO, ble_evt_handler, **useful context struct here**) &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;when I initialise the ble event handler?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error 8 (0x8): GATT CONN TIMEOUT</title><link>https://devzone.nordicsemi.com/thread/185114?ContentTypeID=1</link><pubDate>Fri, 03 May 2019 09:27:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd979a59-be29-405e-a6f4-5321276e1494</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Would it be possible to add a bit more logging on the nRF side? It would be interesting to know the disconnect reason on the nRF, though I assume it is timeout there as well (8). It would also be interesting to know why the nRF seemingly start to advertise before the disconnected event, or if there is something odd with the logging.&lt;/p&gt;
&lt;p&gt;If we assume that there is a timeout on both sides, this is typically caused by a few things:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Packet loss on air due to low RSSI or much noise or interference.
&lt;ul&gt;
&lt;li&gt;This can be handled by increasing the number of retransmissions, which is achieved by increasing the supervision timeout (making it larger relative to the connection interval).&lt;/li&gt;
&lt;li&gt;You should also avoid slave latency, or at least ensure that you still have a good margin if it is used.&lt;/li&gt;
&lt;li&gt;Note that the central decides the connection parameters, so what you have configured may not be what is actually used. Do you have a sniffer trace that shows the actual connection parameters of the link?&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Clock drift between the peers, making the event windows non-overlapping. This should not happen as the clock accuracy is exchanged when the connection is established, and it is accounted for. However, you sometimes see connections issues if the nRF has a bad clock source.
&lt;ul&gt;
&lt;li&gt;This could typically be a crystal with wrong load capacitor values,&lt;/li&gt;
&lt;li&gt;or using the internal RC oscillator but configuring the SoftDevice to indicate a high accuracy.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>