<?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>Not able to get the Advertisement packet.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/63059/not-able-to-get-the-advertisement-packet</link><description>I am working with a proximity beacon example. In that runs scanning and advertisement code, And in testing, most of the cases, I am not able to get the Advertisement packet even in 1.5sec from the other beacon. I have verified the connection parameter</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 02 Jul 2020 04:22:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/63059/not-able-to-get-the-advertisement-packet" /><item><title>RE: Not able to get the Advertisement packet.</title><link>https://devzone.nordicsemi.com/thread/257963?ContentTypeID=1</link><pubDate>Thu, 02 Jul 2020 04:22:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ceac085-558c-40ff-ba60-ab0d141d7596</guid><dc:creator>jaimin</dc:creator><description>&lt;p&gt;Thanks, Edvin&lt;br /&gt;Now, it&amp;#39;s working properly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to get the Advertisement packet.</title><link>https://devzone.nordicsemi.com/thread/257368?ContentTypeID=1</link><pubDate>Mon, 29 Jun 2020 12:10:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6821a9b0-66e0-4b81-a8c6-230fa63758e7</guid><dc:creator>Edvin</dc:creator><description>[quote user="jpatel"]I have set NON_CONNECTABLE_ADV_INTERVAL = 100ms, SCAN_INTERVAL = 100(0x64),and SCAN_WINDOW = 50(0x32) in that too much packet loss, most of cases even in 1.5 sec also not getting advertised packet.[/quote]
&lt;p&gt;&amp;nbsp;I am sorry. I gave the incorrect advice. The scan interval and scan window is given in units of&amp;nbsp;0.625ms. Setting the scan interval to 100(0x64) will give a scan interval of 62.5ms.&lt;/p&gt;
&lt;p&gt;However, if you want to pick up more advertisements, you should set the advertising interval so that you have several chances to pick up an advertisement per scan window. Set the advertising inteval to 10ms or so, and then keep the scan interval and window at 50 and 25.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to get the Advertisement packet.</title><link>https://devzone.nordicsemi.com/thread/257267?ContentTypeID=1</link><pubDate>Mon, 29 Jun 2020 06:02:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e5f70668-f16a-4bf4-8743-d8ab4635caff</guid><dc:creator>jaimin</dc:creator><description>&lt;p&gt;Edvin,&lt;br /&gt;Thanks for your reply.&lt;br /&gt;Yes, scanning and advertising both concurrently runs, and in another beacon device also runs the same program.&lt;br /&gt;I have set NON_CONNECTABLE_ADV_INTERVAL = 100ms, SCAN_INTERVAL = 100(0x64),and SCAN_WINDOW = 50(0x32) in that too much packet loss, most of cases even in 1.5 sec also not getting advertised packet.&lt;br /&gt;&lt;br /&gt;I have also tested in NON_CONNECTABLE_ADV_INTERVAL = 50(0x32),SCAN_INTERVAL = 50(0x32),and SCAN_WINDOW = 25(0x19) in that result better than above configuration.&amp;nbsp;but in some cases, it takes 900ms or 1 sec to get the advertised packet.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to get the Advertisement packet.</title><link>https://devzone.nordicsemi.com/thread/257164?ContentTypeID=1</link><pubDate>Fri, 26 Jun 2020 13:42:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:759d8f99-0eda-4767-8db3-8e31e593859f</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;So you are scanning for the devices similar to itself, right? That is, is the packets that you are scanning for also advertised with 100ms advertising interval?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I see that you use a scan interval and window of 0xA0 and 0x50, which translates to 1600ms and 800ms.&lt;/p&gt;
&lt;p&gt;This means you scan 800ms every 1600ms.&lt;/p&gt;
&lt;p&gt;This means that you should get about 7-8 advertisements for 800ms, and then no advertisements for 800ms, if you pick up all the advertisements.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What you are probably seeing is that the scan window is not scheduled from time to time. Since there is only one physical radio on the nRF, the device can only scan or advertise at a given point in time. When you do concurrenty scanning or advertising the softdevice has to prioritize which one of these to do. The softdevice does only schedule entire scan windows.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The scheduler in the softdevice is dynamic, so if you skip a scan window, then the scan_window will have a higher priority in the future. If it skips an advertisement, the next advertising event will have a higher priority.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So what you are seeing is that the sofdevice is skipping some scan windows, which will happen from time to time if you do concurrently advertising and scanning. If you use very long scan window/intervals, this means that you will loose a lot of advertisements. What you can try to do is to reduce the scan interval and scan window. If you use e.g. 100/50ms (interval: 0x64, window: 0x32), this means that you will still scan for 50% of the time (same current consumption), but if the softdevice skips a scan window, you will only miss 100ms of scanning.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If you reduce the scan window/interval too much, you will start to see another type of packet loss, because you start picking up only parts of packets, because the scan window will end mid-packet. One advertising packet containing 31 bytes takes about 0.7ms (which you can see &lt;a href="https://devzone.nordicsemi.com/nordic/power" rel="noopener noreferrer" target="_blank"&gt;here&lt;/a&gt;). So the packet/advertisement loss will increase if you reduce the scan window to only a couple of ms.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;One other thing to consider is that the nRF will not advertise if an advertising packet collides with a scan window, so you may want to use an advertising/scan interval that doesn&amp;#39;t overlap for too long (each advertising packet has a 0-10ms random delay added to the advertising interval, according to the specification). E.g. an advertising interval of 100ms, I would recommend using a scan interval of about 60ms, so you don&amp;#39;t miss too many advertisements in a row.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>