<?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>Beacon Scanner Problem</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/41369/beacon-scanner-problem</link><description>Hello, 
 I have beacon advertiser and scanner. Scanner is scanning the devices from around. But its not scanning the device that i used for advertising. On the other side, NRF Connet application able to scan my advertising device. I have attached my Scanner</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 12 Nov 2021 22:33:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/41369/beacon-scanner-problem" /><item><title>RE: Beacon Scanner Problem</title><link>https://devzone.nordicsemi.com/thread/338859?ContentTypeID=1</link><pubDate>Fri, 12 Nov 2021 22:33:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a80c57b0-916c-4757-b3b6-a582957e2735</guid><dc:creator>Reza papi</dc:creator><description>&lt;p&gt;Thank you &lt;a href="https://devzone.nordicsemi.com/members/aryan"&gt;Susheel Nuguru&lt;/a&gt; for your time. I really appreciate it. I just copy the above code to the BLE template code in SDK17 but unfortunately, I did not receive any data.&lt;/p&gt;
&lt;p&gt;Best,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Beacon Scanner Problem</title><link>https://devzone.nordicsemi.com/thread/338698?ContentTypeID=1</link><pubDate>Fri, 12 Nov 2021 08:45:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66c5d072-c2e4-4014-8899-ad1b3bac9897</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;sorry for coming back so late, i tried these attached code in SDK17 without any modifications and it works as it is. I see no issues with scanner not able to find the beacon packets.&lt;/p&gt;
&lt;div style="left:193px;top:22.6px;"&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Beacon Scanner Problem</title><link>https://devzone.nordicsemi.com/thread/337762?ContentTypeID=1</link><pubDate>Fri, 05 Nov 2021 17:43:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7209b629-3495-49b2-be5c-846ccadc438e</guid><dc:creator>Reza papi</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#include &amp;lt;stdint.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;string.h&amp;gt;
#include &amp;quot;nrf_sdh.h&amp;quot;
#include &amp;quot;nrf_sdh_ble.h&amp;quot;
#include &amp;quot;nrf_sdh_soc.h&amp;quot;
#include &amp;quot;nrf_pwr_mgmt.h&amp;quot;
#include &amp;quot;ble.h&amp;quot;
#include &amp;quot;nrf_delay.h&amp;quot;
#include &amp;quot;nrf_log.h&amp;quot;
#include &amp;quot;nrf_log_ctrl.h&amp;quot;
#include &amp;quot;nrf_log_default_backends.h&amp;quot;

#define SCAN_INTERVAL                   0x00A0                              /**&amp;lt; Determines scan interval in units of 0.625 millisecond. */
#define SCAN_WINDOW                     0x0050                              /**&amp;lt; Determines scan window in units of 0.625 millisecond. */
#define SCAN_DURATION                   0x0000                              /**&amp;lt; Timout when scanning. 0x0000 disables timeout. */
#define APP_BLE_CONN_CFG_TAG            1                                   /**&amp;lt; A tag identifying the SoftDevice BLE configuration. */
#define APP_BLE_OBSERVER_PRIO           3                                   /**&amp;lt; Application&amp;#39;s BLE observer priority. You shouldn&amp;#39;t need to modify this value. */

static ble_gap_scan_params_t const m_scan_params =
{
    .extended = 0,
    .report_incomplete_evts = 0,
    .active   = 1,
    .filter_policy = BLE_GAP_SCAN_FP_ACCEPT_ALL,
    .scan_phys = BLE_GAP_PHY_1MBPS,
    .interval = SCAN_INTERVAL,
    .window   = SCAN_WINDOW,
    .timeout  = SCAN_DURATION
};

static uint8_t m_scan_buffer_data[BLE_GAP_SCAN_BUFFER_MIN]; /**&amp;lt; buffer where advertising reports will be stored by the SoftDevice. */

static ble_data_t m_scan_buffer =
{
    m_scan_buffer_data,
    BLE_GAP_SCAN_BUFFER_MIN
};

static void scan_start(void)
{
    (void) sd_ble_gap_scan_stop();
    sd_ble_gap_scan_start(&amp;amp;m_scan_params, &amp;amp;m_scan_buffer);
}

uint8_t * adv_address = 0; int8_t rssi = 0; uint8_t * adv_data = 0;

static void on_adv_report(ble_gap_evt_adv_report_t const * p_adv_report)
{
    adv_address = (uint8_t *)p_adv_report-&amp;gt;peer_addr.addr;
    rssi = (int8_t)p_adv_report-&amp;gt;rssi;
    adv_data = (uint8_t *)p_adv_report-&amp;gt;data.p_data;
    
    //if(adv_address[0] == 0x73 &amp;amp;&amp;amp; adv_address[1] == 0xE8)
    //{
    printf(&amp;quot;MAC ID&amp;quot;);
    for(int i=0;i&amp;lt;6;i++)
    {
    printf(&amp;quot;:%02X&amp;quot;,adv_address[i]);
    }
    printf(&amp;quot;\tDATA: &amp;quot;);
    for(int j=0;j&amp;lt;16;j++)
    {
    printf(&amp;quot;%02X&amp;quot;,adv_data[j]);
    }
    printf(&amp;quot;\tRSSI: %d DB\n&amp;quot;, rssi);
    nrf_delay_ms(1000);
    //}
}

static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context)
{
    ble_gap_evt_t const * p_gap_evt = &amp;amp;p_ble_evt-&amp;gt;evt.gap_evt;

    switch (p_ble_evt-&amp;gt;header.evt_id)
    {

        case BLE_GAP_EVT_ADV_REPORT:
        {
            on_adv_report(&amp;amp;p_gap_evt-&amp;gt;params.adv_report);
            scan_start(); // &amp;lt;-- NEW ADDITION

        } break;

        default:
          break;
    }
}

static void ble_stack_init(void)
{ 
  uint32_t ram_start = 0;
  nrf_sdh_enable_request();
  nrf_sdh_ble_default_cfg_set(APP_BLE_CONN_CFG_TAG, &amp;amp;ram_start);
  nrf_sdh_ble_enable(&amp;amp;ram_start);
  NRF_SDH_BLE_OBSERVER(m_ble_observer, APP_BLE_OBSERVER_PRIO, ble_evt_handler, NULL);
}

int main(void)
{
    NRF_LOG_INIT(NULL);
    NRF_LOG_DEFAULT_BACKENDS_INIT();
    nrf_pwr_mgmt_init();
    ble_stack_init();
    
    while(1)
    {
      scan_start();
      NRF_LOG_FLUSH();
      nrf_pwr_mgmt_run();
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Thank you for information.&lt;/p&gt;
&lt;p&gt;I changed the code as you said but again I did not get any result on the log screen.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Beacon Scanner Problem</title><link>https://devzone.nordicsemi.com/thread/337604?ContentTypeID=1</link><pubDate>Fri, 05 Nov 2021 07:34:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46276e4d-238c-45fc-97ac-d779b9a02c4a</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;&amp;nbsp;I do not remember the details of this old post, but based on the logs it seems like it worked for me out of the box with the given code snippet.&lt;/p&gt;
&lt;p&gt;On the later version of the softdevice the scanner stops automatically on the following events which is a change from older version&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/**@brief Start or continue scanning (GAP Discovery procedure, Observer Procedure).
 *
 * @note    A call to this function will require the application to keep the memory pointed by
 *          p_adv_report_buffer alive until the buffer is released. The buffer is released when the scanner is stopped
 *          or when this function is called with another buffer.
 *
 * @note    The scanner will automatically stop in the following cases:
 *           - @ref sd_ble_gap_scan_stop is called.
 *           - @ref sd_ble_gap_connect is called.
 *           - A @ref BLE_GAP_EVT_TIMEOUT with source set to @ref BLE_GAP_TIMEOUT_SRC_SCAN is received.
 *           - When a @ref BLE_GAP_EVT_ADV_REPORT event is received.
 *             In this case scanning is only paused to let the application access received data.
 *             The application must call this function to continue scanning, or call
 *             @ref sd_ble_gap_scan_stop to stop scanning.&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;So when you get&amp;nbsp;BLE_GAP_EVT_ADV_REPORT in the&amp;nbsp;ble_evt_handler you should start the scanner again like below.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    switch (p_ble_evt-&amp;gt;header.evt_id)
    {

        case BLE_GAP_EVT_ADV_REPORT:
        {
            on_adv_report(&amp;amp;p_gap_evt-&amp;gt;params.adv_report);
            scan_start(); // &amp;lt;-- NEW ADDITION

        } break;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Try to see if it works.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Beacon Scanner Problem</title><link>https://devzone.nordicsemi.com/thread/337570?ContentTypeID=1</link><pubDate>Thu, 04 Nov 2021 17:54:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f7a4884b-310e-457e-bc58-197313e97ce2</guid><dc:creator>Reza papi</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/aryan"&gt;Susheel Nuguru&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I run the above code to scan the beacons but it doesn&amp;#39;t receive any data packet. I see you checked the code and it seems it works for you. do you know what is the reason that I didn&amp;#39;t receive any packets?&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Beacon Scanner Problem</title><link>https://devzone.nordicsemi.com/thread/163016?ContentTypeID=1</link><pubDate>Wed, 26 Dec 2018 18:08:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:06b48512-0338-4b65-8c20-5150cdb386fa</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Sorry there, there seems to be a glitch in my thread queue as this thread seems to be unanswered for many days (not intentional). do you still have this problem?&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Most of us on holidays until New year. We will get back to you once we are back to office after 2nd January.&amp;nbsp;&lt;/span&gt;&lt;span&gt;We appreciate your patience.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Beacon Scanner Problem</title><link>https://devzone.nordicsemi.com/thread/161294?ContentTypeID=1</link><pubDate>Tue, 11 Dec 2018 18:08:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0234080c-cb71-44d2-a55c-b84c8a19b8da</guid><dc:creator>Roh_Sys</dc:creator><description>&lt;p&gt;Hey &lt;a href="https://devzone.nordicsemi.com/members/aryan"&gt;Susheel Nuguru&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;Read my post carefully.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Beacon Scanner Problem</title><link>https://devzone.nordicsemi.com/thread/161221?ContentTypeID=1</link><pubDate>Tue, 11 Dec 2018 13:43:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:deabeab3-929a-4951-a561-f7c1ab661625</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I quickly ran your code and could see that the scanner is getting the adv packets as they should.Check&amp;nbsp; the RTT log data below&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;
MAC ID:CD:81:5B:10:66:D9 DATA: 0201041AFF5900020000000000000000 RSSI: -23 DB
MAC ID:06:B8:4E:BB:27:05 DATA: 1EFF060001092000C6E93350B9720A33 RSSI: -79 DB
MAC ID:D3:6C:E0:FE:34:C4 DATA: 0201041AFF5900021501122334455667 RSSI: -79 DB
MAC ID:C0:DE:5E:43:DB:66 DATA: 02011A0AFF4C001005031CE8AE705667 RSSI: -90 DB
MAC ID:06:B8:4E:BB:27:05 DATA: 1EFF060001092000C6E93350B9720A33 RSSI: -80 DB
MAC ID:DC:73:76:6D:E3:D1 DATA: 0319C103020106030312180609313233 RSSI: -84 DB
MAC ID:EF:20:CF:E4:50:21 DATA: 1EFF06000109200072777984CDA5A26E RSSI: -69 DB
MAC ID:E3:5B:83:A1:41:2C DATA: 0201190503BEFE26FE0DFF01095110F1 RSSI: -74 DB
MAC ID:DC:73:76:6D:E3:D1 DATA: 0319C103020106030312180609313233 RSSI: -84 DB
MAC ID:9A:07:A8:F4:CB:36 DATA: 1EFF06000109200032C558CB1E59B564 RSSI: -74 DB
MAC ID:DC:73:76:6D:E3:D1 DATA: 0319C103020106030312180609313233 RSSI: -82 DB
MAC ID:CD:81:5B:10:66:D9 DATA: 0201041AFF5900020000000000000000 RSSI: -21 DB
MAC ID:9A:07:A8:F4:CB:36 DATA: 1EFF06000109200032C558CB1E59B564 RSSI: -78 DB
MAC ID:CD:81:5B:10:66:D9 DATA: 0201041AFF5900020000000000000000 RSSI: -23 DB
MAC ID:DE:84:3E:89:4E:10 DATA: 0201061107669A0C2000089A94E3117B RSSI: -88 DB&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>