<?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>RSSI Implementation with nRF52480 on BLE UART APK</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/42247/rssi-implementation-with-nrf52480-on-ble-uart-apk</link><description>Hi, 
 
 I&amp;#39;m testing the ble_app_uart and ble_app_uart_c example on two nRF52480 cards. 
 I&amp;#39;m actually trying to print the RSSI value. 
 I don&amp;#39;t really know how to proceed to start the RSSI measurement and where I should call the function and print the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 06 Nov 2019 07:35:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/42247/rssi-implementation-with-nrf52480-on-ble-uart-apk" /><item><title>RE: RSSI Implementation with nRF52480 on BLE UART APK</title><link>https://devzone.nordicsemi.com/thread/218721?ContentTypeID=1</link><pubDate>Wed, 06 Nov 2019 07:35:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c136cd1-c778-4afd-b2a0-6d15e5c79b27</guid><dc:creator>Dheeraj</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;Does this same works for asset tracker application to obtain RSSI values?&lt;/p&gt;
&lt;p&gt;I am looking to perform BLE scan based on the timeout values and sort the result by RSSI implementation with nRF52840 for&lt;strong&gt; PCA20035&lt;/strong&gt; and pass the BLE_SCANLIST_ENTRIES over UART.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RSSI Implementation with nRF52480 on BLE UART APK</title><link>https://devzone.nordicsemi.com/thread/164863?ContentTypeID=1</link><pubDate>Thu, 10 Jan 2019 10:11:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:def3eec7-f98b-47e5-b5df-c75abcc72dc3</guid><dc:creator>_OP</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I was using NRF_LOG_INFO instead of printf() &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;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;for some reason NRF_LOG_INFO doesn&amp;#39;t work on putty.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/rssi_5F00_4.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="background-color:transparent;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;Thanks for your help and time Einar, truly appreciate.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;_OP&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RSSI Implementation with nRF52480 on BLE UART APK</title><link>https://devzone.nordicsemi.com/thread/164855?ContentTypeID=1</link><pubDate>Thu, 10 Jan 2019 09:46:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cac05287-96ae-480b-a507-bc5f71d34f33</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I did this modifications to the HRS example main.c file from SDK 14.2:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-654e1274841f4e26ad77014483641c27/main.c.diff"&gt;devzone.nordicsemi.com/.../main.c.diff&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This resulted in the following log output (RSSI measurements are printed for as long as the connection is alive):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;info&amp;gt; app: Heart Rate Sensor example started.
&amp;lt;info&amp;gt; app: Fast advertising.
&amp;lt;info&amp;gt; app: Connected.
&amp;lt;info&amp;gt; app: rssi =-56 dBm
&amp;lt;info&amp;gt; app: rssi =-47 dBm
&amp;lt;info&amp;gt; app: rssi =-57 dBm
&amp;lt;info&amp;gt; app: rssi =-54 dBm
&amp;lt;info&amp;gt; app: rssi =-50 dBm
&amp;lt;info&amp;gt; app: GATT ATT MTU on connection 0x0 changed to 247.
&amp;lt;info&amp;gt; app: rssi =-49 dBm
&amp;lt;info&amp;gt; app: rssi =-47 dBm
&amp;lt;info&amp;gt; app: rssi =-50 dBm
&amp;lt;info&amp;gt; app: rssi =-54 dBm
&amp;lt;info&amp;gt; app: rssi =-51 dBm
&amp;lt;info&amp;gt; app: rssi =-50 dBm
&amp;lt;info&amp;gt; app: rssi =-46 dBm
&amp;lt;info&amp;gt; app: rssi =-49 dBm
&amp;lt;info&amp;gt; app: rssi =-54 dBm
&amp;lt;info&amp;gt; app: rssi =-53 dBm
&amp;lt;info&amp;gt; app: rssi =-50 dBm
&amp;lt;info&amp;gt; app: rssi =-53 dBm
&amp;lt;info&amp;gt; app: rssi =-48 dBm
&amp;lt;info&amp;gt; app: rssi =-49 dBm
&amp;lt;info&amp;gt; app: rssi =-46 dBm
&amp;lt;info&amp;gt; app: rssi =-51 dBm
&amp;lt;info&amp;gt; app: rssi =-54 dBm
&amp;lt;info&amp;gt; app: rssi =-51 dBm
&amp;lt;info&amp;gt; app: rssi =-49 dBm
&amp;lt;info&amp;gt; app: rssi =-47 dBm
&amp;lt;info&amp;gt; app: rssi =-51 dBm
&amp;lt;info&amp;gt; app: rssi =-54 dBm
&amp;lt;info&amp;gt; app: rssi =-51 dBm
&amp;lt;info&amp;gt; app: rssi =-49 dBm
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You should get the same. Does your application work as expected without the RSSI logging?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RSSI Implementation with nRF52480 on BLE UART APK</title><link>https://devzone.nordicsemi.com/thread/164752?ContentTypeID=1</link><pubDate>Wed, 09 Jan 2019 14:54:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f08ede3-af8c-4fb7-9bc2-ee8a3f07de8e</guid><dc:creator>_OP</dc:creator><description>&lt;p&gt;Thanks for your quick anser.&lt;/p&gt;
&lt;p&gt;Indeed i don&amp;#39;t get the &amp;#39;disconected&amp;#39;&amp;nbsp; msg from the&amp;nbsp;&lt;span style="background-color:transparent;color:#11171a;float:none;font-family:&amp;#39;GT Eesti&amp;#39;,&amp;#39;Helvetica&amp;#39;,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;line-height:21px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;BLE_GAP_EVT_DISCONNECTED&lt;/span&gt; event when i turn down the second card.&lt;/p&gt;
&lt;p&gt;i&amp;#39;m using putty the output i&amp;#39;m getting is below:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/rssi_5F00_3.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;So the&amp;nbsp;&lt;span style="background-color:transparent;color:#11171a;float:none;font-family:&amp;#39;GT Eesti&amp;#39;,&amp;#39;Helvetica&amp;#39;,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;line-height:21px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;sd_ble_gap_rssi_start()&lt;/span&gt; is called but the condition &amp;quot;case BLE_GAP_EVT_RSSI_CHANGED:&amp;quot; isn&amp;#39;t ever valide (even if i move the cards.. i don&amp;#39;t get the msg one single time).&lt;/p&gt;
&lt;p&gt;how shoud i fix it ? Is it a good idea to use putty to debug ? Can i see your output with your debugger ?&lt;/p&gt;
&lt;p&gt;Thx again Einar.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RSSI Implementation with nRF52480 on BLE UART APK</title><link>https://devzone.nordicsemi.com/thread/164726?ContentTypeID=1</link><pubDate>Wed, 09 Jan 2019 13:53:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0071895-4f00-42f5-b553-79a022c8c994</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;That&amp;#39;s odd. It should work. In fact I copy-pasted your code into an SDK 14.2 example and it worked out of the box (I just had to declare your RSSI variable as int8_t). Have you verified by a debugger that you get the&amp;nbsp;BLE_GAP_EVT_CONNECTED event (and thus call&amp;nbsp;sd_ble_gap_rssi_start()), but you still don&amp;#39;t get any&amp;nbsp;BLE_GAP_EVT_RSSI_CHANGED events? Are there any other events instead (particularly BLE_GAP_EVT_DISCONNECTED, which would explain why you don&amp;#39;t get any RSSI measurements)?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RSSI Implementation with nRF52480 on BLE UART APK</title><link>https://devzone.nordicsemi.com/thread/164653?ContentTypeID=1</link><pubDate>Wed, 09 Jan 2019 09:32:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1eb942c-302b-4f81-ad8c-9f21790e0a9d</guid><dc:creator>_OP</dc:creator><description>&lt;p&gt;Thanks a lot for your anser Einar,&lt;/p&gt;
&lt;p&gt;I added theses lines to the example code in the ble_evt_handler function in main.c.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;  case BLE_GAP_EVT_CONNECTED:
            printf(&amp;quot;Connected!\r\n!&amp;quot;);
						
            NRF_LOG_INFO(&amp;quot;Connected to target&amp;quot;);
            err_code = ble_nus_c_handles_assign(&amp;amp;m_ble_nus_c, p_ble_evt-&amp;gt;evt.gap_evt.conn_handle, NULL);
            sd_ble_gap_rssi_start(p_ble_evt-&amp;gt;evt.gap_evt.conn_handle, 1, 1); //added by _OP
						printf(&amp;quot;It does pass by sd_ble_gap_rssi_start\n&amp;quot;);
						APP_ERROR_CHECK(err_code);
            err_code = bsp_indication_set(BSP_INDICATE_CONNECTED);
            APP_ERROR_CHECK(err_code);
            // start discovery of services. The NUS Client waits for a discovery result
            err_code = ble_db_discovery_start(&amp;amp;m_db_disc, p_ble_evt-&amp;gt;evt.gap_evt.conn_handle);
            APP_ERROR_CHECK(err_code);
            break;
				
				case BLE_GAP_EVT_RSSI_CHANGED:          //block added by _OP
						sd_ble_gap_rssi_get(p_ble_evt-&amp;gt;evt.gap_evt.conn_handle, &amp;amp;RSSI);
						NRF_LOG_INFO(&amp;quot;rssi =%d dBm&amp;quot;,	RSSI);
						break;
						
        case BLE_GAP_EVT_TIMEOUT:
            if (p_gap_evt-&amp;gt;params.timeout.src == BLE_GAP_TIMEOUT_SRC_SCAN)
            {
                NRF_LOG_INFO(&amp;quot;Scan timed out.&amp;quot;);
                scan_start();
            }
            else if (p_gap_evt-&amp;gt;params.timeout.src == BLE_GAP_TIMEOUT_SRC_CONN)
            {
                NRF_LOG_INFO(&amp;quot;Connection Request timed out.&amp;quot;);
            }
            break;&lt;/pre&gt;&amp;nbsp;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/rssi_5F00_2.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;it does pass by the&amp;nbsp;sd_ble_gap_rssi_start function but not by the BLE_GAP_EVT_RSSI_CHANGED event&lt;/p&gt;
&lt;p&gt;I&amp;#39;m on 14.2 SDK because i&amp;#39;m testing the long range app and it&amp;#39;s not compatible with 15 (doesn&amp;#39;t compile).&lt;/p&gt;
&lt;p&gt;Thanks in advance.&lt;/p&gt;
&lt;p&gt;_OP&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RSSI Implementation with nRF52480 on BLE UART APK</title><link>https://devzone.nordicsemi.com/thread/164545?ContentTypeID=1</link><pubDate>Tue, 08 Jan 2019 14:25:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca559be9-17de-42d8-8603-67eec9918440</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You have to call &lt;a href="https://www.nordicsemi.com/DocLib/Content/SoftDevice_API_Doc/S140/v6-1-0/group_ble_gap_functions#gac369253b7f5ce0fc0093a6133faa791f"&gt;sd_ble_gap_rssi_start()&lt;/a&gt;&amp;nbsp;initially so that the SoftDevice will start to report the RSSI. Depending on the parameters, you will get an event every time the RSSI change or if it changes beyond a given threshold. You can also poll by calling &lt;a href="https://www.nordicsemi.com/DocLib/Content/SoftDevice_API_Doc/S140/v6-1-0/group_ble_gap_functions#ga63b6ec4b1af260085b8dfe5c7b02b724"&gt;sd_ble_gap_rssi_get()&lt;/a&gt;. These message sequence charts shows all variants:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.nordicsemi.com/DocLib/Content/SoftDevice_API_Doc/S140/v6-1-0/group_ble_gap_central_rssi_read_msc"&gt;RSSI get sample&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.nordicsemi.com/DocLib/Content/SoftDevice_API_Doc/S140/v6-1-0/group_ble_gap_rssi_filt_msc"&gt;RSSI for connections with event filter&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As a side note, it seems you use the nRF52840 with DK 14.2. Please note that it is not recommended to use SDK 14.2 with the nRF52840. It was only supported experimentally. SDK 15.0.0 was the first SDK release with production quality support for the nRF52840.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>