<?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>with nrf52840 how to detect (scan/sniff) a beacon, identify UUID and aftet go to sleep for one second</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/54017/with-nrf52840-how-to-detect-scan-sniff-a-beacon-identify-uuid-and-aftet-go-to-sleep-for-one-second</link><description>I have already developed a beacon with nrf52840, but now I need to detect it with another nrf52840, but my problem is taht I need to use less power as possible, so I need to detect it for one second and after go to sleep for a defined time. 
 Problem</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 15 Nov 2019 07:41:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/54017/with-nrf52840-how-to-detect-scan-sniff-a-beacon-identify-uuid-and-aftet-go-to-sleep-for-one-second" /><item><title>RE: with nrf52840 how to detect (scan/sniff) a beacon, identify UUID and aftet go to sleep for one second</title><link>https://devzone.nordicsemi.com/thread/220220?ContentTypeID=1</link><pubDate>Fri, 15 Nov 2019 07:41:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61f65c86-9125-465b-888e-4bb7ae50497e</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Thank you for the clarification! Okay, so a beacon transmitting every 1 second, should mean that scanning for 3 seconds at a time will be sufficient for detecting at an advertisement each scanning interval. So, setting the scan duration to 3 seconds should be sufficient there. Then, when you&amp;#39;re done, tell the device to go to system idle mode for 2 seconds or so. The attached file just need to set the time you&amp;#39;re asleep for to 2 seconds. You can do this by using the RTC. Enable RTC with something a function similar to this.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void rtc_enable(void)
{
	nrf_drv_rtc_counter_clear(&amp;amp;rtc);
    nrf_drv_rtc_tick_enable(&amp;amp;rtc,true);
	mcuInSleep = true;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Attached is a main.c file that should work as a beacon scanner going to sleep after the scan duration is over, so you just have to implement the RTC to sleep for the desired amount of time.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-3a0bdf6eb76e43ecb2b482f13242ef9d/main.c"&gt;devzone.nordicsemi.com/.../main.c&lt;/a&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: with nrf52840 how to detect (scan/sniff) a beacon, identify UUID and aftet go to sleep for one second</title><link>https://devzone.nordicsemi.com/thread/220047?ContentTypeID=1</link><pubDate>Thu, 14 Nov 2019 10:39:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c88be6c5-2b5a-46f5-88d7-82748a0e1ca6</guid><dc:creator>yahdar72</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;I work for a company that ask to&amp;nbsp;me to make firmware for a beacon detector (beacon already created and is capable to send advertise every 1 second consuming only 3uA ) in few work days; in the menawhile I also must follow other activities with greater priorities, so as you can image I can devote few time to understand libraries and BSP.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The beacon, for power saving, send an advertise every 1 second.&lt;/p&gt;
&lt;p&gt;With one seconds beacon transmission, in my mind with the scanner that listen for 3 seconds, the scanner should be able to detect the beacon in every situation, also after a long sleep. Is this right?&lt;/p&gt;
&lt;p&gt;If 3 second are too few, by your expirience, how many seconds the scanner need as a minimun to detect beacon?&lt;/p&gt;
&lt;p&gt;I hope these informations are useful and you can help me.&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;&amp;nbsp; &amp;nbsp; Yahdar&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: with nrf52840 how to detect (scan/sniff) a beacon, identify UUID and aftet go to sleep for one second</title><link>https://devzone.nordicsemi.com/thread/220025?ContentTypeID=1</link><pubDate>Thu, 14 Nov 2019 09:21:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f28e1ca8-83a5-4cf0-b748-39883b38b303</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;And what exactly are you struggling with? Are you able to scan and detect the beacon? If the device only is scanning for 3 seconds before going to sleep, There won&amp;#39;t be a guarantee that it will be able to detect the device every time. What&amp;#39;s the advertising interval of the beacon?&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: with nrf52840 how to detect (scan/sniff) a beacon, identify UUID and aftet go to sleep for one second</title><link>https://devzone.nordicsemi.com/thread/219944?ContentTypeID=1</link><pubDate>Wed, 13 Nov 2019 20:43:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:467c02a6-5e92-43fd-bb88-0a0362280307</guid><dc:creator>yahdar72</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;sorry for my bad english, I&amp;#39;m working on a central (scanner) and pratically I need only to detect an external beacon with a specific UUID that my central knows. when the&amp;nbsp;beacon with UUID is near to the scannel, that is when&amp;nbsp;signal&amp;nbsp;level (RSSI) is over a value, I must&amp;nbsp;set an output pin (I/O) at high level. When beacon is far and signal level (RSSI) under a value, or not detectable (lost), then that output pin must set low.&lt;/p&gt;
&lt;p&gt;The work is simple, but there is also another small problem, the system must go in sleep (under 2uA), or wake up, by the level of another I/O (an input pin).&amp;nbsp;&lt;span style="font-family:inherit;"&gt;When nrf52 is active (&lt;/span&gt;&lt;span style="font-family:inherit;"&gt;Input pin externally kept high&lt;/span&gt;&lt;span style="font-family:inherit;"&gt;) the detect state must&amp;nbsp;&lt;/span&gt;&lt;span style="font-family:inherit;"&gt;continue for 3 seconds and after has to go sleep for 2 seconds, and so on until input pin will be pulled low.&lt;/span&gt;&lt;span style="font-family:inherit;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;yahdar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: with nrf52840 how to detect (scan/sniff) a beacon, identify UUID and aftet go to sleep for one second</title><link>https://devzone.nordicsemi.com/thread/219911?ContentTypeID=1</link><pubDate>Wed, 13 Nov 2019 13:50:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f078dfb2-352d-40f1-9803-266f6431deb6</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Sorry, but what do you mean by &amp;quot;intercepting&amp;quot; a beacon detection? Can you please try to explain a bit more about what you want to do, and what you&amp;#39;re struggling with? Are you working on a central (scanner) or a peripheral (beacon)?&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: with nrf52840 how to detect (scan/sniff) a beacon, identify UUID and aftet go to sleep for one second</title><link>https://devzone.nordicsemi.com/thread/219842?ContentTypeID=1</link><pubDate>Wed, 13 Nov 2019 09:24:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a59bb882-f27f-45a2-89ba-fd3e99842465</guid><dc:creator>yahdar72</dc:creator><description>&lt;p&gt;Hi simonr&lt;/p&gt;
&lt;p&gt;thanks for the very usefull reply, but looking for a place/function where intercept beacon detection, I have meets some problem because I don&amp;#39;t understood how to detect a specific becaon (scanning filter?) and where detect this event to move a I/O.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Please could you be so kind to give me some indications?&lt;/p&gt;
&lt;p&gt;thanks in advance and best regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: with nrf52840 how to detect (scan/sniff) a beacon, identify UUID and aftet go to sleep for one second</title><link>https://devzone.nordicsemi.com/thread/218990?ContentTypeID=1</link><pubDate>Thu, 07 Nov 2019 09:18:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af552d20-988e-47e3-beec-944007c9fb45</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Sorry for the delayed reply. You can check out our &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v16.0.0%2Fble_sdk_app_blinky_c.html&amp;amp;cp=5_1_4_2_0_0"&gt;ble_app_blinky_c example&lt;/a&gt;, where you can edit the SCAN_DURATION define yourself. Note that the duration of the scanning is stated in units of 10ms, and if it&amp;#39;s set to 0x0000, scanning continues until it is explicitly disabled.&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: with nrf52840 how to detect (scan/sniff) a beacon, identify UUID and aftet go to sleep for one second</title><link>https://devzone.nordicsemi.com/thread/218677?ContentTypeID=1</link><pubDate>Tue, 05 Nov 2019 20:39:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20702f72-a489-4a7e-9f95-a896611a5abb</guid><dc:creator>yahdar72</dc:creator><description>&lt;p&gt;First of all, thank for the answer ketiljo.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m newbie with nrf5 and BLE so if is possible to have some link to an example code for a central that start and stop scanning for a predetermined time will be very usefull for me.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: with nrf52840 how to detect (scan/sniff) a beacon, identify UUID and aftet go to sleep for one second</title><link>https://devzone.nordicsemi.com/thread/218588?ContentTypeID=1</link><pubDate>Tue, 05 Nov 2019 13:31:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ea1fb09-d24e-4530-8a05-5183305d6fa6</guid><dc:creator>ketiljo</dc:creator><description>&lt;p&gt;Not sure what you are trying to do here. In order to scan for a beacon, you need to jeep the central in scanning mode for as long as it takes to detect the beacon. It doesn&amp;#39;t wake up and start scanning by itself. You need to define how often you are scanning and for how long.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>