<?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>nRF52 automatically disconnects with iOS phone after 90 seconds</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/59032/nrf52-automatically-disconnects-with-ios-phone-after-90-seconds</link><description>Hello, 
 I am using a custom nRF52840 ( SDK 14.2.0, SoftDevice S140) based board to connect with an iOS(v 13.3) phone. 
 I am sending data continuously over BLE. However I notice that after around 90 seconds the connection automatically ends. 
 On the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 16 Mar 2020 07:26:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/59032/nrf52-automatically-disconnects-with-ios-phone-after-90-seconds" /><item><title>RE: nRF52 automatically disconnects with iOS phone after 90 seconds</title><link>https://devzone.nordicsemi.com/thread/239873?ContentTypeID=1</link><pubDate>Mon, 16 Mar 2020 07:26:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05df6751-f5e8-4ffa-81e4-5490ca5aff7f</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Ok, it sounds like the FW app is disconnecting because the iPhone rejected &amp;quot;MAX_CONN_PARAMS_UPDATE_COUNT&amp;quot; number of requests. You can either change the app so it doesn&amp;#39;t disconnect even if the requested connection parameters are rejected, or you can change your connection parameters according to the recommendations given in the Apple document I linked in my previous response.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a title="Connection Parameters Negotiation" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/lib_ble_conn_params.html?cp=7_1_3_2_4"&gt;Connection Parameters Negotiation&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 automatically disconnects with iOS phone after 90 seconds</title><link>https://devzone.nordicsemi.com/thread/239815?ContentTypeID=1</link><pubDate>Fri, 13 Mar 2020 21:34:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:027b6680-b50a-4792-b4aa-4a3530e58b16</guid><dc:creator>RO</dc:creator><description>&lt;p&gt;I added the log code and I get &amp;#39;0x16&amp;#39; , which means Local host terminated connection.&lt;br /&gt;&lt;br /&gt;It does seem something to do with connection parameter updates.&lt;br /&gt;&lt;br /&gt;When I change the&amp;nbsp;MAX_CONN_PARAMS_UPDATE_COUNT from 3 to 2, now the disconnections happen in 60 seconds.&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define FIRST_CONN_PARAMS_UPDATE_DELAY   APP_TIMER_TICKS(5000)                      /**&amp;lt; Time from initiating event (connect or start of notification) to first time sd_ble_gap_conn_param_update is called (5 seconds). */
#define NEXT_CONN_PARAMS_UPDATE_DELAY    APP_TIMER_TICKS(30000)                     /**&amp;lt; Time between each call to sd_ble_gap_conn_param_update after the first call (30 seconds). */
#define MAX_CONN_PARAMS_UPDATE_COUNT     2  &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;So what is the solution?&lt;br /&gt;&lt;br /&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 automatically disconnects with iOS phone after 90 seconds</title><link>https://devzone.nordicsemi.com/thread/239726?ContentTypeID=1</link><pubDate>Fri, 13 Mar 2020 12:47:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:640a5b44-c484-4fb4-91a0-a9b74d81ac62</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;I agree with jacksong, a good&amp;nbsp; first step is to figure out what the disconnect reason is.&amp;nbsp; You can also check the callback from the connection parameter module (registered through ble_conn_params_init() to see if the connection param update requests are being rejected.&amp;nbsp; Also, note that SDK 14.2.0 should not be used with 52840 because we had limited support for it in this release. It&amp;#39;s important that you migrate to SDK v15 or preferably v16 before going to production.&lt;/p&gt;
&lt;p&gt;Apple recommandations:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.apple.com/accessories/Accessory-Design-Guidelines.pdf"&gt;https://developer.apple.com/accessories/Accessory-Design-Guidelines.pdf&lt;/a&gt; &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 automatically disconnects with iOS phone after 90 seconds</title><link>https://devzone.nordicsemi.com/thread/239626?ContentTypeID=1</link><pubDate>Fri, 13 Mar 2020 02:05:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a833603-7b4b-4f83-b8c9-5871c3403dd5</guid><dc:creator>jacksong</dc:creator><description>&lt;p&gt;sounds like it is update connection parameter fail, you need to check the reason code of disconnect.&lt;/p&gt;
&lt;p&gt;you can add log code at on_ble_evt() , and then check the meaning of reason at &amp;quot;ble_hci.h&amp;quot;&amp;nbsp; at line 56.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;on_ble_evt((ble_evt_t * p_ble_evt))
{
...
    case BLE_GAP_EVT_DISCONNECTED:
    {
        ...
    
        NRF_LOG_RAW_INFO(&amp;quot;disconnect reason:0x%X&amp;quot;,p_ble_evt-&amp;gt;evt.gap_evt.params.disconnected.reason);

        ...
    }
    break;

...

}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>