<?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>Disconnection after BLE_GAP_EVT_LESC_DHKEY_REQUEST error 19 (0x13)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/30559/disconnection-after-ble_gap_evt_lesc_dhkey_request-error-19-0x13</link><description>Hi all, 
 
 after call inside the BLE_GAP_EVT_LESC_DHKEY_REQUEST I got error 8, what can cause it? a CONNECTION_SUPERVISED_TIMEOUT? 
 
 
 device nRF52, SDK13 
 
 Thanks</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 22 Feb 2018 14:41:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/30559/disconnection-after-ble_gap_evt_lesc_dhkey_request-error-19-0x13" /><item><title>RE: Disconnection after BLE_GAP_EVT_LESC_DHKEY_REQUEST error 19 (0x13)</title><link>https://devzone.nordicsemi.com/thread/121690?ContentTypeID=1</link><pubDate>Thu, 22 Feb 2018 14:41:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc10fb64-a6ca-41ca-99e1-853a0b3ab7f5</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Could you either post the sniffer trace (file, not just screenshot) or send the projects, so that I can create my own sniffer trace? If you do not want to publish it here, you can send me a PM here on DevZone.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disconnection after BLE_GAP_EVT_LESC_DHKEY_REQUEST error 19 (0x13)</title><link>https://devzone.nordicsemi.com/thread/121560?ContentTypeID=1</link><pubDate>Wed, 21 Feb 2018 16:02:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f865805b-0111-4e76-ae33-5d5e6b00906b</guid><dc:creator>Arepa</dc:creator><description>&lt;p&gt;&lt;strong&gt;update&lt;/strong&gt;: I had tried that before, I put some breakpoints when &lt;span&gt;disconnect_on_fail,&amp;nbsp;but the program never reaches&amp;nbsp;there also&amp;nbsp;&lt;/span&gt;I&amp;nbsp;&lt;span&gt;commented out the&amp;nbsp;sd_ble_gap_disconnect().and it still disconnect when the connection interval is below 100&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disconnection after BLE_GAP_EVT_LESC_DHKEY_REQUEST error 19 (0x13)</title><link>https://devzone.nordicsemi.com/thread/121546?ContentTypeID=1</link><pubDate>Wed, 21 Feb 2018 14:38:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd6fc5c5-5222-4934-acbc-5fdbcd939876</guid><dc:creator>Arepa</dc:creator><description>&lt;p&gt;Hi Ed, I am trying to connect between two nRF52 one central and a peripheral, but where I was getting the problem is with the central, I apologize&amp;nbsp;I thought&amp;nbsp;I said it before.&lt;/p&gt;
&lt;p&gt;both have the same setup for&amp;nbsp;&lt;span&gt;MIN and MAX connection interval, 7.5 and 25&amp;nbsp;respectively. when the MAX connection interval is above 100 it works fine but, when it is lower I get the random disconnect.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;I am going to test using the breakpoint in ble_conn_params.c&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I solved my issue in this way. But I am still wondering why it was disconnecting and from where it was disconnecting. Because on neither central or peripheral run into my breakpoint on ble_conn_params and I also commented the sd_disconnection command for both&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disconnection after BLE_GAP_EVT_LESC_DHKEY_REQUEST error 19 (0x13)</title><link>https://devzone.nordicsemi.com/thread/121510?ContentTypeID=1</link><pubDate>Wed, 21 Feb 2018 11:54:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c6e3730-a77f-459b-8f22-da6c6ca63ac2</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;What are you trying to connect to? Is it something you have made yourself, or is it a phone, or what is it?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;It looks like you have conflicting connection intervals on the two connected devices. Do you know what the preferred connection interval settings is for the central?&lt;/p&gt;
&lt;p&gt;Basically, the central decides the connection interval. If the peripheral is not satisfied with the connection interval (if it is not between&amp;nbsp;MIN and MAX), it can decide to disconnect. You can try to set a breakpoint in ble_conn_params.c, on line 106, and see if that is the place where it disconnects.&lt;/p&gt;
&lt;p&gt;If that is the place, and you don&amp;#39;t care about the connection interval, you can try to change the conn_params setup. I don&amp;#39;t know what your setup looks like, but if you set disconnect_on_fail to false, then you should not disconnect even if the conn_params you desire is not met.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void conn_params_init(void)
{
    uint32_t               err_code;
    ble_conn_params_init_t cp_init;

    memset(&amp;amp;cp_init, 0, sizeof(cp_init));

    cp_init.p_conn_params                  = NULL;
    cp_init.first_conn_params_update_delay = FIRST_CONN_PARAMS_UPDATE_DELAY;
    cp_init.next_conn_params_update_delay  = NEXT_CONN_PARAMS_UPDATE_DELAY;
    cp_init.max_conn_params_update_count   = MAX_CONN_PARAMS_UPDATE_COUNT;
    cp_init.start_on_notify_cccd_handle    = BLE_GATT_HANDLE_INVALID;
    cp_init.disconnect_on_fail             = false;
    cp_init.evt_handler                    = on_conn_params_evt;
    cp_init.error_handler                  = conn_params_error_handler;

    err_code = ble_conn_params_init(&amp;amp;cp_init);
    APP_ERROR_CHECK(err_code);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;However, the best solution would be to set the desired max and min connection interval to something that is supported by the central.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disconnection after BLE_GAP_EVT_LESC_DHKEY_REQUEST error 19 (0x13)</title><link>https://devzone.nordicsemi.com/thread/121451?ContentTypeID=1</link><pubDate>Tue, 20 Feb 2018 22:51:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:872691cb-9025-479a-8e02-4f6ff949e98e</guid><dc:creator>Arepa</dc:creator><description>&lt;p&gt;Hey Ed, I think I found the problem, but it is still very disconcerting.... how I said above I am getting random disconnections since the connection is established I am&amp;nbsp;always getting disconnection reason 0x19&lt;strong&gt;[BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION]&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If I change the values for&amp;nbsp;&lt;span&gt;&lt;strong&gt;MIN_CONN_INTERVAL&lt;/strong&gt; and &lt;strong&gt;MAX_CONN_INTERVAL&lt;/strong&gt; to bigger numbers it does not happen anymore, for example, I was working with&lt;strong&gt;&amp;nbsp;MIN_CONN_INTERVAL =7.5&lt;/strong&gt; and&lt;strong&gt;&amp;nbsp;MAX_CONN_INTERVAL =25 &lt;/strong&gt;and I was getting random disconnections&lt;strong&gt;.&lt;/strong&gt;&amp;nbsp;I changed the values respectively to 100 and 200 and it is now working fine.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;What could be the cause of this behavior?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disconnection after BLE_GAP_EVT_LESC_DHKEY_REQUEST error 8</title><link>https://devzone.nordicsemi.com/thread/121418?ContentTypeID=1</link><pubDate>Tue, 20 Feb 2018 15:44:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53f9c0ad-5475-4bb6-af67-28b84b1808ea</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;send me a PM here on devzone.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disconnection after BLE_GAP_EVT_LESC_DHKEY_REQUEST error 8</title><link>https://devzone.nordicsemi.com/thread/121401?ContentTypeID=1</link><pubDate>Tue, 20 Feb 2018 14:30:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ca1b866-c9b7-422f-ac71-7d87c05cdfe6</guid><dc:creator>Arepa</dc:creator><description>&lt;p&gt;Hi Ed, sure I can. But can you test the project a project made on visualgdb? And is there a way to share it private instead posting here?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disconnection after BLE_GAP_EVT_LESC_DHKEY_REQUEST error 8</title><link>https://devzone.nordicsemi.com/thread/121399?ContentTypeID=1</link><pubDate>Tue, 20 Feb 2018 14:23:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0ab1a56-19bd-4d1a-9ef6-896d4b6d5d2c</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Commenting out all sd_ble_gap_disconnect()s will not keep the devices connected. One device will disconnect if the other one e.g. stops responing.&lt;/p&gt;
&lt;p&gt;Could you zoom a bit out on the sniffer log?&lt;/p&gt;
&lt;p&gt;It says that the slave sends the disconnect message. What device are you trying to connect the nRF&amp;nbsp;to? Is it a phone or another nRF (e.g. with nRF&amp;nbsp;Connect for Desktop)?&lt;/p&gt;
&lt;p&gt;Would it be possible to send the entire project instead of the snippet? Or something that I can reproduce the error with?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disconnection after BLE_GAP_EVT_LESC_DHKEY_REQUEST error 8</title><link>https://devzone.nordicsemi.com/thread/121324?ContentTypeID=1</link><pubDate>Tue, 20 Feb 2018 00:00:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:45f50329-01d1-446d-b99c-8284a9e5b82c</guid><dc:creator>Arepa</dc:creator><description>&lt;p&gt;Hey Ed, I found my central device is being forced to perform a disconnection, but I am not calling it anywhere, I commented all my&amp;nbsp;sd_ble_gap_disconnect()&amp;nbsp; on my central and peripherical and it is still disconnecting reason 19 or 0x13&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/sni.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What other functions can perform a disconnection besides&amp;nbsp;&lt;span&gt;sd_ble_gap_disconnect?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disconnection after BLE_GAP_EVT_LESC_DHKEY_REQUEST error 8</title><link>https://devzone.nordicsemi.com/thread/121208?ContentTypeID=1</link><pubDate>Mon, 19 Feb 2018 09:27:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6868db1b-b533-405e-b346-bcf64e87e5c1</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I understand. What device are you trying to connect to? the nRF is the peripheral in the connection? Do you try to connect to a phone acting as a central? Can you try to connect to another nRF using &lt;a href="https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF-Connect-for-desktop" rel="noopener noreferrer" target="_blank"&gt;nRF Connect for desktop&lt;/a&gt;, and see if you get any information in the log there? Or can you try to provide a sniffer trace, e.g. using &lt;a href="https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF-Sniffer" rel="noopener noreferrer" target="_blank"&gt;nRF Sniffer&lt;/a&gt;?&lt;/p&gt;
&lt;p&gt;The reason I want you to try nRF Connect for desktop is that not all devices support LESC. The nRF Connect for desktop using another DK does support this, so it is only to see if the error is on the peripheral side, or on the central side. A supervision timeout suggests that there is something missing from the central, or perhaps there is something that you are not handling correctly on the peripheral side. A sniffer trace would shed some light on this.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disconnection after BLE_GAP_EVT_LESC_DHKEY_REQUEST error 8</title><link>https://devzone.nordicsemi.com/thread/121117?ContentTypeID=1</link><pubDate>Fri, 16 Feb 2018 17:20:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b1eaa5c-db46-4c92-9e98-d67b2953d5a9</guid><dc:creator>Arepa</dc:creator><description>&lt;p&gt;Hi Ed, after the&amp;nbsp;&lt;span&gt;BLE_GAP_EVT_LESC_DHKEY_REQUEST, I got a BLE_GAP_EVT_DISCONNECTED event from there I printf&amp;nbsp; &amp;quot;p_ble_evt-&amp;gt;evt.gap_evt.params.disconnected.reason&amp;quot; and I got error 8 or error 19, my code was working fine until I added the code on&amp;nbsp;BLE_GAP_EVT_LESC_DHKEY_REQUEST it is still unknown for me what is generating it disconnection the only I got is the error code&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disconnection after BLE_GAP_EVT_LESC_DHKEY_REQUEST error 8</title><link>https://devzone.nordicsemi.com/thread/121080?ContentTypeID=1</link><pubDate>Fri, 16 Feb 2018 13:33:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6d6020c-8d4f-410c-ab13-858034b9f4aa</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Could you specify what function that returned error = 0x08?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>