<?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>Sending Data Over BLE 5 Modules in Long Range with ble_app_uart</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/58551/sending-data-over-ble-5-modules-in-long-range-with-ble_app_uart</link><description>Hi, I wanted to send data over Bluetooth 5.0 modules and to see on a terminal. So I used nRF52840 DK as central device ( ble_app_uart_c) and Fanstel modules ( ble_app_uart) as peripheral. I programmed them successfully and observed that nRF52840 DK paired</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 10 Mar 2020 19:30:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/58551/sending-data-over-ble-5-modules-in-long-range-with-ble_app_uart" /><item><title>RE: Sending Data Over BLE 5 Modules in Long Range with ble_app_uart</title><link>https://devzone.nordicsemi.com/thread/239217?ContentTypeID=1</link><pubDate>Tue, 10 Mar 2020 19:30:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:616acd4d-1678-4517-8014-ea1fe4d0eca1</guid><dc:creator>OpenCircuit</dc:creator><description>&lt;p&gt;Thank you very much Vidar, I appreciate that .&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending Data Over BLE 5 Modules in Long Range with ble_app_uart</title><link>https://devzone.nordicsemi.com/thread/239005?ContentTypeID=1</link><pubDate>Tue, 10 Mar 2020 08:44:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0656f2e-b214-4852-a032-dc4855694a41</guid><dc:creator>Vidar Berg</dc:creator><description>[quote user="OpenCircuit"]When should we use ble_nus_string_send instead of printf() function to monitor received data ? [/quote]
&lt;p&gt;&amp;nbsp;Use ble_nus_string_send()&amp;nbsp; when you want to send data to a connected peer device and printf when you want to print something out on the UART interface.&lt;/p&gt;
[quote user="OpenCircuit"]ble_nus_c_string_send() is in&amp;nbsp; ble UART Central example. But I want to send data from peripheral to central. So I think&amp;nbsp; I should use ble_nus_data_send function in ble UART periphreal example, shouldn&amp;#39;t I ? Let&amp;#39;s say I write this in main() in ble_app_uart example : [/quote]
&lt;p&gt;&amp;nbsp;Yes, you can use the function to send data. Check the return value to see if the data is being sent or not.&lt;/p&gt;
&lt;p&gt;uint32_t err_code = ble_nus_data_send(&amp;amp;m_nus, data_array, &amp;amp;length, m_conn_handle);&lt;/p&gt;
&lt;p&gt;NRF_LOG_INFO (&amp;quot;ble_nus_data_send returned 0x%x&amp;quot;, err_code) // return value 0 is the same as NRF_SUCCESS&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending Data Over BLE 5 Modules in Long Range with ble_app_uart</title><link>https://devzone.nordicsemi.com/thread/238706?ContentTypeID=1</link><pubDate>Mon, 09 Mar 2020 07:06:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:825f5610-b00c-4696-aacb-81ac568acfda</guid><dc:creator>OpenCircuit</dc:creator><description>&lt;p&gt;Okay, I understand now.&amp;nbsp; Sorry for the late answer :) &lt;br /&gt;Before I verify your answer, I would like to clear somethings up: &lt;br /&gt;&lt;br /&gt;- When should we use ble_nus_string_send instead of printf() function to monitor received data ? &lt;/p&gt;
&lt;p&gt;- ble_nus_c_string_send() is in&amp;nbsp; ble UART Central example. But I want to send data from peripheral to central. So I think&amp;nbsp; I should use ble_nus_data_send function in ble UART periphreal example, shouldn&amp;#39;t I ? Let&amp;#39;s say I write this in main() in ble_app_uart example : &lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;static uint8_t data_array[BLE_NUS_MAX_DATA_LEN] = &amp;quot;Hello World&amp;quot;;
        uint16_t length = 11;

        ble_nus_data_send(&amp;amp;m_nus, data_array, &amp;amp;length, m_conn_handle);&lt;/pre&gt;&lt;br /&gt;After that, what should I do to see data on the central side ? &lt;br /&gt;&lt;br /&gt;Thank you in advance. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending Data Over BLE 5 Modules in Long Range with ble_app_uart</title><link>https://devzone.nordicsemi.com/thread/238240?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2020 10:48:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:013c7576-cbe2-43d2-95a3-77b7f45bacbf</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Happy to help:)&lt;/p&gt;
[quote user="OpenCircuit"]Also, I used Tera Term and finally saw the data on the terminal. I think only printf() function prints data on UART, doesn&amp;#39;t it ?[/quote]
&lt;p&gt;&amp;nbsp;The nRF logging module (&lt;a title="Logger module" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/lib_nrf_log.html?cp=7_1_3_26"&gt;Logger module&lt;/a&gt;) supports logging over UART, but it&amp;#39;s&amp;nbsp;not enabled in this particular example because&amp;nbsp;the UARTE0 instance is already being used for the serial port emulation.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
[quote user="OpenCircuit"]Don&amp;#39;t we see the data we sent by using printf() function on ble_app_uart_c&amp;nbsp; already ? Do I actually send data or it only prints &amp;quot;Connected to device with Nordic UART Service.&amp;quot; when central device pairs with the advertising peripheral device ?[/quote]
&lt;p&gt;&amp;nbsp;printf() is redirected to uart_tx()&amp;nbsp; and received by the serial client (tera term). It&amp;#39;s data received on the UART RX (e.g., from Tera term) that will be relayed to the other device over BLE.&amp;nbsp;&lt;/p&gt;
[quote user="OpenCircuit"]If I should send data by creating packets, could you please tell me that where should I start to create packet ?[/quote]
&lt;p&gt;&amp;nbsp;See&amp;nbsp;&lt;a title="Handling data received from UART" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/ble_sdk_app_nus_c.html?cp=7_1_4_2_0_7_1_2#data_from_nus_c"&gt;Handling data received from UART&lt;/a&gt;. You pass the data you want to send to &lt;span&gt; &lt;/span&gt;&lt;a title="Function for sending a string to the server." href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/group__ble__nus__c.html#ga87d3c9689508ae0ae6e92a4bc6010380"&gt;ble_nus_c_string_send&lt;/a&gt;()&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending Data Over BLE 5 Modules in Long Range with ble_app_uart</title><link>https://devzone.nordicsemi.com/thread/238084?ContentTypeID=1</link><pubDate>Wed, 04 Mar 2020 14:54:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a28e9f9-2c24-439b-b695-f2aabffc7602</guid><dc:creator>OpenCircuit</dc:creator><description>&lt;p&gt;Thank you for your answer.I can see UUID of my peripheral device on nRF Connect.&lt;/p&gt;
&lt;p&gt;Also, I used Tera Term and finally saw the data on the terminal. I think only printf() function prints data on UART, doesn&amp;#39;t it ?&lt;/p&gt;
&lt;p&gt;I have another confusion:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;- Don&amp;#39;t we see the data we sent by using printf() function on ble_app_uart_c&amp;nbsp; already ? Do I actually send data or it only prints &amp;quot;Connected to device with Nordic UART Service.&amp;quot; when central device pairs with the advertising peripheral device ?&lt;br /&gt;- If I should send data by creating packets, could you please tell me that where should I start to create packet ? &lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending Data Over BLE 5 Modules in Long Range with ble_app_uart</title><link>https://devzone.nordicsemi.com/thread/237814?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2020 14:37:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:470e9a70-d45c-4d89-afed-7d608dae6083</guid><dc:creator>Vidar Berg</dc:creator><description>[quote user="OpenCircuit"]I&amp;#39;ve just reviewed scan_init() function. The thing is that I don&amp;#39;t know how to find UUID of my periphreal device. I tried to see UUID on nRF Connect but I can see only MAC address. I think I should put UUID in advertising packet, shouldn&amp;#39;t I ?[/quote]
&lt;p&gt;&amp;nbsp;Yes, the UUID must be included in the advertisement payload for this filter to wokr. But you can filter on other paramaters such as the device name. You can take a look at the ble_app_blinky_c example for an example of how to set up a device name filter with the &lt;span&gt;&lt;a title="Scanning Module" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/lib_ble_scan.html?cp=7_1_3_2_12"&gt;Scanning Module&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
[quote user="OpenCircuit"]My purpose is to send data from peripheral device to central device and print data on the terminal. I only see strings like &amp;quot;Connected to device with Nordic UART Service &amp;quot; on RTT viewer when advertising device pairs with the central. For example, what should I do if I just want to send a &amp;quot;Hello World&amp;quot; over peripheral and print it on the terminal ? [/quote]
&lt;p&gt;&amp;nbsp;The examples prints out the data received on BLE out on the UART interface. Instructions on how to test this can be found in the example documentation here: &lt;span&gt;&lt;a title="Nordic UART Service Client" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/ble_sdk_app_nus_c.html?cp=7_1_4_2_0_7"&gt;Nordic UART Service Client&lt;/a&gt;&lt;/span&gt; &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending Data Over BLE 5 Modules in Long Range with ble_app_uart</title><link>https://devzone.nordicsemi.com/thread/237638?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2020 08:56:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bde75f0a-7d3f-47ea-961a-5021f635f8fd</guid><dc:creator>OpenCircuit</dc:creator><description>&lt;p&gt;Thank you Vidar !&lt;/p&gt;
&lt;p&gt;-I will review the examples you added and will check examples that includes Peer Manager.&lt;/p&gt;
&lt;p&gt;-I&amp;#39;ve just reviewed scan_init() function. The thing is that I don&amp;#39;t know how to find UUID of my periphreal device. I tried to see UUID on nRF Connect but I can see only MAC address. I think I should put UUID in advertising packet, shouldn&amp;#39;t I ?&lt;/p&gt;
&lt;p&gt;- My purpose is to send data from peripheral device to central device and print data on the terminal. I only see strings like &amp;quot;Connected to device with Nordic UART Service &amp;quot; on RTT viewer when advertising device pairs with the central. For example, what should I do if I just want to send a &amp;quot;Hello World&amp;quot; over peripheral and print it on the terminal ? &lt;br /&gt;&lt;br /&gt;Best Regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending Data Over BLE 5 Modules in Long Range with ble_app_uart</title><link>https://devzone.nordicsemi.com/thread/237472?ContentTypeID=1</link><pubDate>Mon, 02 Mar 2020 13:49:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95e73029-9e04-4be7-b3bf-24051974500f</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;1. It advertises on 1M by default but can be modified to advertise on coded PHY instead. Please take a look at the 2 examples I uploaded here:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/40476/unable-to-convert-to-long-range-after-looking-at-umpteen-examples--/157300#157300"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/40476/unable-to-convert-to-long-range-after-looking-at-umpteen-examples--/157300#157300&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2. Yes, except that ble_app_uart example does not support pairing by default. It will reject any pairing requests coming from the central. Do you wish to support link encryption in your project? In that case, I&amp;#39;d recommend looking for examples that include the Peer Manager library :&amp;nbsp;&lt;span&gt;&lt;a title="Peer Manager" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/lib_peer_manager.html?cp=7_1_3_2_7"&gt;Peer Manager&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;3. It doesn&amp;#39;t check the device name, only that it contains the NUS service UUID. The UUID filter is enabled in scan_init().&lt;/p&gt;
&lt;p&gt;4. RTT log should be displayed automatically in Segger embedded studio while debugging. But you may have to&amp;nbsp;disable &amp;#39;NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED&amp;#39; in sdk_config.h for it to work properly.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;5.&amp;nbsp; It can send up to 244 in one packet provided the peer device also supports it. There is no limit to how many packets you can send. And yes you can use&amp;nbsp;&lt;span&gt;NRF_LOG_INFO&amp;nbsp;to print data.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Vidar&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>