<?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>nrf52840 - Scan start delay</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/63150/nrf52840---scan-start-delay</link><description>I&amp;#39;m using an nrf52840 devkit but I&amp;#39;m assuming this behavior happens on all nrf52 devices. I&amp;#39;m trying to control the scanner using app_timer because I need a higher scan interval than the maximum supported interval (BLE_GAP_SCAN_INTERVAL_MAX). When calling</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 02 Jul 2020 06:45:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/63150/nrf52840---scan-start-delay" /><item><title>RE: nrf52840 - Scan start delay</title><link>https://devzone.nordicsemi.com/thread/257974?ContentTypeID=1</link><pubDate>Thu, 02 Jul 2020 06:45:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec2abfed-4c23-43d9-b1ee-f5fb4fcd27e4</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Ivan&lt;/p&gt;
&lt;p&gt;I am happy to hear that you got it working well.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The best of luck with your project &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;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 - Scan start delay</title><link>https://devzone.nordicsemi.com/thread/257838?ContentTypeID=1</link><pubDate>Wed, 01 Jul 2020 12:41:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b68729d9-0288-42f9-8216-9dfc9d7e5278</guid><dc:creator>Ivan Herrera</dc:creator><description>[quote userid="2116" url="~/f/nordic-q-a/63150/nrf52840---scan-start-delay/257823"]If you stop advertising before you start scanning (and then re-start advertising afterwards) you should be able to start scanning immediately[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Correct, I just implemented that and now it seems to start instantly and does not have the advertising-delay behind the scan! Thank you so much.&lt;/p&gt;
[quote userid="2116" url="~/f/nordic-q-a/63150/nrf52840---scan-start-delay/257823"]When you say you drop a percentage of packets when using a shorter scan interval, have you quantified how many packets you drop?&lt;br /&gt;The switch between channels should be quite quick, and I would be surprised if the percentage of dropped packets is high.&amp;nbsp;[/quote]
&lt;p&gt;I was dropping about 50% of the packets, but now I come to think of it this was probably because I set scan_interval to&amp;nbsp;&lt;span&gt;BLE_GAP_SCAN_INTERVAL_MIN, which was a couple ms. I just thought that if I advertised on only one channel it wouldn&amp;#39;t switch. I&amp;#39;ve read a couple of times on these forums the following rule: &amp;quot;set scan_interval to scan_window to get 100% duty cycle.&amp;quot;, so because I was getting that delay I set the interval to the lowest possible (but by using the PPK and looking at the scan-window I saw that it was still &amp;quot;switching&amp;quot; channels even though I had whitelisted the other two).&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In any case, with your solution, I&amp;#39;m dropping about 0% of the packets so thanks for clearing this up! :)&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 - Scan start delay</title><link>https://devzone.nordicsemi.com/thread/257823?ContentTypeID=1</link><pubDate>Wed, 01 Jul 2020 12:13:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8dd0056-86a4-445d-8604-4d4c8b993630</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Ivan&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Apparently the delayed scanning is caused by the fact that scanning is scheduled repeatedly from the moment you start a scan, with an interval set by the scan interval.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The very first scan interval will be blocked by the advertisements, since they were already scheduled by the time scanning is started. On the next available scan window one scan interval later the scanning will get priority over advertising, since it was blocked previously.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you stop advertising before you start scanning (and then re-start advertising afterwards) you should be able to start scanning immediately.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When you say you drop a percentage of packets when using a shorter scan interval, have you quantified how many packets you drop?&lt;br /&gt;The switch between channels should be quite quick, and I would be surprised if the percentage of dropped packets is high.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 - Scan start delay</title><link>https://devzone.nordicsemi.com/thread/257568?ContentTypeID=1</link><pubDate>Tue, 30 Jun 2020 12:12:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a6a582ce-815d-42a4-8295-ba3eca9fd6fe</guid><dc:creator>Ivan Herrera</dc:creator><description>&lt;p&gt;Hi! No active connections of any kind. Just advertising and scanning.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 - Scan start delay</title><link>https://devzone.nordicsemi.com/thread/257562?ContentTypeID=1</link><pubDate>Tue, 30 Jun 2020 11:58:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9af8eb3-b583-4012-98ae-2072bbb7dabc</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Ivan&lt;/p&gt;
&lt;p&gt;Are there any active central connections, or are you only doing advertising and scanning?&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 - Scan start delay</title><link>https://devzone.nordicsemi.com/thread/257556?ContentTypeID=1</link><pubDate>Tue, 30 Jun 2020 11:51:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:975ccfe4-73e0-408a-8acb-cb6597b9295e</guid><dc:creator>Ivan Herrera</dc:creator><description>&lt;p&gt;&lt;span&gt;S140 v6.1.1&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 - Scan start delay</title><link>https://devzone.nordicsemi.com/thread/257553?ContentTypeID=1</link><pubDate>Tue, 30 Jun 2020 11:46:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6bdd17ba-5bb9-461b-9a28-d9ca7e87fedb</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Which version? s140 v7.0.1?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 - Scan start delay</title><link>https://devzone.nordicsemi.com/thread/257552?ContentTypeID=1</link><pubDate>Tue, 30 Jun 2020 11:44:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64125346-5b2f-48fd-a870-fd683122ff81</guid><dc:creator>Ivan Herrera</dc:creator><description>&lt;p&gt;Thanks! I&amp;#39;m using S140&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 - Scan start delay</title><link>https://devzone.nordicsemi.com/thread/257547?ContentTypeID=1</link><pubDate>Tue, 30 Jun 2020 11:35:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c50ee359-d808-453d-81e5-2a32b25b3a63</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Ivan&lt;/p&gt;
&lt;p&gt;I will check with the SoftDevice team if this behavior is to be expected, and if there is some way to change it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Can you confirm which version of the SoftDevice you are testing on?&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>