<?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>Out of range catastrophe</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/99913/out-of-range-catastrophe</link><description>Hello everyone! 
 This thread is similar to , as same system is used. There we discuss about S140 Soft Device scheduling conflict and here we want to talk about problem caused by device out of range. 
 
 Background 
 We are in development phase for indoor</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 24 Jul 2023 08:53:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/99913/out-of-range-catastrophe" /><item><title>RE: Out of range catastrophe</title><link>https://devzone.nordicsemi.com/thread/437802?ContentTypeID=1</link><pubDate>Mon, 24 Jul 2023 08:53:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22dd780a-c2cd-4be0-999d-64b1a0a4f0dd</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;That&amp;#39;s great news&amp;nbsp;&lt;span&gt;Žiga&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Glad we were able to get to the bottom of this issue. Thank you for letting us know! I&amp;#39;m closing this case then.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Simon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Out of range catastrophe</title><link>https://devzone.nordicsemi.com/thread/437456?ContentTypeID=1</link><pubDate>Thu, 20 Jul 2023 11:48:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36a518d0-7f6a-491b-b6d3-34da51197594</guid><dc:creator>Ziga Miklosic</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/simonr"&gt;Simonr&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have a very good news!&lt;/p&gt;
&lt;p&gt;We are now confident that the proposed solution solves the &amp;quot;out of range&amp;quot; problem. After doing a lot of tests there was no sign of devices blocking each other from being re-connected. Everything works as expected.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you again for your time and help!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;BR, Žiga&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Out of range catastrophe</title><link>https://devzone.nordicsemi.com/thread/434461?ContentTypeID=1</link><pubDate>Tue, 04 Jul 2023 12:36:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00ee0215-4e1f-4c9d-ad8d-1432eb0eedf8</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Aha! That makes sense, although I had no idea that the lack of a scan/connection timeout like this would result in &amp;quot;blocking&amp;quot; other devices from reconnecting. I&amp;#39;m sorry I didn&amp;#39;t come with this suggestion already, but I really didn&amp;#39;t think this would be the root cause, but now that you explain it it makes sense to me. Best of luck with testing, and let me know if you run into any issues on the way.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Out of range catastrophe</title><link>https://devzone.nordicsemi.com/thread/434412?ContentTypeID=1</link><pubDate>Tue, 04 Jul 2023 10:01:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36fda667-87c4-4ccd-915e-5819c1a1c0d2</guid><dc:creator>Ziga Miklosic</dc:creator><description>&lt;p&gt;I think I got it! But there is still a lot to be tested before celebration&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;PROBLEM&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;WHAT&lt;/em&gt;:&lt;/strong&gt; Central device did not end connection initiation procedure, no timeout was implemented! &lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;Calling &amp;quot;&lt;em&gt;sd_ble_gap_connect&lt;/em&gt;&amp;quot; with scan timeout of 0 will never timeouted!&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;WHY:&lt;/strong&gt;&lt;/em&gt;&amp;nbsp;After calling &amp;quot;&lt;em&gt;sd_ble_gap_connect&amp;quot; &lt;/em&gt;additional advertising packet needs to be received before SD start to send connection request to peer device. In case of DevB adv packets were received very reliable and connection establishment was done immediately. In case of DevA that was on rangle limit its adv packet come very offset and very randomly. So between first and second adv packet it might pass couple of minutes or it might take indefinetly. Central was therefore blocked waiting for that second adv packet. &lt;strong&gt;And from outside it looked like it stop to scan. &lt;/strong&gt;(Here I was misdirected...)&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;SOLUTION&lt;/strong&gt;:&lt;/span&gt; Implemented timeout for connection initiation (when first calling &amp;quot;&lt;em&gt;&lt;strong&gt;sd_ble_gap_connect&lt;/strong&gt;&lt;/em&gt;&amp;quot;) and at timeout event calling &amp;quot;&lt;em&gt;&lt;strong&gt;sd_ble_gap_connect_cancel&lt;/strong&gt;&lt;/em&gt;&amp;quot;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In picture below there is a sequence diagram of described scenarious for both devices:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:210px;max-width:249px;" alt=" " height="210" src="https://devzone.nordicsemi.com/resized-image/__size/498x420/__key/communityserver-discussions-components-files/4/OutOfRange_5F00_Conn_5F00_Initiate_5F00_PerfectCond.png" width="249" /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;img style="max-height:273px;max-width:231px;" alt=" " height="273" src="https://devzone.nordicsemi.com/resized-image/__size/462x546/__key/communityserver-discussions-components-files/4/OutOfRange_5F00_Conn_5F00_Initiate_5F00_ChallengingCond.png" width="231" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Similar issues were discussed on several Nordic Dev Zone post, but unfortunatelly I wasn&amp;#39;t come across them before:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;1.&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/63088/it-is-possible-to-set-a-timeout-between-sd_ble_gap_connect-till-ble_gap_evt_connected-event"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/63088/it-is-possible-to-set-a-timeout-between-sd_ble_gap_connect-till-ble_gap_evt_connected-event&lt;/a&gt;&amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;2.&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/99516/sd_ble_gap_connect-times-out-but-ble_gap_evt_timeout-never-fires"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/99516/sd_ble_gap_connect-times-out-but-ble_gap_evt_timeout-never-fires&lt;/a&gt;&amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;3.&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/10386/sd_ble_gap_connect-timeout-in-s120-central"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/10386/sd_ble_gap_connect-timeout-in-s120-central&lt;/a&gt;&amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What do you think of that?&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;BR, Žiga&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Out of range catastrophe</title><link>https://devzone.nordicsemi.com/thread/434236?ContentTypeID=1</link><pubDate>Mon, 03 Jul 2023 13:16:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66b97d0f-cf86-41cf-9b05-e6b01150ceab</guid><dc:creator>Ziga Miklosic</dc:creator><description>&lt;p&gt;Hi Simonr,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/99913/out-of-range-catastrophe/434213"]I must say we&amp;#39;re quite stumped at this, but wanted to let you know that we&amp;#39;re still looking into this on our end as well.[/quote]
&lt;p&gt;Please, don&amp;#39;t give up on me! &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f603.svg" title="Smiley"&gt;&amp;#x1f603;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/99913/out-of-range-catastrophe/434213"]Just to clarify a few things here. Is it device A that takes up to 4 minutes to reconnect when it is moved back into range of the central device?[/quote]
&lt;p&gt;Yes, device A is on a range limit.&amp;nbsp;&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/99913/out-of-range-catastrophe/434213"]Are you able to provide a sniffer trace here as well. Usually, the debug log isn&amp;#39;t all that reliable in terms of timing events, and these are just the times the device reports these events to the debugger.[/quote]
&lt;p&gt;I&amp;#39;ll prepare sniffed files during that week. It is a bit difficult to reproduce such a scenario as there are many factors influencing the system but will do my best to capture that event.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/99913/out-of-range-catastrophe/434213"]1. Most likely due to multiple failed connection requests/responses and retries, as well as this link loss that seems to appear in the midst of the connection here, as well as &amp;quot;Scanning Started&amp;quot; over again. So I&amp;#39;m guessing that it&amp;#39;s just at the edge of the range where it&amp;#39;s able to be detected.[/quote]
&lt;p&gt;That makes perfect sense, as the device causing the problems is at the very limit of the range.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;Meanwhile I added also RSSI value to debug print beside &amp;quot;&lt;em&gt;Connectable advertising report from FC:B4:D7:B8:28:4B&lt;/em&gt;&amp;quot;. Debug message now looks like that, for example: &amp;quot;&lt;em&gt;Connectable advertising report from FC:B4:D7:B8:28:4B with RSSI: -93 dBm&lt;/em&gt;&amp;quot;. What I found out is that connection establishment with received signal strength higher than -90dBm is OK. Connection is established right away.&lt;/p&gt;
&lt;p&gt;So, I added additional RSSI check to&amp;nbsp;&lt;span&gt;advertisement report event handler before initiating connection. See the code below:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;////////////////////////////////////////////////////////////////////////////////
/**
*		BLE on advertisement report event handler 
*   
* @note     This function is being executed in main BLE stack callback!
*
* @param[in] 	p_ble_evt   - Pointer to BLE event informations
* @return 		void
*/
////////////////////////////////////////////////////////////////////////////////
static inline void ble_c_evt_on_adv_report(ble_evt_t const * p_ble_evt)
{
    static  uint8_t             man_data[32]    = { 0 };
            uint16_t            man_data_len    = 0;
             ble_c_obs_data_t   observer_data   = { 0 };

    // Get advertisment info
    const ble_gap_evt_adv_report_t * const p_adv_report = &amp;amp;( p_ble_evt-&amp;gt;evt.gap_evt.params.adv_report );

    // Get advertisement type
    const ble_gap_adv_report_type_t * const p_adv_type = &amp;amp;( p_adv_report-&amp;gt;type );

    // Get advertisement data and lenght
    const uint8_t * p_adv_data      = p_adv_report-&amp;gt;data.p_data;
    const uint16_t  adv_data_len    = p_adv_report-&amp;gt;data.len;

    // Advertisment status OK
    if ( BLE_GAP_ADV_DATA_STATUS_COMPLETE == p_adv_type-&amp;gt;status )
    {
        // Get manufacturer data
        if ( eBLE_C_OK == ble_c_get_manufacturer_data( p_adv_data, adv_data_len, (uint8_t*) &amp;amp;man_data, &amp;amp;man_data_len ))
        {
            // Advertisment request for connection
            if ( 1U == p_adv_type-&amp;gt;connectable )
            {
                BLE_C_DBG_PRINT( &amp;quot;Connectable advertising report from %02X:%02X:%02X:%02X:%02X:%02X with RSSI: %i dBm&amp;quot;, p_adv_report-&amp;gt;peer_addr.addr[5], p_adv_report-&amp;gt;peer_addr.addr[4], p_adv_report-&amp;gt;peer_addr.addr[3],
                                                                                                      p_adv_report-&amp;gt;peer_addr.addr[2], p_adv_report-&amp;gt;peer_addr.addr[1], p_adv_report-&amp;gt;peer_addr.addr[0],
                                                                                                      p_adv_report-&amp;gt;rssi );

                // Is this device already connected
                //if ( false == ble_c_check_dev_conn( p_adv_report-&amp;gt;peer_addr.addr ))
                {                      
                    // Check for magic request
                    //if ( true == ble_c_check_magic_request( man_data, man_data_len ))

                    // TEST: Only for testing purposes!!! Remove later on!!!
                    if ( p_adv_report-&amp;gt;rssi &amp;gt; -90 )
                    {
                        BLE_C_DBG_PRINT( &amp;quot;Connection initiated...&amp;quot; );

                        // Continue scanning
                        (void) sd_ble_gap_scan_start( NULL, &amp;amp;g_ble_c.scan_data );

                        // Stop scanning before connection
                        (void) sd_ble_gap_scan_stop();

                        // Connect to peer device
                        if ( NRF_SUCCESS != sd_ble_gap_connect( &amp;amp;p_adv_report-&amp;gt;peer_addr, &amp;amp;g_ble_c.scan_params, &amp;amp;g_ble_c.conn_params, BLE_C_CONN_CFG_TAG ))
                        {
                            BLE_C_DBG_PRINT( &amp;quot;Attept to connect failed!&amp;quot; );
                        }
                    }
                }
            }

            // Advertisement only broadcast
            else
            {
                BLE_C_DBG_PRINT( &amp;quot;Broadcasting advertising report!&amp;quot; );

                // Assemble observer data packet
                observer_data.rssi = p_adv_report-&amp;gt;rssi;
                observer_data.size = man_data_len;
                memcpy( &amp;amp;observer_data.data, &amp;amp;man_data, man_data_len );
                memcpy( &amp;amp;observer_data.mac, p_adv_report-&amp;gt;peer_addr.addr, sizeof( observer_data.mac ));
            
                // Put data to observer data
                if ( eRING_BUFFER_OK != ring_buffer_add( g_ble_c.observer_buf, (ble_c_obs_data_t*) &amp;amp;observer_data ))
                {
                    // Buffer overflow!
                    BLE_C_DBG_PRINT( &amp;quot;Observer buffer overflow! Increse buffer size via \&amp;quot;BLE_C_OBSERVER_BUF_SIZE\&amp;quot; macro!&amp;quot;);
                }
            }
        }
    }

    // Continue scanning
    (void) sd_ble_gap_scan_start( NULL, &amp;amp;g_ble_c.scan_data );
}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This is just playing around as I have no other clue how to fix the problem. So far, that filtering technique seems to be working ok, but I&amp;#39;m not confident to use that in production software. On the other hand, it also reduce the working distance of the BLE. What is your opinion on that &amp;quot;solution&amp;quot;?&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 will provide you with wanted sniffed file in couple of days.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;BR, Žiga&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&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: Out of range catastrophe</title><link>https://devzone.nordicsemi.com/thread/434213?ContentTypeID=1</link><pubDate>Mon, 03 Jul 2023 12:26:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff5e64b9-3bdb-47c0-876f-40ba9b7aa3db</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi again&lt;/p&gt;
&lt;p&gt;I must say we&amp;#39;re quite stumped at this, but wanted to let you know that we&amp;#39;re still looking into this on our end as well.&lt;/p&gt;
&lt;p&gt;Just to clarify a few things here. Is it device A that takes up to 4 minutes to reconnect when it is moved back into range of the central device? For it to take up to 4 minutes, the only thing that makes sense to us is if it is right on the edge of the range it can be detected, but in the 4 minute window you report here there also seem to be a connection loss in the meantime. So it seems like there are something happening in the meantime here. Are you able to provide a sniffer trace here as well. Usually, the debug log isn&amp;#39;t all that reliable in terms of timing events, and these are just the times the device reports these events to the debugger.&lt;/p&gt;
&lt;p&gt;To answer your questions:&lt;/p&gt;
&lt;p&gt;1. Most likely due to multiple failed connection requests/responses and retries, as well as this link loss that seems to appear in the midst of the connection here, as well as &amp;quot;Scanning Started&amp;quot; over again. So I&amp;#39;m guessing that it&amp;#39;s just at the edge of the range where it&amp;#39;s able to be detected.&lt;/p&gt;
&lt;p&gt;2. This is most likely due to&amp;nbsp;failed connection requests and retries as well as advertisements not being picked up by the central when very far away.&lt;/p&gt;
&lt;p&gt;3. Without knowing the details of the range between them and seeing a sniffer log, I don&amp;#39;t see anything breaking the Bluetooth specification.&lt;/p&gt;
&lt;p&gt;4. I will need a sniffer log capturing this behavior before commenting on what you could do to mitigate this issue I&amp;#39;m afraid.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Out of range catastrophe</title><link>https://devzone.nordicsemi.com/thread/433881?ContentTypeID=1</link><pubDate>Fri, 30 Jun 2023 09:11:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e366ac8-e885-4c28-b56b-508bcb358005</guid><dc:creator>Ziga Miklosic</dc:creator><description>&lt;p&gt;Hello Simonr,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve done as you recommended, so removed all the logic regarding whitelist, see the advertisement report event handler:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;////////////////////////////////////////////////////////////////////////////////
/**
*		BLE on advertisement report event handler 
*   
* @note     This function is being executed in main BLE stack callback!
*
* @param[in] 	p_ble_evt   - Pointer to BLE event informations
* @return 		void
*/
////////////////////////////////////////////////////////////////////////////////
static inline void ble_c_evt_on_adv_report(ble_evt_t const * p_ble_evt)
{
    static  uint8_t             man_data[32]    = { 0 };
            uint16_t            man_data_len    = 0;
             ble_c_obs_data_t   observer_data   = { 0 };

    // Get advertisment info
    const ble_gap_evt_adv_report_t * const p_adv_report = &amp;amp;( p_ble_evt-&amp;gt;evt.gap_evt.params.adv_report );

    // Get advertisement type
    const ble_gap_adv_report_type_t * const p_adv_type = &amp;amp;( p_adv_report-&amp;gt;type );

    // Get advertisement data and lenght
    const uint8_t * p_adv_data      = p_adv_report-&amp;gt;data.p_data;
    const uint16_t  adv_data_len    = p_adv_report-&amp;gt;data.len;

    // Advertisment status OK
    if ( BLE_GAP_ADV_DATA_STATUS_COMPLETE == p_adv_type-&amp;gt;status )
    {
        // Get manufacturer data
        if ( eBLE_C_OK == ble_c_get_manufacturer_data( p_adv_data, adv_data_len, (uint8_t*) &amp;amp;man_data, &amp;amp;man_data_len ))
        {
            // Advertisment request for connection
            if ( 1U == p_adv_type-&amp;gt;connectable )
            {
                BLE_C_DBG_PRINT( &amp;quot;Connectable advertising report from %02X:%02X:%02X:%02X:%02X:%02X&amp;quot;, p_adv_report-&amp;gt;peer_addr.addr[5], p_adv_report-&amp;gt;peer_addr.addr[4], p_adv_report-&amp;gt;peer_addr.addr[3],
                                                                                                      p_adv_report-&amp;gt;peer_addr.addr[2], p_adv_report-&amp;gt;peer_addr.addr[1], p_adv_report-&amp;gt;peer_addr.addr[0] );

                // Is this device already connected
                //if ( false == ble_c_check_dev_conn( p_adv_report-&amp;gt;peer_addr.addr ))
                {                      
                    // Check for magic request
                    //if ( true == ble_c_check_magic_request( man_data, man_data_len ))
                    {
                        BLE_C_DBG_PRINT( &amp;quot;Connection initiated...&amp;quot; );

                        // Continue scanning
                        (void) sd_ble_gap_scan_start( NULL, &amp;amp;g_ble_c.scan_data );

                        // Stop scanning before connection
                        (void) sd_ble_gap_scan_stop();

                        // Connect to peer device
                        if ( NRF_SUCCESS != sd_ble_gap_connect( &amp;amp;p_adv_report-&amp;gt;peer_addr, &amp;amp;g_ble_c.scan_params, &amp;amp;g_ble_c.conn_params, BLE_C_CONN_CFG_TAG ))
                        {
                            BLE_C_DBG_PRINT( &amp;quot;Attept to connect failed!&amp;quot; );
                        }
                    }
                }
            }

            // Advertisement only broadcast
            else
            {
                BLE_C_DBG_PRINT( &amp;quot;Broadcasting advertising report!&amp;quot; );

                // Assemble observer data packet
                observer_data.rssi = p_adv_report-&amp;gt;rssi;
                observer_data.size = man_data_len;
                memcpy( &amp;amp;observer_data.data, &amp;amp;man_data, man_data_len );
                memcpy( &amp;amp;observer_data.mac, p_adv_report-&amp;gt;peer_addr.addr, sizeof( observer_data.mac ));
            
                // Put data to observer data
                if ( eRING_BUFFER_OK != ring_buffer_add( g_ble_c.observer_buf, (ble_c_obs_data_t*) &amp;amp;observer_data ))
                {
                    // Buffer overflow!
                    BLE_C_DBG_PRINT( &amp;quot;Observer buffer overflow! Increse buffer size via \&amp;quot;BLE_C_OBSERVER_BUF_SIZE\&amp;quot; macro!&amp;quot;);
                }
            }
        }
    }

    // Continue scanning
    (void) sd_ble_gap_scan_start( NULL, &amp;amp;g_ble_c.scan_data );
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;After two days of testing the results are the same. Dev B still do not re-connect as DevA is blocking it for some jet unknown reason. As you can se from the code, I added additional debug message before calling &amp;quot;&lt;em&gt;&lt;strong&gt;sd_ble_gap_connect&lt;/strong&gt;&lt;/em&gt;&amp;quot; in order to confirm whitelist logic is disable correctly.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;Furthermore I have new informations about the problem that might be useful for your team to further investigate/analyse the problem.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I observe that connectable advertising report is received and after that connection is not established right away. That stands only for peripheral devices that are not close to the central device (located at -85/-95 dBm). In some cases, there might be a time difference for couple of minute (worst case I measure was ~4min). During that time, other devices that are close to central do not get connected, are ignored (they are advertising, confirmed with nRF Sniffer).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I provided a logged file, where you can see the described scenario. Focus on two devices with the same naming convention and roles as we have had used in the post above:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;DevA, MAC:&lt;/strong&gt;&lt;strong&gt;E4:8E:30:81:78:D9&lt;/strong&gt;&lt;em&gt;, device that blocks DevB, located away from central&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;DevB, MAC:&amp;nbsp;CE:AA:75:A4:1C:F1&lt;/strong&gt;&lt;em&gt;, device close to central, but blocked to connect&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Look at the line between 61 and 88 inside attached debug log file&amp;nbsp; from central device - &amp;quot;&lt;em&gt;&lt;strong&gt;OutOfRange_Central_DebugLog__30_06_2023.txt&lt;/strong&gt;&lt;/em&gt;&amp;quot;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Line 61, Time&amp;nbsp;07:28:41.313:&amp;nbsp;&lt;em&gt;BLE_C: Connectable advertising report from E4:8E:30:81:78:D9&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Line 70, Time&amp;nbsp;07:32:37.449:&amp;nbsp;New connection established! Link count: 4 (with&amp;nbsp;&lt;em&gt;E4:8E:30:81:78:D9 device)&lt;/em&gt;&lt;em&gt;&lt;/em&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p style="padding-left:30px;"&gt;(Blocked device with MAC&amp;nbsp;CE:AA:75:A4:1C:F1 was advertising during that time. That device is close to central.)&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;3. Line 78,&amp;nbsp;07:32:37.638:&amp;nbsp;&lt;em&gt;BLE_C: Connectable advertising report from CE:AA:75:A4:1C:F1&lt;/em&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;4. Line 81,&amp;nbsp;07:32:38.737:&lt;em&gt;&amp;nbsp;BLE_C: New connection established! Link count: 5 (with&amp;nbsp;CE:AA:75:A4:1C:F1)&amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Look at the times! Between connectable adv report of DevA and actual connection establishement took 4min. After DevA is connected, DevB gets connected immediately.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;Questions&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Why does it take more time for distand device to established connection?&lt;/li&gt;
&lt;li&gt;Why is this connection est. delay only there for distand devices?&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Is such behaviour expected and compliant with SIG BLE standard?&lt;/li&gt;
&lt;li&gt;Can this be mitigated by any way by application SW?&lt;/li&gt;
&lt;/ol&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Debug log file:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/OutOfRange_5F00_Central_5F00_DebugLog_5F005F00_30_5F00_06_5F00_2023.txt"&gt;devzone.nordicsemi.com/.../OutOfRange_5F00_Central_5F00_DebugLog_5F005F00_30_5F00_06_5F00_2023.txt&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I hope these additional observations might spur some idea within your team.&amp;nbsp;Looking forward to your answer!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you again for all the help!&lt;/p&gt;
&lt;p&gt;BR, Žiga&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Out of range catastrophe</title><link>https://devzone.nordicsemi.com/thread/433082?ContentTypeID=1</link><pubDate>Tue, 27 Jun 2023 05:57:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7a84d07-9fd1-4553-a3b2-f35b93a7fa17</guid><dc:creator>Ziga Miklosic</dc:creator><description>&lt;p&gt;Hello Simonr,&lt;/p&gt;
&lt;p&gt;sorry for late response. I will test your suggestions and will come back with results in a couple of days.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you for all the help!&lt;/p&gt;
&lt;p&gt;BR, Žiga&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Out of range catastrophe</title><link>https://devzone.nordicsemi.com/thread/431469?ContentTypeID=1</link><pubDate>Fri, 16 Jun 2023 11:31:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:209387e9-cbb2-418a-8a48-039dc5d6ffed</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Žiga&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;We just need you to try without the filtering, as that&amp;#39;s what we deem is most likely causing the scanner not to look for device B. Our theory is that when device A goes out of range, the scanner is specifically scanning for the address/ID of device A, and won&amp;#39;t care about any other devices until device A has reconnected (or a power reset is triggered for example).&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Out of range catastrophe</title><link>https://devzone.nordicsemi.com/thread/431256?ContentTypeID=1</link><pubDate>Thu, 15 Jun 2023 12:43:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a1d5c993-7e4f-4d38-ba24-3256909853a1</guid><dc:creator>Ziga Miklosic</dc:creator><description>[quote userid="75734" url="~/f/nordic-q-a/99913/out-of-range-catastrophe/431215"]Can you try my suggestion on removing the whitelist implementation on your scanning device so we could narrow down whether the issue is in fact due to the whitelist implementation or not?[/quote]
&lt;p&gt;As already said:&lt;/p&gt;
[quote userid="119194" url="~/f/nordic-q-a/99913/out-of-range-catastrophe/430654"]There is no filtering/whitelist problem at all. &lt;strong&gt;It is simple the central device stops to scan.&lt;/strong&gt; &lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;The advertising report callback from Soft Device is not being invoked&lt;/span&gt; anymore. &lt;/strong&gt;With the fact that peripheral device advertise correct packets with expected magic number for filtering, as inspected by nRF Sniffer + Wireshark.[/quote]
&lt;p&gt;&lt;strong&gt;Problem is more fundamental and it lies one step before even reaching the whitelist logic&lt;/strong&gt;. As stated the advertising report callback does not come any more, even though sniffing shows that peripheral is advertising.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Any idea why advertising report callback stops to trigger?&lt;/p&gt;
&lt;p&gt;And again, when moving DevA back in range, everything goes to normal. Adv Reports start to come and other devices connects as expected.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/99913/out-of-range-catastrophe/431215"]It is the only thing we can think of that would cause behavior like this, but I&amp;#39;m not able to spot what&amp;#39;s wrong reviewing your project as there are a lot of files and lines of code...[/quote]
&lt;p&gt;I understand that...&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR, Žiga&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Out of range catastrophe</title><link>https://devzone.nordicsemi.com/thread/431215?ContentTypeID=1</link><pubDate>Thu, 15 Jun 2023 11:04:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03790b7d-3b28-408e-b0fb-d004135eb1a5</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Can you try my suggestion on removing the whitelist implementation on your scanning device so we could narrow down whether the issue is in fact due to the whitelist implementation or not? Then you can see whether the scanner is able to find device B in the same scenario or not.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It is the only thing we can think of that would cause behavior like this, but I&amp;#39;m not able to spot what&amp;#39;s wrong reviewing your project as there are a lot of files and lines of code...&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Out of range catastrophe</title><link>https://devzone.nordicsemi.com/thread/430905?ContentTypeID=1</link><pubDate>Wed, 14 Jun 2023 07:31:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee7b0cbb-84db-4797-bda7-0040165f21d5</guid><dc:creator>Ziga Miklosic</dc:creator><description>&lt;p&gt;Hi Simonr,&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/99913/out-of-range-catastrophe/430900"]But if the central device stops scanning, it doesn&amp;#39;t make sense that it is able to immediately reconnect if advertising device A moves back into range, which is still the case, correct?[/quote]
&lt;p&gt;Yes, this is the case. I should have stated &amp;quot;central device stops to scan&amp;quot; in more precise way! It is more like: &amp;quot;&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;Central device scan is blocked by out of range DevA&lt;/strong&gt;&lt;/span&gt;&amp;quot;. And from DevB perspective we can say: &amp;quot;Central device stops to scan&amp;quot;, as effectively we observed that from DevB point of view.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/99913/out-of-range-catastrophe/430900"]Putting device A back into range wouldn&amp;#39;t restart the scanning in any way, so it&amp;#39;s more likely that the scanner can&amp;#39;t scan for advertising packets other than from device A when device A was first moved out of range, which is likely why you don&amp;#39;t see advertising reports from device B in your log.[/quote]
&lt;p&gt;Correct.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/99913/out-of-range-catastrophe/430900"]I think the central is indeed scanning (since it reconnects immediately to device A when it is moved back into range), so to me it sounds like it&amp;#39;s just not picking up advertising packets from device B in this scenario for some reason.[/quote]
&lt;p&gt;Yes, I totally agree with you!&lt;/p&gt;
&lt;p&gt;What can be the reason for that? And how can we mitigate that?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Overall, that is a major drawback to our products, so we would be very glad if we can come to the bottom of the problem.&lt;/p&gt;
&lt;p&gt;BR, Žiga&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Out of range catastrophe</title><link>https://devzone.nordicsemi.com/thread/430900?ContentTypeID=1</link><pubDate>Wed, 14 Jun 2023 07:14:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5348da7-8518-4be7-852a-ac8bb28f65e8</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Žiga&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;But if the central device stops scanning, it doesn&amp;#39;t make sense that it is able to immediately reconnect if advertising device A moves back into range, which is still the case, correct? Putting device A back into range wouldn&amp;#39;t restart the scanning in any way, so it&amp;#39;s more likely that the scanner can&amp;#39;t scan for advertising packets other than from device A when device A was first moved out of range, which is likely why you don&amp;#39;t see advertising reports from device B in your log. It&amp;#39;s definitely advertising (from the sniffer traces) and I think the central is indeed scanning (since it reconnects immediately to device A when it is moved back into range), so to me it sounds like it&amp;#39;s just not picking up advertising packets from device B in this scenario for some reason.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Simon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Out of range catastrophe</title><link>https://devzone.nordicsemi.com/thread/430654?ContentTypeID=1</link><pubDate>Tue, 13 Jun 2023 08:34:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:716f936c-c2ff-4a02-8c62-03c035c22630</guid><dc:creator>Ziga Miklosic</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/simonr"&gt;Simonr&lt;/a&gt;&amp;nbsp;,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/99913/out-of-range-catastrophe/429917"]So, the only thing we can see that could be the issue, is that you seem to call the &lt;strong&gt;sd_ble_gap_connect&lt;/strong&gt;() function manually in your project instead of our scan module, where it&amp;#39;s called from&amp;nbsp;&lt;strong&gt;nrf_ble_scan_connect_with_target&lt;/strong&gt;(). You can see the nrf_ble_scan.c/.h files for reference.[/quote]
&lt;p&gt;Yes, but the program flow is the same. At advertising report checking for target device (whitelist), then performing connection by first calling&amp;nbsp;&lt;strong&gt;sd_ble_gap_scan_stop() &lt;/strong&gt;and then&lt;strong&gt;&amp;nbsp;sd_ble_gap_connect(). &lt;/strong&gt;After that continue scanning with&lt;strong&gt;&amp;nbsp;sd_ble_gap_scan_start(NULL, ...)&lt;/strong&gt; is called. Therefore our custom code and Nordic official scan module have a same sequence of SD API calls. So I would argue that custom implementation of that specific code shall not be a problem...&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/99913/out-of-range-catastrophe/429917"]1. Enable logging that prints out scanned devices so you can see if device B is actually detected on the scanner side at all[/quote]
&lt;p&gt;I have done that and capture all BLE related events on central side. There was very little code change, nothing that directly related to BLE. In following attachment you can find debug log:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/OutOfRange_5F00_Central_5F00_DebugLog_5F00_ManyDevice_5F00_Error_5F00_2_5F005F00_13_5F00_06_5F00_2023.txt"&gt;devzone.nordicsemi.com/.../OutOfRange_5F00_Central_5F00_DebugLog_5F00_ManyDevice_5F00_Error_5F00_2_5F005F00_13_5F00_06_5F00_2023.txt&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Measurement was done with single central device (same FW as discussed above in the post) and 8 peripheral devices, to mimic the real life scenario problem. Two of peripheral devices was out of range from begging of the test, but that is not important at that point. What I found out that after the random time during test, scanner on central side stops. So debug log &amp;quot;&lt;em&gt;&lt;strong&gt;Connectable advertising report&lt;/strong&gt;&lt;/em&gt;&amp;quot; stops. &lt;span style="text-decoration:underline;"&gt;The peripheral device was in fact advertise in that time, as this was confirm by nRF Sniffer! &lt;/span&gt;But on central device advertising report callback did not come as there was no debug log saying &amp;quot;&lt;em&gt;Connectable advertising report&lt;/em&gt;&amp;quot;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/99913/out-of-range-catastrophe/429917"]&lt;ul&gt;&lt;li&gt;Scanner can&amp;#39;t scan for advertising packets from device B because of the whitelist implementation&lt;/li&gt;
&lt;li&gt;Scanner finds advertising packets from device B but does not call sd_ble_gap_connect() due to some logic or filter (whitelist most likely)&lt;/li&gt;
&lt;li&gt;Scanner calls sd_ble_gap_connect() for B, but the radio packet isn&amp;#39;t sent for some reason.&lt;/li&gt;&lt;/ul&gt;[/quote]
&lt;p&gt;None of the above is true.&lt;/p&gt;
&lt;p&gt;There is no filtering/whitelist problem at all. &lt;strong&gt;It is simple the central device stops to scan.&lt;/strong&gt; &lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;The advertising report callback from Soft Device is not being invoked&lt;/span&gt; anymore. &lt;/strong&gt;With the fact that peripheral device advertise correct packets with expected magic number for filtering, as inspected by nRF Sniffer + Wireshark.&lt;/p&gt;
&lt;p&gt;So there we have it,&lt;strong&gt;&lt;span style="background-color:#ffff00;text-decoration:underline;"&gt; central device stops to scan&lt;/span&gt;. &lt;/strong&gt;That must be te problem here as all facts point to that issue.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;The question now is, why does that happens? Do we have some scan related software issues? Can you find any anomaly in our code implementation to manifest in scan problems?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you again with all the help!&lt;/p&gt;
&lt;p&gt;BR, Žiga&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;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Out of range catastrophe</title><link>https://devzone.nordicsemi.com/thread/429917?ContentTypeID=1</link><pubDate>Thu, 08 Jun 2023 08:56:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51bec2a6-7dd8-4143-8009-9fbd936acbbe</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi again&lt;/p&gt;
&lt;p&gt;So, the only thing we can see that could be the issue, is that you seem to call the &lt;strong&gt;sd_ble_gap_connect&lt;/strong&gt;() function manually in your project instead of our scan module, where it&amp;#39;s called from&amp;nbsp;&lt;strong&gt;nrf_ble_scan_connect_with_target&lt;/strong&gt;(). You can see the nrf_ble_scan.c/.h files for reference.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s hard to tell without being able to debug on our end, but there must be that your project doesn&amp;#39;t want to call sd_ble_gap_connect() when what you describe with device B trying to reconnect before device A occurs.&amp;nbsp;A few things you could try to narrow down the issue:&lt;/p&gt;
&lt;p&gt;1. Enable logging that prints out scanned devices so you can see if device B is actually detected on the scanner side at all.&lt;/p&gt;
&lt;p&gt;2. Remove the whitelisting altogether on the scanner, and check whether or not you&amp;#39;re then able to capture advertising and&amp;nbsp; connect to device B in this scenario. That way we should be able to pin point the issue to be either of the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Scanner can&amp;#39;t scan for advertising packets from device B because of the whitelist implementation&lt;/li&gt;
&lt;li&gt;Scanner finds advertising packets from device B but does not call sd_ble_gap_connect() due to some logic or filter (whitelist most likely)&lt;/li&gt;
&lt;li&gt;Scanner calls sd_ble_gap_connect() for B, but the radio packet isn&amp;#39;t sent for some reason.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Out of range catastrophe</title><link>https://devzone.nordicsemi.com/thread/429672?ContentTypeID=1</link><pubDate>Wed, 07 Jun 2023 05:55:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a27f1bec-92a4-48c1-a2fe-f70667af5d28</guid><dc:creator>Ziga Miklosic</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/simonr"&gt;Simonr&lt;/a&gt;&amp;nbsp;,&lt;/p&gt;
&lt;p&gt;thank you for not giving up!&amp;nbsp;&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/99913/out-of-range-catastrophe/429346"]I have asked for a second opinion internally to see if any of my colleagues can find what&amp;#39;s wrong, as I expect I must have missed something. I hope to get back to you tomorrow with a second pair of eyes and some idea of what we&amp;#39;re missing here.[/quote]
&lt;p&gt;&amp;nbsp;I&amp;#39;m eager to get more info and perhaps some solution ideas :)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/99913/out-of-range-catastrophe/429346"]Or if we could get a version of the project that builds for and can reproduce this issue on nRF52840 DKs it would be helpful for us to see this on our end as well.[/quote]
&lt;p&gt;Unfortunately, both central &amp;amp; peripheral mock-up project are prepared for custom board.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I attached both project as a .zip file with a password (as it contains sensitive company data). I&amp;#39;ll send you password over friend request. I hope you received it.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/RBD_5F00_Central_5F00_Mockup_5F005F00_DevZone.zip"&gt;devzone.nordicsemi.com/.../RBD_5F00_Central_5F00_Mockup_5F005F00_DevZone.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/RBD_5F00_Mockup_5F005F00_DevZone.zip"&gt;devzone.nordicsemi.com/.../RBD_5F00_Mockup_5F005F00_DevZone.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks again for all the help!&lt;/p&gt;
&lt;p&gt;BR, Žiga&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Out of range catastrophe</title><link>https://devzone.nordicsemi.com/thread/429346?ContentTypeID=1</link><pubDate>Mon, 05 Jun 2023 14:11:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f50418f-30ab-4811-9262-f719f5690df2</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi again&lt;/p&gt;
&lt;p&gt;I have looked at your project files, where the scanning and connection setup seems to be perfectly fine as far as I can tell, and the sniffer logs doesn&amp;#39;t appear to act unexpectedly either (except the part where the central doesn&amp;#39;t try to reconnect to Device B of course). At least this confirms that there must be the central side that is causing issues here. I have asked for a second opinion internally to see if any of my colleagues can find what&amp;#39;s wrong, as I expect I must have missed something. I hope to get back to you tomorrow with a second pair of eyes and some idea of what we&amp;#39;re missing here. Thank you for your patience again!&lt;/p&gt;
&lt;p&gt;I know we&amp;#39;ve tested Coded PHY scanning, advertising and reconnecting similar to this on SoftDevice 7.2.0 and SDK v17.1.0 before so I don&amp;#39;t think that where the problem lies either. Could you also upload your main file perhaps so we can get a better view of your project as a whole. Or if we could get a version of the project that builds for and can reproduce this issue on nRF52840 DKs it would be helpful for us to see this on our end as well.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Out of range catastrophe</title><link>https://devzone.nordicsemi.com/thread/428659?ContentTypeID=1</link><pubDate>Thu, 01 Jun 2023 09:17:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:797d38d1-8beb-4e30-ae4c-073c9f88f00c</guid><dc:creator>Ziga Miklosic</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/simonr"&gt;Simonr&lt;/a&gt;&amp;nbsp;,&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/99913/out-of-range-catastrophe/428446"]From the sniffer trace I hoped to see Device B as well, to see if it shows up as advertising at all when device A and then device B is moved out of range, and if there is in fact a connection request to device B made. But it seems like you only connect to Device A, then reconnect to it, is that correct?[/quote]
&lt;p&gt;Yes, I filter out the device B as I wanted to show you also connection packets and therefore selected only DevA:&amp;nbsp;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1685609274503v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/99913/out-of-range-catastrophe/428446"]Do you see that Device B actually advertises, either on the central device, another central device, or sniffer trace after both devices are moved out of range, and device B is moved back into range?&amp;nbsp;[/quote]
&lt;p&gt;I repeated the measurement with &lt;strong&gt;two nRF52840-DK sniffers&lt;/strong&gt;, one is observing DevA and other DevB. Measurement&amp;nbsp;&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;confirms that DevB is actually advertising.&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;A take a step further and logged connection state and RSSI of DevA &amp;amp; B simultaneously with Wireshark sniffer. There is some minor (less than 5sec) difference between start of logged file and start of sniffed file. As I was not able to start it all at the same time manually. So sniffed and logged data are soft of synchronised.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;Sniffed files:&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;MAC Addresses:&lt;br /&gt; Central: E2:1E:EA:19:77:C2&lt;br /&gt; Peripheral DevA: DD:5F:43:78:58:0E&lt;br /&gt; Peripheral DevB: CE:AA:75:A4:1C:F1&lt;/p&gt;
&lt;p&gt;Same test actions were done as with previous measurement (look at my previous post).&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/OutOfRange_5F00_DualTest_5F00_DevA_5F005F00_2_5F005F00_01_5F00_06_5F00_2023.pcapng"&gt;devzone.nordicsemi.com/.../OutOfRange_5F00_DualTest_5F00_DevA_5F005F00_2_5F005F00_01_5F00_06_5F00_2023.pcapng&lt;/a&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/OutOfRange_5F00_DualTest_5F00_DevB_5F005F00_2_5F005F00_01_5F00_06_5F00_2023.pcapng"&gt;devzone.nordicsemi.com/.../OutOfRange_5F00_DualTest_5F00_DevB_5F005F00_2_5F005F00_01_5F00_06_5F00_2023.pcapng&lt;/a&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;Logged measurement connection state &amp;amp; RSSI:&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;&lt;img style="max-height:353px;max-width:452px;" alt=" " height="353" src="https://devzone.nordicsemi.com/resized-image/__size/904x706/__key/communityserver-discussions-components-files/4/OutOfRange_5F00_DualTest_5F00_2_5F00_Described.png" width="452" /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;Measurement conclusion:&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;DevB is advertising while DevA is still out of range. Cetral Dev is not initiating connection (not sending connection req) towards DevB. After DevA is moved back to range, both devices are re-connected and normal operation is re-established.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/99913/out-of-range-catastrophe/428446"]Do you get either of those two logs printed when device B gets back into range whenever it&amp;#39;s not able to reconnect because of device A &amp;quot;still&amp;quot; being out of range?[/quote]
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;Yes, as confirmed with sniffed data, DevB is advertising when DevA is out of range and sort of &amp;quot;blocking&amp;quot; the connection with DevB. Those two logs are disabled as BLE_C_PRINTF is blocking in nature and therefore program might be blocked for too long in observer handler.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;Other questions&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;- Did you have a time to look at the code? Do you maybe have any comments/improvements regarding SD API usage?&lt;/p&gt;
&lt;p&gt;- As it is obvious Central device problem, what will be the next think to look at? Can it be that SDK is not properly configurated?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you for all the help!&lt;/p&gt;
&lt;p&gt;BR, Žiga&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Out of range catastrophe</title><link>https://devzone.nordicsemi.com/thread/428446?ContentTypeID=1</link><pubDate>Wed, 31 May 2023 12:14:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:809498cb-5433-49cf-af67-0d01eafc20b0</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi again&amp;nbsp;&lt;span&gt;Žiga&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;From the sniffer trace I hoped to see Device B as well, to see if it shows up as advertising at all when device A and then device B is moved out of range, and if there is in fact a connection request to device B made. But it seems like you only connect to Device A, then reconnect to it, is that correct?&lt;/p&gt;
&lt;p&gt;Do you see that Device B actually advertises, either on the central device, another central device, or sniffer trace after both devices are moved out of range, and device B is moved back into range?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m sorry, I did indeed miss the paragraph where you explained&amp;nbsp;where to find your whitelist. From the following part of your&amp;nbsp;&lt;span&gt;&lt;span dir="ltr"&gt;ble_c_evt_on_adv_report();&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span dir="ltr"&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// Advertisment status OK

    if ( BLE_GAP_ADV_DATA_STATUS_COMPLETE == p_adv_type-&amp;gt;status )

    {

        // Get manufacturer data

        if ( eBLE_C_OK == ble_c_get_manufacturer_data( p_adv_data, adv_data_len, (uint8_t*) &amp;amp;man_data, &amp;amp;man_data_len ))

        {

            // Advertisment request for connection

            if ( 1U == p_adv_type-&amp;gt;connectable )

            {

                BLE_C_DBG_PRINT( &amp;quot;Connectable advertising report!&amp;quot; );




                // Is this device already connected

                if ( false == ble_c_check_dev_conn( p_adv_report-&amp;gt;peer_addr.addr ))

                {                      

                    // Check for magic request

                    if ( true == ble_c_check_magic_request( man_data, man_data_len ))

                    {

                        // Stop scanning before connection

                        (void) sd_ble_gap_scan_stop();




                        // Connect to peer device

                        if ( NRF_SUCCESS != sd_ble_gap_connect( &amp;amp;p_adv_report-&amp;gt;peer_addr, &amp;amp;g_ble_c.scan_params, &amp;amp;g_ble_c.conn_params, BLE_C_CONN_CFG_TAG ))

                        {

                            BLE_C_DBG_PRINT( &amp;quot;Attept to connect failed!&amp;quot; );

                        }

                    }

                }

            }&lt;/pre&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span dir="ltr"&gt;Do you get either of those two logs printed when device B gets back into range whenever it&amp;#39;s not able to reconnect because of device A &amp;quot;still&amp;quot; being out of range? Additional logging might be helpful to get a better picture of what&amp;#39;s going on.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Out of range catastrophe</title><link>https://devzone.nordicsemi.com/thread/428035?ContentTypeID=1</link><pubDate>Tue, 30 May 2023 05:57:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88acec51-0102-4255-a8a0-73945d3fa418</guid><dc:creator>Ziga Miklosic</dc:creator><description>&lt;p&gt;Hello&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/simonr"&gt;Simonr&lt;/a&gt;&amp;nbsp;,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Please find the sniffed BLE communication and test description (README.txt) in the attachement:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/README.txt"&gt;devzone.nordicsemi.com/.../README.txt&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/OutOfRange_5F00_test_5F00_1_5F005F00_29_5F00_05_5F00_2023.pcapng"&gt;devzone.nordicsemi.com/.../OutOfRange_5F00_test_5F00_1_5F005F00_29_5F00_05_5F00_2023.pcapng&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I also added packet comments to .pcapng file to easier track of major events.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I hope this will speed up solving the out of range problem!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR, Žiga&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Out of range catastrophe</title><link>https://devzone.nordicsemi.com/thread/427960?ContentTypeID=1</link><pubDate>Mon, 29 May 2023 05:47:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47b3336b-7a10-4cb7-a8fd-cc9e9deb573b</guid><dc:creator>Ziga Miklosic</dc:creator><description>&lt;p&gt;Sorry for late response, I&amp;#39;ve been out of office on friday!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Answers&lt;/strong&gt;&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/99913/out-of-range-catastrophe/427785"]Okay, and there is the same manufacturer data on all devices, so it shouldn&amp;#39;t matter what manufacturer data the advertising devices transmit? Since I don&amp;#39;t know how this custom whitelist is implemented my thoughts go to the central scanning for data that the first disconnected device (A) is advertising, and thus doesn&amp;#39;t really &amp;quot;look for&amp;quot; the device B.[/quote]
&lt;p&gt;Yes and no. All peripheral devices advertise manufacturer data, that is true. The content of manufacturer data on does matter, as based on valid data values connection is being initiated. Please,&amp;nbsp;&lt;span&gt;look at the attached code inside &amp;quot;&lt;/span&gt;&lt;em&gt;&lt;strong&gt;ble_c.c&lt;/strong&gt;&lt;/em&gt;&lt;span&gt;&amp;quot; line 1175:&amp;nbsp;&lt;/span&gt;&lt;em&gt;ble_c_evt_on_adv_report&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1685338720149v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;hr /&gt;[quote userid="75734" url="~/f/nordic-q-a/99913/out-of-range-catastrophe/427785"]Any chance you can upload the file where the whitelist implementation is done so we can take a look at how you&amp;#39;ve implemented this?[/quote]
&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/simonr"&gt;Simonr&lt;/a&gt;&amp;nbsp;I have a feeling that you read my post/answers superficially, as I already upload code and pointed out where to look for whitelist implementation:&lt;/p&gt;
[quote userid="119194" url="~/f/nordic-q-a/99913/out-of-range-catastrophe/427527"]Central device is using whitelist, but custom implemented one. It simply check for manufacturer data inside connectable advertisement packet and if that data match it tries to connect to that peripheral (look at the attached code inside &amp;quot;&lt;em&gt;&lt;strong&gt;ble_c.c&lt;/strong&gt;&lt;/em&gt;&amp;quot; line 1175: &lt;em&gt;ble_c_evt_on_adv_report&lt;/em&gt;).[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;hr /&gt;[quote userid="75734" url="~/f/nordic-q-a/99913/out-of-range-catastrophe/427785"]As&amp;nbsp;of version 4.0.0 of the &lt;a href="https://www.nordicsemi.com/Products/Development-tools/nrf-sniffer-for-bluetooth-le/download#infotabs"&gt;nRF Sniffer&lt;/a&gt; supports Coded PHY, so that should be fine.[/quote]
&lt;p&gt;OK, great! Then I will take time to repeate experiment and prepare sniffed files. This might take some time for me. In meanwhile I would be very glad if we can continue to search for the obvious reason.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:black;font-family:&amp;#39;Arial&amp;#39;,sans-serif;font-size:9.0pt;"&gt;Thank you again for all the help. We really appreciate your help!&lt;/span&gt;&lt;/p&gt;
&lt;p style="text-align:start;"&gt;&lt;span style="color:black;font-family:&amp;#39;Arial&amp;#39;,sans-serif;font-size:9.0pt;"&gt;BR, Žiga&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Out of range catastrophe</title><link>https://devzone.nordicsemi.com/thread/427785?ContentTypeID=1</link><pubDate>Fri, 26 May 2023 12:08:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:edee37f5-49b2-4ae0-8ef0-31775f660a50</guid><dc:creator>Simonr</dc:creator><description>[quote user="ziga_m"]Central device is using whitelist, but custom implemented one. It simply check for manufacturer data inside connectable advertisement packet and if that data match it tries to connect to that peripheral (look at the attached code inside &amp;quot;&lt;em&gt;&lt;strong&gt;ble_c.c&lt;/strong&gt;&lt;/em&gt;&amp;quot; line 1175: &lt;em&gt;ble_c_evt_on_adv_report&lt;/em&gt;).[/quote]
&lt;p&gt;Okay, and there is the same manufacturer data on all devices, so it shouldn&amp;#39;t matter what manufacturer data the advertising devices transmit? Since I don&amp;#39;t know how this custom whitelist is implemented my thoughts go to the central scanning for data that the first disconnected device (A) is advertising, and thus doesn&amp;#39;t really &amp;quot;look for&amp;quot; the device B. Any chance you can upload the file where the whitelist implementation is done so we can take a look at how you&amp;#39;ve implemented this?&lt;/p&gt;
&lt;p&gt;As&amp;nbsp;of version 4.0.0 of the &lt;a href="https://www.nordicsemi.com/Products/Development-tools/nrf-sniffer-for-bluetooth-le/download#infotabs"&gt;nRF Sniffer&lt;/a&gt; supports Coded PHY, so that should be fine.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Out of range catastrophe</title><link>https://devzone.nordicsemi.com/thread/427527?ContentTypeID=1</link><pubDate>Thu, 25 May 2023 12:37:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae7471b9-e06a-4967-8b70-cd45aaca7eb8</guid><dc:creator>Ziga Miklosic</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/99913/out-of-range-catastrophe/427509"]Can you explain a bit more on how the central device behaves when a peripheral is disconnected? [/quote]
&lt;p&gt;As described, central device will start to scan right after disconnection of the peripheral device in order to obtain connection back:&lt;/p&gt;
[quote userid="119194" url="~/f/nordic-q-a/99913/out-of-range-catastrophe"]So, we prepare a simple mock-up test application to check out how the system will behave in real-life scenarios. Test application was very simple, central BLE device scans continuously and stops after all 8 connections are established. Peripheral BLE devices advertise when not in connection. With such approach system shall always converge to have all devices connected, as if one device gets disconnected advertising/scanning shall re-started and the drop connections should re-establish. Every second 64 bytes of dummy data were exchange between central and peripheral device based on server-initiate update (notification type). Tx power for advertising and connection was set to 8dBm. Connection interval was set to 1500ms, SlaveLatency to 2 and Supervision Timeout to 15000ms. Well, it works perfectly on a desk!&amp;nbsp;[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/99913/out-of-range-catastrophe/427509"]To me it doesn&amp;#39;t really seem like an issue on the peripheral, but rather with how the central device handles disconnects and reconnections.[/quote]
&lt;p&gt;Yes, we also thinks that the problem is on central side, as said:&lt;/p&gt;
[quote userid="119194" url="~/f/nordic-q-a/99913/out-of-range-catastrophe"]We suspect that Device A (goes out of range first) block Device B in context of advertisement, as both devices are peripheral. But that is not the case as we done separate tests to eliminate that possibility, where the first disconnected device did not start advertising at disconnection. Same effect was observed, other devices did not re-connect and thus conclude that advertisement do not play role in that effect, meaning that &lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;the&amp;nbsp;&lt;/strong&gt;&lt;strong&gt;problem lives on Central device&lt;/strong&gt;&lt;/span&gt;.[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/99913/out-of-range-catastrophe/427509"]It almost seems like when a device is disconnected, the central device will wait for that specific device to reconnect before allowing/searching for any other disconnected peripherals.[/quote]
&lt;p&gt;Exactly! That behaviour is repeatable and easily reproduced. &lt;span style="background-color:#ffff99;text-decoration:underline;"&gt;&lt;strong&gt;But note that only when data transmission is enabled!&lt;/strong&gt;&lt;/span&gt; As said:&lt;/p&gt;
[quote userid="119194" url="~/f/nordic-q-a/99913/out-of-range-catastrophe"]&lt;ul&gt;&lt;li&gt;If we take Device A (one of the 8 peripheral devices, all in connection) out of range, it disconnects. If then moved back to range, it connects back without any problems - &lt;span style="background-color:rgba(153, 204, 0, 1);"&gt;&lt;strong&gt;NORMAL EXPECTED OPERATION&lt;/strong&gt;,&lt;/span&gt;&lt;span style="background-color:rgba(153, 204, 0, 1);"&gt;&lt;/span&gt;&lt;span style="background-color:rgba(153, 204, 0, 1);"&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;If we take Device A (one of the 8 peripheral devices, all in connection) out of range, it disconnects. If we then move Device B (&lt;span&gt;one of the 8 peripheral devices, all beside Device A in connection) out of range, it disconnects. Then Device B does not re-connect when moved back to range. Only after moving Device A back to range, both Devices A &amp;amp; B gets re-connected. &lt;span style="background-color:rgba(255, 255, 0, 1);text-decoration:underline;"&gt;&lt;strong&gt;It is like Device A is blocking Device B from re-connectiong, regardless Device B is in range!&lt;/strong&gt;&lt;/span&gt; - &lt;span style="background-color:rgba(255, 0, 0, 1);"&gt;&lt;strong&gt;ABNORMAL OPERATION&lt;/strong&gt;&lt;/span&gt;,&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;We observe that &lt;span style="background-color:rgba(255, 255, 0, 1);"&gt;&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;only first disconnected device&amp;nbsp;&lt;/strong&gt;&lt;/span&gt;(due to out of range) &lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;blocks other from re-connecting&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;. Moving first disconnected device back to range triggers all other devices to re-connect,&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;We suspect that Device A (goes out of range first) block Device B in context of advertisement, as both devices are peripheral. But that is not the case as we done separate tests to eliminate that possibility, where the first disconnected device did not start advertising at disconnection. Same effect was observed, other devices did not re-connect and thus conclude that advertisement do not play role in that effect, meaning that &lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;the&amp;nbsp;&lt;/strong&gt;&lt;strong&gt;problem lives on Central device&lt;/strong&gt;&lt;/span&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;If we &lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;disable data transmission&lt;/strong&gt;&lt;/span&gt; on Central Device and Device A and repeat point 2., Device B gets re-connected when moved back to range. In that test case Device A &lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;did not blocked&lt;/strong&gt;&lt;/span&gt; Device B from re-connection.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/99913/out-of-range-catastrophe/427509"]Does the central scan for each specific device using a whitelist, or does it put the disconnected devices in a queue for example so that device B will not be considered to connect before device A is reconnected?[/quote]
&lt;p&gt;Central device is using whitelist, but custom implemented one. It simply check for manufacturer data inside connectable advertisement packet and if that data match it tries to connect to that peripheral (look at the attached code inside &amp;quot;&lt;em&gt;&lt;strong&gt;ble_c.c&lt;/strong&gt;&lt;/em&gt;&amp;quot; line 1175: &lt;em&gt;ble_c_evt_on_adv_report&lt;/em&gt;).&lt;/p&gt;
&lt;p&gt;There is no mechanism implemented to block devices to re-connect in any way. This was also verified in described test (look at the test point 2, 3, 4). In normal conditions (all devices in range) everythink is working as expected.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/99913/out-of-range-catastrophe/427509"]Are you able to share a sniffer trace using a&lt;a href="https://www.ellisys.com/products/bv1/"&gt; dedicated sniffer &lt;/a&gt;or the &lt;a href="https://www.nordicsemi.com/Products/Development-tools/nrf-sniffer-for-bluetooth-le"&gt;nRF Sniffer&lt;/a&gt; so we can see what messages are being sent over the air when this issue occurs.[/quote]
&lt;p&gt;&lt;span style="color:black;font-family:&amp;#39;Arial&amp;#39;,sans-serif;font-size:9.0pt;"&gt;Unfortunately, we don&amp;#39;t own BLE sniffer. Does nRF Sniffer support CODED PHY? I need to check it and will provide you with logged data. That will take some time for me, so expect to get answer beginning of next week.&lt;/span&gt;&lt;/p&gt;
&lt;p style="text-align:start;"&gt;&lt;span style="color:black;font-family:&amp;#39;Arial&amp;#39;,sans-serif;font-size:9.0pt;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p style="text-align:start;"&gt;&lt;span style="color:black;font-family:&amp;#39;Arial&amp;#39;,sans-serif;font-size:9.0pt;"&gt;Here is also our sdk_config and LL BLE driver code in case you find out some obvious problems:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ble_5F00_c.c"&gt;devzone.nordicsemi.com/.../ble_5F00_c.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ble_5F00_c.h"&gt;devzone.nordicsemi.com/.../ble_5F00_c.h&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/4477.sdk_5F00_config.h"&gt;devzone.nordicsemi.com/.../4477.sdk_5F00_config.h&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I hope given information will be sufficient to start investigating of the problem. As we do not have any clue how to solve/mitigate that problem, we would be very glad to get any ideas/recommendations where to start&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Thank you for all the help!&lt;/p&gt;
&lt;p&gt;BR, Žiga&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Out of range catastrophe</title><link>https://devzone.nordicsemi.com/thread/427509?ContentTypeID=1</link><pubDate>Thu, 25 May 2023 11:47:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c67b6aa-cadf-4f89-8bf0-5b1e91547e1c</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve read through the case, and this behavior seems very strange indeed. Thank you for the thorough explanation! Can you explain a bit more on how the central device behaves when a peripheral is disconnected? It almost seems like when a device is disconnected, the central device will wait for that specific device to reconnect before allowing/searching for any other disconnected peripherals.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Does the central scan for each specific device using a whitelist, or does it put the disconnected devices in a queue for example so that device B will not be considered to connect before device A is reconnected? To me it doesn&amp;#39;t really seem like an issue on the peripheral, but rather with how the central device handles disconnects and reconnections.&lt;/p&gt;
&lt;p&gt;Are you able to share a sniffer trace using a&lt;a href="https://www.ellisys.com/products/bv1/"&gt; dedicated sniffer &lt;/a&gt;or the &lt;a href="https://www.nordicsemi.com/Products/Development-tools/nrf-sniffer-for-bluetooth-le"&gt;nRF Sniffer&lt;/a&gt; so we can see what messages are being sent over the air when this issue occurs.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Out of range catastrophe</title><link>https://devzone.nordicsemi.com/thread/427496?ContentTypeID=1</link><pubDate>Thu, 25 May 2023 11:28:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:85ecca8a-2a1d-4c20-998c-e9717a109ac6</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hello&amp;nbsp;&lt;span&gt;Žiga&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m very sorry, but this case seem to have slipped through the cracks during the public holidays last week and we&amp;#39;re only just now getting to it. I just wanted to let you know that I&amp;#39;m now looking into it and will get back to you later today or tomorrow when I&amp;#39;ve read and understood your case.&lt;/p&gt;
&lt;p&gt;Thank you for your patience,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>