<?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>Inconsistent latency with ble_app_uart sending via ble</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/35868/inconsistent-latency-with-ble_app_uart-sending-via-ble</link><description>Hi, 
 We are trying to optimize the speed at which we send data over BLE UART with the nrf52832. Currently, we are using the ble_nus_data_send() function in a while loop with no delay to send as fast as possible. On the nrf toolbox app and the Adafruit</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 28 Aug 2018 21:06:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/35868/inconsistent-latency-with-ble_app_uart-sending-via-ble" /><item><title>RE: Inconsistent latency with ble_app_uart sending via ble</title><link>https://devzone.nordicsemi.com/thread/146180?ContentTypeID=1</link><pubDate>Tue, 28 Aug 2018 21:06:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:697e64e5-d203-4e13-b582-5471ade8bcc3</guid><dc:creator>BTAdam</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Can you please elaborate on how you were using Adafruit&amp;#39;s library? We&amp;#39;re seeing very similar inconsistent latency issues with using the Adafruit&amp;#39;s nRF52 feather board and Adafruit&amp;#39;s Arduino libraries. We&amp;#39;re attempting to send 5 bytes at a 4ms interval and we&amp;#39;ll see them being sent at intervals like 4ms, 4ms, 21ms, 4ms, 25ms, 4ms, etc. Was wondering how you were able to achieve consistent intervals with Adafruit&amp;#39;s bootload and library.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Thank you,&lt;/p&gt;
&lt;p&gt;Adam&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Inconsistent latency with ble_app_uart sending via ble</title><link>https://devzone.nordicsemi.com/thread/138532?ContentTypeID=1</link><pubDate>Mon, 02 Jul 2018 13:36:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dff0de23-1bf8-4e1b-8e5f-ea242bf2d767</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Could you elaborate on what you mean by &amp;quot;We usually get a lot less speed in the beginning and then it fastens.&amp;quot;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;If you want to maximize the throughput then I suggest that you increase the ATT MTU Size, i.e. increase the number of payload bytes in the packet. This is done by increasing&amp;nbsp;NRF_SDH_BLE_GATT_MAX_MTU_SIZE in sdk_config.h&lt;/p&gt;
&lt;p&gt;The S132 SoftDevice specification lists the throughput for different ATT MTU, connection interval and method configurations, it can be found under&amp;nbsp;&lt;a title="Bluetooth low energy data throughput" href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.sds/dita/softdevices/s130/ble_data_throughput/ble_data_throughput.html?cp=2_3_1_0_16"&gt;Bluetooth low energy data throughput&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Inconsistent latency with ble_app_uart sending via ble</title><link>https://devzone.nordicsemi.com/thread/138341?ContentTypeID=1</link><pubDate>Fri, 29 Jun 2018 16:44:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07bd0c90-660f-43a2-b5f6-a6a3b308571e</guid><dc:creator>Shri1395</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;We tried using this function, and it did actually make the data send rates a bit more faster. To be more precise, the SDK 11 was 4 times more faster than SDK 15, but after this test, we found out that SD15 is now almost as fast as the SDK 11. That means the speed did increase.&lt;/p&gt;
&lt;p&gt;We set the transmission queue to 20.&lt;/p&gt;
&lt;p&gt;My question is: We usually get a lot less speed in the beginning and then it fastens. Is there a way to constantly get the same speed, in order to perform better than SDK 11.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;PS: Quick information:&lt;/p&gt;
&lt;p&gt;SDK 11, 20K bytes in 5.6 seconds.&lt;/p&gt;
&lt;p&gt;SDK 15 before setting the hvn_tx_queue_size to 20 , 20k bytes in 21 seconds.&lt;/p&gt;
&lt;p&gt;SDK 15 after the TX_COMPLETE function with hvn_tx_queue_size set to 20, 20k Bytes in 5.8 sec.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Inconsistent latency with ble_app_uart sending via ble</title><link>https://devzone.nordicsemi.com/thread/138266?ContentTypeID=1</link><pubDate>Fri, 29 Jun 2018 11:48:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:11989a9c-5e7b-40b3-bbdf-73efbca0039a</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;You could try to queue up the notifications as shown in variant 2 in the&amp;nbsp;&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v6.0.0/group___b_l_e___g_a_t_t_s___h_v_n___m_s_c.html"&gt;GATTS Handle Value Notification&lt;/a&gt;&amp;nbsp;Message sequence chart. You could make the data sending interrupt driven by waiting for the BLE_GATTS_EVT_HVN_TX_COMPLETE event before calling sd_ble_gatts_hvx() function again.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Inconsistent latency with ble_app_uart sending via ble</title><link>https://devzone.nordicsemi.com/thread/138186?ContentTypeID=1</link><pubDate>Thu, 28 Jun 2018 16:15:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:29335e2f-a27b-4416-995e-6e33ca019cde</guid><dc:creator>Shri1395</dc:creator><description>&lt;p&gt;Our testing software is running on a Windows machine using the UWP BLE API.&amp;nbsp;&lt;a href="https://docs.microsoft.com/en-us/windows/uwp/devices-sensors/bluetooth-low-energy-overview"&gt;https://docs.microsoft.com/en-us/windows/uwp/devices-sensors/bluetooth-low-energy-overview&lt;/a&gt;. The Windows machine acts as the BLE central. Our current problem is not the inconsistent latency though, its more aligned towards how fast we can send the data (since, we fixed the inconsistent&amp;nbsp;latency problem).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When we tested the blue_app_uart &amp;nbsp;with SDK 11, we are getting an average latency of around 5ms, whereas with SDK 15, we are getting the latency values to be around 21ms.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is there any way we can send the data with SDK 15 as fast as with the SDK 11? I was wondering whether this is possible or not, and if yes, how?&amp;nbsp;We are using the default ble_app_uart codes for both.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Inconsistent latency with ble_app_uart sending via ble</title><link>https://devzone.nordicsemi.com/thread/138174?ContentTypeID=1</link><pubDate>Thu, 28 Jun 2018 15:12:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ce3b333-55bc-4d19-99b2-8b89c510ee40</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Ok, so is the testing software is running on another&amp;nbsp;nRF52 device? Or are you using something else as a BLE central? Could you capture the packets on air with a BLE protocol sniffer available or &lt;a href="https://www.nordicsemi.com/eng/nordic/Products/nRF-Sniffer/nRF-Sniffer-v2/65225"&gt;nRF Sniffer v2&lt;/a&gt;&amp;nbsp;so that we can see if&amp;nbsp; the packets are sent with the correct interval on air or not.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Inconsistent latency with ble_app_uart sending via ble</title><link>https://devzone.nordicsemi.com/thread/138169?ContentTypeID=1</link><pubDate>Thu, 28 Jun 2018 14:52:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a848f8fc-bbdc-4fce-a9a4-471223841120</guid><dc:creator>Shri1395</dc:creator><description>&lt;p&gt;The latency is from a testing software we created that simply measures the time between two consecutive receiving packets of 20 bytes, but this latency is also the same that we&amp;#39;ve seen from the nrf toolbox app and the adafruit ble connect app. Our max connection interval is currently 30 ms and min is 20 ms, but we have changed them from 7.5 to 400 and it hasn&amp;#39;t made any significant difference. It still continues to have irregular slow downs in latency as seen in our output above.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Inconsistent latency with ble_app_uart sending via ble</title><link>https://devzone.nordicsemi.com/thread/138139?ContentTypeID=1</link><pubDate>Thu, 28 Jun 2018 13:17:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa1ec495-f31d-4eb8-872c-b24987bbded0</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;How are you measuring the latency?Is it the time exeeding the time since the last packet was recieved + the connection interval?&amp;nbsp;Which connection interval are you using? When you say that it hangs, you are referring to the nRF Toolbox app? Have you tried using nRF Connect ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>