<?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>Concurrents connections (2 identicals centrals try to connect to the same peripheral at the same time)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/85124/concurrents-connections-2-identicals-centrals-try-to-connect-to-the-same-peripheral-at-the-same-time</link><description>Hello, 
 I have a project (using NUS) that comes in 2 parts: 
 
 NRF52840 (peripheral) which generate advertising when they have information to transmit. 
 PCA10059 USB dongles that constantly scan for the above peripherals 
 
 I encounter a problem when</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 09 May 2022 13:01:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/85124/concurrents-connections-2-identicals-centrals-try-to-connect-to-the-same-peripheral-at-the-same-time" /><item><title>RE: Concurrents connections (2 identicals centrals try to connect to the same peripheral at the same time)</title><link>https://devzone.nordicsemi.com/thread/366951?ContentTypeID=1</link><pubDate>Mon, 09 May 2022 13:01:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93a719d7-c72a-43b0-8a23-253fa0c68bc8</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Sorry for the delay.&lt;/p&gt;
[quote user="Gaetan"]Do you think that there could be a solution on the central to add a variable time between the reception of the avertising and the sending of the connection request?[/quote]
&lt;p&gt;No.&amp;nbsp;Not on the link-layer. But you can add some delay for when you call sd_ble_gap_connect(). The advertiser will have the radio in RX mode in a short period after sending the advertising packet. The central/scanner need to send the connection request packet in this short window after receiving the advertising packet. If you add some sending delay here, the advertiser will not receive the connection request(because the radio is no longer in RX mode). When you call sd_ble_gap_connect(), the central will listen/scan for a advertising packet(from the address you set when calling the connect function), and it will send the connection request packet if it receive a advertising packet from the specified address.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrents connections (2 identicals centrals try to connect to the same peripheral at the same time)</title><link>https://devzone.nordicsemi.com/thread/360160?ContentTypeID=1</link><pubDate>Mon, 28 Mar 2022 07:11:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:678731d7-d05a-439c-bb26-abadf59bef56</guid><dc:creator>Ga&amp;#233;tan</dc:creator><description>&lt;p&gt;For the moment, we regularly observe the situation of synchronization of the centrals during 2 or 3 seconds.&lt;br /&gt;Do you think that there could be a solution on the central to add a variable time between the reception of the avertising and the sending of the connection request?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrents connections (2 identicals centrals try to connect to the same peripheral at the same time)</title><link>https://devzone.nordicsemi.com/thread/357897?ContentTypeID=1</link><pubDate>Mon, 14 Mar 2022 10:13:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe283eeb-5312-4a7b-92c3-e010044e39af</guid><dc:creator>Ga&amp;#233;tan</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m sorry, but I don&amp;#39;t think that the start time of the SCAN function is important.&lt;br /&gt;Indeed, what matters is how many centrals are listening on the channel at the moment the peripheral is advertising.&lt;/p&gt;
&lt;p&gt;I really feel that the problem is that several centrals are TX their response to the advertising in a perfectly synchronized way.&lt;br /&gt;In this case, it would be necessary to integrate a random time in the central between the RX of the advertising and the TX of the connection request.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrents connections (2 identicals centrals try to connect to the same peripheral at the same time)</title><link>https://devzone.nordicsemi.com/thread/357145?ContentTypeID=1</link><pubDate>Wed, 09 Mar 2022 12:21:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f0fb224-39a0-4df2-a07b-12901ce84ef1</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="Gaetan"]but I was worried that softdevice wouldn&amp;#39;t like too long a delay in interupt time[/quote]
&lt;p&gt;Yeah, better to use an app_timer for this. Start a one-shot timer that expires in random time &amp;lt; from 0 to x ms&amp;gt;, and in the callback, start the scanner.&lt;/p&gt;
&lt;p&gt;If it&amp;#39;s started with some delay, then it reduces the probability for the scanners to be on the same channel.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1646828413545v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrents connections (2 identicals centrals try to connect to the same peripheral at the same time)</title><link>https://devzone.nordicsemi.com/thread/356261?ContentTypeID=1</link><pubDate>Fri, 04 Mar 2022 10:54:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af3dbc6f-ef08-4e6b-b9c1-8f259da9ed84</guid><dc:creator>Ga&amp;#233;tan</dc:creator><description>[quote userid="15146" url="~/f/nordic-q-a/85124/concurrents-connections-2-identicals-centrals-try-to-connect-to-the-same-peripheral-at-the-same-time/356212#356212"]For both central and peripheral?[/quote]
&lt;p&gt;I think the peripheral program is not in question because when the centrals synchronize, the peripheral does not report any status, it looks like it does not receive a coherent frame. Probably because the 3 centrals transmit perfectly at the same time and the frame received is corrupted.&lt;/p&gt;
[quote userid="15146" url="~/f/nordic-q-a/85124/concurrents-connections-2-identicals-centrals-try-to-connect-to-the-same-peripheral-at-the-same-time/356212#356212"]Could you try a bit bigger delay?&amp;nbsp;use e.g.&amp;nbsp;nrf_delay_ms() instead?[/quote]
&lt;p&gt;I tried putting the same delay in ms (but I was worried that softdevice wouldn&amp;#39;t like too long a delay in interupt time). It didn&amp;#39;t change anything because I have the feeling that the moment of the scan start is not very important, what is important is that the 3 centrals are listening on the same channel and simultaneously receive the advertising of the peripheral... Then the 3 centrals respond in a perfectly synchronized way!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrents connections (2 identicals centrals try to connect to the same peripheral at the same time)</title><link>https://devzone.nordicsemi.com/thread/356212?ContentTypeID=1</link><pubDate>Fri, 04 Mar 2022 09:12:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb729b08-f272-40b1-b19f-0a357b46cee8</guid><dc:creator>Sigurd</dc:creator><description>[quote user="Gaetan"]I tried with SDK 17.1 and softdevice 7.3.0.[/quote]
&lt;p&gt;For both central and peripheral?&lt;/p&gt;
[quote user="Gaetan"]tried to add nrf_delay_us[/quote]
&lt;p&gt;Could you try a bit bigger delay?&amp;nbsp;use e.g.&amp;nbsp;nrf_delay_ms() instead?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrents connections (2 identicals centrals try to connect to the same peripheral at the same time)</title><link>https://devzone.nordicsemi.com/thread/355703?ContentTypeID=1</link><pubDate>Wed, 02 Mar 2022 07:07:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96e8a67c-2bca-42fc-a951-550faf3c04ec</guid><dc:creator>Ga&amp;#233;tan</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;1) Yes disconnect reason is&amp;nbsp;BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED(0x3E)&lt;/p&gt;
&lt;p&gt;2) &lt;span style="text-decoration:line-through;"&gt;Actualy project use&amp;nbsp;s140_nrf52_6.1.0_softdevice.hex, I need to change SDK version...&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;3) Yes, I tried to add nrf_delay_us(NRF_FICR-&amp;gt;DEVICEADDR[0] &amp;amp; 0xFF); in case BLE_NUS_C_EVT_DISCONNECTED&amp;nbsp; without change.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Edit: I tried with SDK 17.1 and softdevice 7.3.0... It is the same: the dongles synchronize for a few seconds (about 3 seconds) and then the operation is OK&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Concurrents connections (2 identicals centrals try to connect to the same peripheral at the same time)</title><link>https://devzone.nordicsemi.com/thread/355187?ContentTypeID=1</link><pubDate>Mon, 28 Feb 2022 08:42:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60ba9a45-1893-444a-95d0-e6b42a9b7709</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;1) When you get the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v7.3.0/structble__gap__evt__disconnected__t.html"&gt;BLE_GAP_EVT_DISCONNECTED event&lt;/a&gt;, what is the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v7.3.0/group___b_l_e___h_c_i___s_t_a_t_u_s___c_o_d_e_s.html"&gt;disconnect reason&lt;/a&gt;?&amp;nbsp;BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED(0x3E)?&lt;/p&gt;
&lt;p&gt;2) What SD version is this? Do you see the same issue with the latest SoftDevice version? 7.3.0?&lt;/p&gt;
&lt;p&gt;3)&amp;nbsp;&lt;/p&gt;
[quote user=""]generates a BLE_NUS_C_EVT_DISCONNECTED event with which I relaunch a scan_start[/quote]
&lt;p&gt;Do you see the same issue if you add a random delay before calling scan_start?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>