<?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>Scan for nearby beacons and decide by rssi the one closer to my device</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/67214/scan-for-nearby-beacons-and-decide-by-rssi-the-one-closer-to-my-device</link><description>Hello, 
 I am trying to develop and application that will be able to scan for some time for beacons in the area around it. From all found beacons and using the RSSI of each one it would be able to pick the one closer to it and process its advertising</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 20 Oct 2020 09:18:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/67214/scan-for-nearby-beacons-and-decide-by-rssi-the-one-closer-to-my-device" /><item><title>RE: Scan for nearby beacons and decide by rssi the one closer to my device</title><link>https://devzone.nordicsemi.com/thread/275807?ContentTypeID=1</link><pubDate>Tue, 20 Oct 2020 09:18:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b2146d33-1d3d-4f20-a017-54ba02d08286</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello Stavros,&amp;nbsp;&lt;/p&gt;
[quote user="Stavros Makridis"]Thank you for your response.[/quote]
&lt;p&gt;No problem at all, I am happy to help!&lt;/p&gt;
[quote user="Stavros Makridis"]My scenario is not to even connect to a beacon. I only need to decide which one is closer to my board and forward its adverting data through a NBIoT module to a server somewhere in the cloud. You see, these beacons are commercial ones as you figured it out yourself. This particular type of beacons are not connectable. We need to be flexible enough to use some other type in the future as application evolves.[/quote][quote user="Stavros Makridis"]One way I have thought to find out which one is closer is RSSI value. Any other suggestion is more than welcome.[/quote]
&lt;p&gt;Thank you for clarifying. I will have to mention that RSSI will give you a very rough estimate for the distance ( since it is heavily influenced by external&amp;nbsp;&lt;br /&gt;factors such as line-of-sight, reflections/multipath, etc ), but RSSI is a great choice for seeing if a beacon is&amp;nbsp;&lt;em&gt;close, far,&lt;/em&gt;&amp;nbsp;or&lt;em&gt; unreachable,&amp;nbsp;&lt;/em&gt;for example.&lt;/p&gt;
[quote userid="90768" url="~/f/nordic-q-a/67214/scan-for-nearby-beacons-and-decide-by-rssi-the-one-closer-to-my-device/275719#275719"]Please don&amp;#39;t get me wrong, I am not rejecting the work already done my nordic. The samples do take care of all the details. The problem is that often an application needs to combine more than one sample. For this reason the developer has to go deeper into the code to understand which parts should be transfered to the target application and which are not needed. All I am saying is that samples would be much more helpful if they come with a more extensive documentation explaning the purpose of each section of code. Of course I don&amp;#39;t mean to have comments at every single line[/quote]
&lt;p&gt;Absolutely - it is also fine to want to build the application from the bottom up, instead of relying on existing code, that is no problem at all!&lt;br /&gt;There are many posts discussing how to merge examples together already in the forum, that could be helpful to take a look at.&lt;br /&gt;Additionally, you could see &lt;a href="https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy/posts/merging-two-ble-examples-together"&gt;this blog post&lt;/a&gt;&amp;nbsp;for a brief overview of the elements to think of when merging examples / adding functionality from an example into a separate project.&lt;br /&gt;Regarding the documentation of each section of code, I would recommend to read the specific peripheral documentation for a general overview of its functionality, configuration, and usage - and then having a look at either the API Reference ( or the .h file ) for each functions documentation.&lt;/p&gt;
[quote user="Stavros Makridis"]Anyway thank you again for your help. I will study more the samples code to get a better understanding of way this system works.[/quote]
&lt;p&gt;Great! Please do not hesitate to create a new ticket if you should encounter any issues or questions.&lt;br /&gt;&lt;br /&gt;Good luck with your development!&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Scan for nearby beacons and decide by rssi the one closer to my device</title><link>https://devzone.nordicsemi.com/thread/275719?ContentTypeID=1</link><pubDate>Mon, 19 Oct 2020 20:14:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8dccad37-0840-45d1-bace-0f7157b00522</guid><dc:creator>Stavros Makridis</dc:creator><description>&lt;p&gt;Hello Karl,&lt;/p&gt;
&lt;p&gt;Thank you for your response.&lt;/p&gt;
&lt;p&gt;My scenario is not to even connect to a beacon. I only need to decide which one is closer to my board and forward its adverting data through a NBIoT module to a server somewhere in the cloud. You see, these beacons are commercial ones as you figured it out yourself. This particular type of beacons are not connectable. We need to be flexible enough to use some other type in the future as application evolves.&lt;/p&gt;
&lt;p&gt;One way I have thought to find out which one is closer is RSSI value. Any other suggestion is more than welcome.&lt;/p&gt;
&lt;p&gt;Please don&amp;#39;t get me wrong, I am not rejecting the work already done my nordic. The samples do take care of all the details. The problem is that often an application needs to combine more than one sample. For this reason the developer has to go deeper into the code to understand which parts should be transfered to the target application and which are not needed. All I am saying is that samples would be much more helpful if they come with a more extensive documentation explaning the purpose of each section of code. Of course I don&amp;#39;t mean to have comments at every single line &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;Anyway thank you again for your help. I will study more the samples code to get a better understanding of way this system works.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Stavros.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Scan for nearby beacons and decide by rssi the one closer to my device</title><link>https://devzone.nordicsemi.com/thread/275514?ContentTypeID=1</link><pubDate>Mon, 19 Oct 2020 08:39:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7cd1ae69-02af-4d3c-885f-333c5d9b25d0</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user="Stavros Makridis"]ble_app_multilink_central.[/quote]
&lt;p&gt;As I understood your original ticket, you intend to hold only 1 connection at any time ( the strongest RSSI ), is this correct?&lt;/p&gt;
[quote user="Stavros Makridis"]The application indeed finds the beacon I am using but it tries to connect to it but with no success because it is not connectable.[/quote][quote user="Stavros Makridis"]Is there another more suitable example? How should I alter this one to achieve my goal?[/quote]
&lt;p&gt;This is set by the beacon ( peripheral ) itself. Have you developed these beacons yourself, or are you using some commercially available beacons?&lt;br /&gt;In the latter case, you will not be able to connect to them if they are made to be un-connectable. In the case that you have developed them yourself ( or using one of the SDK examples, such as &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/ble_sdk_app_beacon.html"&gt;the BLE Beacon example&lt;/a&gt; ) then you may change the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v7.0.1/structble__gap__adv__params__t.html"&gt;ble_gap_adv_params_t&lt;/a&gt;&amp;nbsp;configuration to be connectable instead ( you will also have to add the intended when-connected behavior ).&lt;/p&gt;
[quote user="Stavros Makridis"]This approach of using a sample application as a base for a custom application suits more to hobbyists and students and less to professional engineer that have strict timelines to catch. If this is the only way Nordic can afford helping us as developers then be it, but each sample should have a detailed explanation so we would be able to alter it to fit our needs and applications. Of course this is only my opinion.[/quote]
&lt;p&gt;While I understand how you could see it this way, I would argue that any work already done for you by us here at Nordic would relax your strict timeline constraint.&lt;br /&gt;However, if you would like to not start with an example as your base, you could start out of the&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/ble_sdk_app_template.html"&gt;Template Application&lt;/a&gt;&amp;nbsp;in the SDK.&lt;br /&gt;Here, you may add whatever functionality you would like from other examples / sources / repositories, or implement it yourself. This will however require more familiarizing with the sdk_config and SDK components / modules on your own, but it is an equally valid approach which you may take if you would like.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Scan for nearby beacons and decide by rssi the one closer to my device</title><link>https://devzone.nordicsemi.com/thread/275190?ContentTypeID=1</link><pubDate>Thu, 15 Oct 2020 17:54:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:616deee9-af58-4fca-80f8-839202802325</guid><dc:creator>Stavros Makridis</dc:creator><description>&lt;p lang="en-US"&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-family:Calibri, sans-serif;"&gt;&lt;span style="font-size:medium;"&gt;Hello,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-family:Calibri, sans-serif;"&gt;&lt;span style="font-size:medium;"&gt;&lt;span lang="en-US"&gt;Thank you for the response. I have started with&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;strong&gt;&lt;span&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-family:Calibri, sans-serif;"&gt;&lt;span style="font-size:medium;"&gt;&lt;span lang="en-US"&gt;ble_app_multilink_central.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-family:Calibri, sans-serif;"&gt;&lt;span style="font-size:small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-family:Calibri, sans-serif;"&gt;&lt;span style="font-size:medium;"&gt;&lt;span lang="en-US"&gt;The application indeed finds the beacon I am using but it tries to connect to it but with no success because it is not connectable.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p lang="en-US"&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-family:Calibri, sans-serif;"&gt;&lt;span style="font-size:medium;"&gt;Is there another more suitable example? How should I alter this one to achieve my goal?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p lang="en-US"&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-family:Calibri, sans-serif;"&gt;&lt;span style="font-size:medium;"&gt;This approach of using a sample application as a base for a custom application suits more to hobbyists and students and less to professional engineer that have strict timelines to catch. If this is the only way Nordic can afford helping us as developers then be it, but each sample should have a detailed explanation so we would be able to alter it to fit our needs and applications. Of course this is only my opinion.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Scan for nearby beacons and decide by rssi the one closer to my device</title><link>https://devzone.nordicsemi.com/thread/274958?ContentTypeID=1</link><pubDate>Wed, 14 Oct 2020 21:56:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b952099b-df03-4750-8c90-6219e487c7c9</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Yes, it&amp;#39;s possible.&lt;/p&gt;
&lt;p&gt;Have you looked at the available examples to see which sounds closest to your requirements?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>