<?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>(nRF52832 / SDK 14.0 / s132 5.0.0) Optimizing BLE throughput between nRF52 (peripheral) and Android device (central)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/32585/nrf52832-sdk-14-0-s132-5-0-0-optimizing-ble-throughput-between-nrf52-peripheral-and-android-device-central</link><description>I&amp;#39;m using the nRF52382 with SDK 14.0 and softdevice s132 5.0.0, and I need to send up to hundreds or thousands of kilobytes to an Android phone over BLE. I need to optimize throughput, and I&amp;#39;ve read all the forum and blog posts I could find, and so I</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 18 Apr 2018 14:33:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/32585/nrf52832-sdk-14-0-s132-5-0-0-optimizing-ble-throughput-between-nrf52-peripheral-and-android-device-central" /><item><title>RE: (nRF52832 / SDK 14.0 / s132 5.0.0) Optimizing BLE throughput between nRF52 (peripheral) and Android device (central)</title><link>https://devzone.nordicsemi.com/thread/128847?ContentTypeID=1</link><pubDate>Wed, 18 Apr 2018 14:33:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b2158688-0d01-45ea-b356-38eab2c8a7ea</guid><dc:creator>Sydney</dc:creator><description>&lt;p&gt;Hi Kalman,&lt;/p&gt;
&lt;p&gt;Unfortunately my code is pretty far removed from the examples at this point so I&amp;#39;m not sure I can help you set up any of the nRF52 examples to transfer data to an Android phone. All of the testing I described in my original post was based on my custom firmware. And unfortunately I didn&amp;#39;t write the early stages of the data transfer code so I&amp;#39;m not sure which example(s) the code was originally based on. But it essentially just queues and sends notifications as quickly as possible, with each notification containing some number of bytes as determined by the negotiated MTU size.&lt;/p&gt;
&lt;p&gt;That said, I measure throughput between an nRF52 running our firmware and an Android phone in two ways. The simplest way is to put a known amount of data on&amp;nbsp;my nRF52 device, transfer that known amount of data to&amp;nbsp;my Android phone, and time the transfer with a stopwatch or something similar. So if I have 512 kilobytes of data to transfer and I time the transfer at 16 seconds, that&amp;#39;s 32 kilobytes per second or 256 kilobits per second.&lt;/p&gt;
&lt;p&gt;I also track time and bytes transferred in my nRF52 firmware, so I calculate and log throughput in real time during transfers. This is probably the most accurate way I measure, but I can only access the logging output if I can physically access the debug connector on the board, which isn&amp;#39;t always the case. (Similarly, I&amp;#39;d think if you&amp;#39;re writing your own Android application, it should be pretty easy to calculate throughput on the Android side.)&lt;/p&gt;
&lt;p&gt;We do most of our testing with our own internally developed Android application, but I also test with the Android version of nRF Connect pretty extensively.&lt;/p&gt;
&lt;p&gt;To test with nRF Connect, most of the process is going to be specific to firmware&amp;#39;s custom data transfer implementation, unfortunately. Essentially you&amp;#39;d need to connect to your nRF52 with nRF Connect, subscribe to notifications (in nRF Connect) on whichever characteristic(s) will be sending your data, and then do whichever action you&amp;#39;ve designed your device to initiate the data transfer. This could be a button press, Android writing a specific sequence of characteristics to your device, a timer, etc. After connecting but before initiating the transfer, you&amp;#39;ll probably want to request a higher connection priority in nRF Connect. This will lower the connection interval, allowing notifications to be sent more often, speeding up your throughput.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: (nRF52832 / SDK 14.0 / s132 5.0.0) Optimizing BLE throughput between nRF52 (peripheral) and Android device (central)</title><link>https://devzone.nordicsemi.com/thread/128793?ContentTypeID=1</link><pubDate>Wed, 18 Apr 2018 12:12:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:862a2e9a-aa57-4ce7-9876-f09cbbb4b00b</guid><dc:creator>kalmi123</dc:creator><description>&lt;p&gt;Hi Sydney!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I also would like to measure throughput between my phone and an nrf board.&lt;/p&gt;
&lt;p&gt;Could you please describe me how you did this test?&lt;/p&gt;
&lt;p&gt;Which android app did you use, which nordic example did you use, what modification did in the example if needed, and please describe the process of the throughput test.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank You,&lt;/p&gt;
&lt;p&gt;Kalman&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: (nRF52832 / SDK 14.0 / s132 5.0.0) Optimizing BLE throughput between nRF52 (peripheral) and Android device (central)</title><link>https://devzone.nordicsemi.com/thread/125422?ContentTypeID=1</link><pubDate>Wed, 21 Mar 2018 18:44:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5655c9f4-e8bc-4881-8ebf-6d35b91ee2c2</guid><dc:creator>Sydney</dc:creator><description>&lt;p&gt;Interesting- I currently have event length set to 15ms since that&amp;#39;s what I typically use for connection interval, but it didn&amp;#39;t appear that setting event length any higher (say, to 30ms or 45ms) in case I wanted to use longer connection intervals required any additional RAM.&lt;/p&gt;
&lt;p&gt;The 6 packets per connection interval is a limitation of Android, right? Not Bluetooth?&lt;/p&gt;
&lt;p&gt;And thanks, yeah, I&amp;#39;d seen that article about optimizing throughput, but the numbers they measure are for nRF52-to-nRF52, so I&amp;#39;m curious about how much slower we should expect to see a connection with an Android phone to be, where the bottlenecks are when transferring to an Android phone, and whether I&amp;#39;m already hitting those bottlenecks or if there are further improvements I can make.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: (nRF52832 / SDK 14.0 / s132 5.0.0) Optimizing BLE throughput between nRF52 (peripheral) and Android device (central)</title><link>https://devzone.nordicsemi.com/thread/125373?ContentTypeID=1</link><pubDate>Wed, 21 Mar 2018 14:11:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2621aeb9-d8f3-4fdf-807f-99dde8987d32</guid><dc:creator>JenR</dc:creator><description>&lt;p&gt;1. the&amp;nbsp;&lt;span&gt;NRF_SDH_BLE_GAP_EVENT_LENGTH&amp;nbsp; in the length of the connection event. The bigger you set this variable, the more packets (or longer packets) you can send in one connection event because the connection event is longer. This means the buffer to store packets that can be sent has to be bigger, which increases your RAM usage.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;You can send more than one packet in a connection event.&amp;nbsp;If you set your MTU to 247 and you have a NRF_SDH_BLE_GAP_EVENT_LENGTH&amp;nbsp;&amp;nbsp;that allows to send&amp;nbsp;6 packets per connection event, you&amp;nbsp;maybe need a higher connection interval to be able to send 6 packets of 247B. So increasing your connection interval can optimize your throughput.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Have a look here on how to optimize throughput:&amp;nbsp;&lt;a href="https://www.novelbits.io/bluetooth-5-speed-maximum-throughput/"&gt;www.novelbits.io/.../&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>