<?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>How to develop the sample of nrf_dm?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/96598/how-to-develop-the-sample-of-nrf_dm</link><description>I have a interest in distance measurement of bluetooth, the sample is located innrf\samples\bluetooth\nrf_dm. 
 I have two problem.The one is how to set the role od device in the distance measurement.The file README.rst below explain the the role. 
 </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 23 Mar 2024 04:24:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/96598/how-to-develop-the-sample-of-nrf_dm" /><item><title>RE: How to develop the sample of nrf_dm?</title><link>https://devzone.nordicsemi.com/thread/475475?ContentTypeID=1</link><pubDate>Sat, 23 Mar 2024 04:24:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:574095b5-bce6-4fa8-b468-604630e4bf09</guid><dc:creator>Jimmy0755</dc:creator><description>&lt;p&gt;Thanks for your information&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to develop the sample of nrf_dm?</title><link>https://devzone.nordicsemi.com/thread/474854?ContentTypeID=1</link><pubDate>Wed, 20 Mar 2024 11:38:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df1d834a-aa7b-4d66-9335-db17bc036b7a</guid><dc:creator>swz_nordic</dc:creator><description>&lt;p&gt;yes, it has been solved. You can see the&amp;nbsp;Technical documentation&amp;nbsp;of&amp;nbsp;nordic.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to develop the sample of nrf_dm?</title><link>https://devzone.nordicsemi.com/thread/474766?ContentTypeID=1</link><pubDate>Wed, 20 Mar 2024 06:56:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c3f36c4e-1fea-40c0-89f8-4cc6ff914cb5</guid><dc:creator>Jimmy0755</dc:creator><description>&lt;p&gt;Is your problem solved? I also want to set the role, one as reflector and one as initiator.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to develop the sample of nrf_dm?</title><link>https://devzone.nordicsemi.com/thread/417259?ContentTypeID=1</link><pubDate>Fri, 24 Mar 2023 00:46:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c56aae7d-3cbc-43a6-9a6a-bf5d1911edd5</guid><dc:creator>swz_nordic</dc:creator><description>&lt;p&gt;yes,i have done what the technical suppoorter of nordic said.But it make no effect.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;I commented the said lines but then I am not getting distance measurements anymore. Is there something I missed?&amp;quot;&amp;nbsp;&lt;/em&gt;I am not sure that what the problem is.&lt;strong&gt;The device act as the reflector and initiator both&lt;/strong&gt;.we can&amp;#39;t set the device as a reflector or initiator,and they can&amp;#39;t solve this problem.We only wait for their progress.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to develop the sample of nrf_dm?</title><link>https://devzone.nordicsemi.com/thread/417021?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2023 11:13:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ebd8cb38-10d3-4da2-81eb-3afb4ddf4da7</guid><dc:creator>jnsl_123</dc:creator><description>&lt;p&gt;Hi, I want to set defined roles as well. I commented the said lines but then I am not getting distance measurements anymore. Is there something I missed?. This would be for the Reflector role for example:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static int bt_sync_init(void)
{
	/* Synchronisation is based on advertising and scanning modes.
	 * It occurs when SCAN_REQ and SCAN_RESP packets are exchanged.
	 */

	int err;

	printk(&amp;quot;DM Bluetooth LE Synchronization initialization\n&amp;quot;);

	err = peer_access_address_prepare();
	if (err) {
		printk(&amp;quot;Failed to prepare access address (err %d)\n&amp;quot;, err);
	}

	mfg_data.company_code = sys_cpu_to_le16(COMPANY_CODE);
	mfg_data.support_dm_code = sys_cpu_to_le32(SUPPORT_DM_CODE);
	mfg_data.access_address = sys_cpu_to_le32(peer_access_address_get());

	err = adv_start();
	if (err) {
		printk(&amp;quot;Failed to start advertising (err %d)\n&amp;quot;, err);
		return err;
	}

	// err = scan_start();
	// if (err) {
	// 	printk(&amp;quot;Failed to start scanning (err %d)\n&amp;quot;, err);
	// 	return err;
	// }

	return err;
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to develop the sample of nrf_dm?</title><link>https://devzone.nordicsemi.com/thread/410499?ContentTypeID=1</link><pubDate>Fri, 17 Feb 2023 02:12:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:94fb1118-c985-434c-9f34-ac3bb123a919</guid><dc:creator>swz_nordic</dc:creator><description>&lt;p&gt;&lt;em&gt;&amp;ldquo;Comment out either the &amp;quot;err = adv_start();&amp;quot; line or the &amp;quot;err = scan_start();&amp;quot;&amp;rdquo;,&lt;/em&gt;i have done&amp;nbsp; as you said.when in&amp;nbsp;&amp;quot;err = adv_start();&amp;quot;,the LED 1 blinky and LED 2 blinky regularly.When in&amp;nbsp;&amp;quot;err = scan_start();&amp;quot;,there is no led blinky. how do deal with it?&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1676599571106v1.jpeg" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;adverting&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1676599591547v2.jpeg" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;scanning&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;I&amp;nbsp;find some data having error,and the boards are not connected.how to solve this problem?&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;yes,i want to triangulation using four device.There is one&amp;nbsp;&lt;span&gt;scanner and three advertisers,i measure the three distances from every scanner to advertiser,but i can&amp;#39;t get the value of them.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;can you help me?Thanks!&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to develop the sample of nrf_dm?</title><link>https://devzone.nordicsemi.com/thread/410407?ContentTypeID=1</link><pubDate>Thu, 16 Feb 2023 14:42:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4c0b124-1baf-4e19-a5d6-8d9d515ee05f</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]How to set the role of the device in the distance measurement?[/quote]
&lt;p&gt;In the&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/bluetooth/nrf_dm/README.html"&gt;Bluetooth: nRF Distance Measurement with Bluetooth LE discovery&lt;/a&gt; sample, both devices act both as advertiser and scanner, which means which device gets which role is random: It all depends on which device was advertising and which device was scanning, when information was successfully exchanged. If you have a look at the main.c file of the sample, you will see the code run after successful scanning in data_cb(), and the code run when the advertiser is scanned in adv_scanned_cb(). They configure DM_ROLE_INITIATOR and DM_ROLE_REFLECTOR respectively.&lt;/p&gt;
&lt;p&gt;If you want to make the device either only advertise or only scan, in order to always assume the same role, then you can do so in bt_sync_init(). Comment out either the &amp;quot;err = adv_start();&amp;quot; line or the &amp;quot;err = scan_start();&amp;quot; line, with the accompanying error check, for disabling advertising or scanning respectively.&lt;/p&gt;
[quote user=""]I&amp;nbsp;find some data having error,and the boards are not connected.how to solve this problem?[/quote]
&lt;p&gt;I am afraid I do not understand what error you refer to. Was there anything specific in the print output, that you refer to?&lt;/p&gt;
&lt;p&gt;Depending on the surrounding environment and RF disturbances, the quality of the distance measurement varies. This means different readings for the same distance is expected. You will typically get better distance estimates by doing multiple measurements, discarding outliers, and averaging over several measurements.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>