<?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>Multilink central disconnect problem</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/22678/multilink-central-disconnect-problem</link><description>I wrote a peripheral similar to NUS. Then I use the multilink central to connect to 3 of them. First two are fine. But when the 3rd is added, the 3rd one would connect, but every 30 seconds, it would break the connection with code 0x13 (no resource?)</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 20 Jun 2017 13:02:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/22678/multilink-central-disconnect-problem" /><item><title>RE: Multilink central disconnect problem</title><link>https://devzone.nordicsemi.com/thread/89153?ContentTypeID=1</link><pubDate>Tue, 20 Jun 2017 13:02:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a53a39af-c37d-47b5-b35a-8bb53510e95e</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;&lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s132.sds%2Fdita%2Fsoftdevices%2Fs130%2Fmultilink_scheduling%2Fextend_connection_event.html&amp;amp;cp=2_4_0_0_14_6"&gt;This&lt;/a&gt; chapter in the S132 softdevice specification explains the relationship between connection interval, event length, and number of links. I would recommend you to read that chapter.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multilink central disconnect problem</title><link>https://devzone.nordicsemi.com/thread/89151?ContentTypeID=1</link><pubDate>Mon, 19 Jun 2017 22:33:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63fe71ad-059b-4927-96c9-d4162bbce89b</guid><dc:creator>Rbai</dc:creator><description>&lt;p&gt;Can you explain the relationship among number of links, my_connection_event_length, and connection interval? Eg. if I have 8 links in total, 100ms connection interval, what to set the my_connection_event_length?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multilink central disconnect problem</title><link>https://devzone.nordicsemi.com/thread/89152?ContentTypeID=1</link><pubDate>Mon, 19 Jun 2017 12:56:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5aac89b9-8d34-4ee4-bd7c-f821d8a7a2b4</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;I have updated my answer with what is necessary to do to obtain stable connections.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multilink central disconnect problem</title><link>https://devzone.nordicsemi.com/thread/89150?ContentTypeID=1</link><pubDate>Thu, 15 Jun 2017 16:14:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46524402-7bec-4f10-b51d-9fe198f15b13</guid><dc:creator>Rbai</dc:creator><description>&lt;p&gt;Thought this issue was solved but not yet. Things are fine with MTU=23 and 3 peripherals. After I change the MTU size to 247 on both ends, the discovery became much slower than when MTU=23. The connection also became unstable, it would disconnect the 3rd peripheral always, and even the first two would disconnect sometimes. Can you verify and tell me how to solve it?&lt;/p&gt;
&lt;p&gt;I have also added code as following for MTU=247 and called them with &amp;quot;true&amp;quot; in main():&lt;/p&gt;
&lt;p&gt;static void conn_evt_len_ext_set(bool status)
{
ret_code_t err_code;
ble_opt_t  opt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;memset(&amp;amp;opt, 0x00, sizeof(opt));
opt.common_opt.conn_evt_ext.enable = status ? 1 : 0;

err_code = sd_ble_opt_set(BLE_COMMON_OPT_CONN_EVT_EXT, &amp;amp;opt);
APP_ERROR_CHECK(err_code);

NRF_LOG_DEBUG(&amp;quot;Setting connection event length extension to %u: 0x%x\r\n&amp;quot;, status, err_code);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;static void data_len_ext_set(bool status)
{
uint8_t data_length = status ? (247 + LL_HEADER_LEN) : (23 + LL_HEADER_LEN);
(void) nrf_ble_gatt_data_length_set(&amp;amp;m_gatt, BLE_CONN_HANDLE_INVALID, data_length);
}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multilink central disconnect problem</title><link>https://devzone.nordicsemi.com/thread/89149?ContentTypeID=1</link><pubDate>Tue, 13 Jun 2017 12:16:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:372854bc-d7b3-4179-a0a9-a0b7fb6a089d</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;The disconnect is because of &lt;a href="https://devzone.nordicsemi.com/question/128137/closednrf52832s132-400-connection-fails-exchange-mtu-request-is-not-received-on-evtcommon_evtconn_handle2/?answer=130540#post-id-130540"&gt;this&lt;/a&gt; bug in the GATT module (nrf_ble_gatt.h/.c):
nrf_ble_gatt.h locally sets and uses its own settings for the number of connections, which by default is &amp;#39;2&amp;#39;. Changing the defines in nrf_ble_gatt.h to the correct value, or redefining NRF_BLE_CENTRAL_LINK_COUNT/NRF_BLE_PERIPHERAL_LINK_COUNT should solve the problem.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update 19.06.17:&lt;/strong&gt; To make the links stable for longer packets, the following changes have to be made:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Increase the connection interval: It takes more time to transmit longer packets, and each connected peripheral will require some time.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure the softdevice with the correct GAP and GATT parameters in ble_stack_init(), both for the central and the peripherals:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; memset(&amp;amp;ble_cfg, 0, sizeof(ble_cfg));
 ble_cfg.conn_cfg.params.gap_conn_cfg.conn_count     = PERIPHERAL_LINK_COUNT + CENTRAL_LINK_COUNT;
 ble_cfg.conn_cfg.params.gap_conn_cfg.event_length   = my_connection_event_length; 
 ble_cfg.conn_cfg.conn_cfg_tag                       = CONN_CFG_TAG;

 err_code = sd_ble_cfg_set(BLE_CONN_CFG_GAP, &amp;amp;ble_cfg, ram_start);
 APP_ERROR_CHECK(err_code);

 memset(&amp;amp;ble_cfg, 0, sizeof(ble_cfg));
 ble_cfg.conn_cfg.params.gatt_conn_cfg.att_mtu       = NRF_BLE_GATT_MAX_MTU_SIZE;
 ble_cfg.conn_cfg.conn_cfg_tag                       = CONN_CFG_TAG;

 err_code = sd_ble_cfg_set(BLE_CONN_CFG_GATT, &amp;amp;ble_cfg, ram_start);
 APP_ERROR_CHECK(err_code);
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multilink central disconnect problem</title><link>https://devzone.nordicsemi.com/thread/89148?ContentTypeID=1</link><pubDate>Mon, 12 Jun 2017 15:00:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:26cb50cf-59e4-4540-b41a-99b05e39d88a</guid><dc:creator>Rbai</dc:creator><description>&lt;p&gt;The message is from the central.
APP:INFO:LBS central link 0x2 disconnected (reason: 0x13)
Yes it is under BLE_GAP_EVT_DISCONNECTED event.&lt;/p&gt;
&lt;p&gt;If you build and download the ble_app_uart into 3 peripheral devices and modify the ble_app_multilink_central to match the device name: static char const m_target_periph_name[] = &amp;quot;Nordic_UART&amp;quot;;//&amp;quot;Nordic_Blinky&amp;quot;; Build and download the SW into a central device, you will see 3 connections on the console of the central, and the disconnect on the 3rd device every 30 seconds.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multilink central disconnect problem</title><link>https://devzone.nordicsemi.com/thread/89147?ContentTypeID=1</link><pubDate>Mon, 12 Jun 2017 07:48:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b261f91-c20d-482a-8df1-c473b385790b</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;0x13, is that an error code returned by a softdevice function or a BLE disconnected event code (BLE_GAP_EVT_DISCONNECTED)? This error occurs at the central side, right?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>