<?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>Increasing BLE Throughput</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/92683/increasing-ble-throughput</link><description>I&amp;#39;ve been following this blog post to increase BLE throughput for my application: Building a Bluetooth application on nRF Connect SDK - Part 3 Optimizing the connection - Software - nRF Connect SDK guides - Nordic DevZone (nordicsemi.com) It&amp;#39;s very helpful</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 03 Nov 2022 07:14:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/92683/increasing-ble-throughput" /><item><title>RE: Increasing BLE Throughput</title><link>https://devzone.nordicsemi.com/thread/393780?ContentTypeID=1</link><pubDate>Thu, 03 Nov 2022 07:14:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b2c4951f-fa4d-4943-87bb-28ea5fde8717</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Ethan&lt;/p&gt;
&lt;p&gt;By spec the size of an attribute is limited to 512 bytes maximum, and&amp;nbsp;you shouldn&amp;#39;t be able to send more than that in a single write command or request. Then the link layer will split the package into smaller packets for the radio, since the maximum data length is 251 bytes.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Are you able to share the code you use to send 2KB packets using write requests, as well as the configuration parameters you use?&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increasing BLE Throughput</title><link>https://devzone.nordicsemi.com/thread/393658?ContentTypeID=1</link><pubDate>Wed, 02 Nov 2022 12:58:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d3c12b8-5164-417f-a44e-884123facc5f</guid><dc:creator>esisk</dc:creator><description>&lt;p&gt;That&amp;#39;s ok, thanks for stepping in&amp;nbsp;&lt;span&gt;Torbj&amp;oslash;rn. I actually found a decent compromise between scanning discovery and connection throughput, thanks for your suggestion. One more question I have: I noticed that with write commands, the length of the data I can send seems to be limited by the MTU whereas write requests can split a say 2KB packet into the necessary lengths and then some layer in the Bluetooth stack on the peripheral can assemble them all back together to 2KB before giving it to the peripheral&amp;#39;s application layer. Is that possible with write commands as well? I&amp;#39;m trying to reduce the number of flash reads and UART transmissions I need to make in order to send this file&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increasing BLE Throughput</title><link>https://devzone.nordicsemi.com/thread/393591?ContentTypeID=1</link><pubDate>Wed, 02 Nov 2022 09:31:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d62412f2-e9b5-468d-8849-1860aa588b91</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Ethan&lt;/p&gt;
&lt;p&gt;Simon is currently unavailable, and I will help you out instead.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Scanning while in a connection is possible, but it will affect the max throughput of your link, yes. What you can do to minimize the impact is to use a long scanning interval and a short scanning window, but this will obviously affect how fast you detect advertise packets so you have to do some testing to find a good compromise between scanning performance and the throughput of the connection.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increasing BLE Throughput</title><link>https://devzone.nordicsemi.com/thread/392912?ContentTypeID=1</link><pubDate>Thu, 27 Oct 2022 18:54:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:642e74d1-d9ce-457d-a756-2611b87eda4f</guid><dc:creator>esisk</dc:creator><description>&lt;p&gt;Hey Simon, I&amp;#39;m replying here because the reply button won&amp;#39;t show up on your most recent post.&amp;nbsp;&lt;/p&gt;
[quote userid="72692" url="~/f/nordic-q-a/92683/increasing-ble-throughput/392088"]Feel free to open a new ticket about the sniffer trace, and get back here as soon as you have gotten it working. Then I&amp;#39;ll take a look at it.[/quote]
&lt;p&gt;I&amp;#39;ll do that sometime soon.&lt;/p&gt;
&lt;p&gt;Thanks for the clarification regarding requests vs commands. The last thing I need guidance on is scanning for other advertisements while sending this file. Is that even feasible given how much this file sending process is hogging the radio? If it&amp;#39;s feasible, could you give me some advice as to how to go about setting that up or point me towards a good ticket regarding this? Currently haven&amp;#39;t found anything.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increasing BLE Throughput</title><link>https://devzone.nordicsemi.com/thread/392088?ContentTypeID=1</link><pubDate>Mon, 24 Oct 2022 10:05:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6c8f50c-77d7-4026-8de2-74fa4732f292</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I&amp;#39;m happy you were able to increase the throughput to an acceptable level.&lt;/p&gt;
[quote user="esisk"]I set it up on a dev kit that I have but once I had Wireshark open it was a little tough for me to discern how to sniff a connection based off of the instructions I found on Infocenter.[/quote]
&lt;p&gt;If you want to increase the throughput even more, a sniffer trace would be nice.&lt;/p&gt;
&lt;p&gt;Feel free to open a new ticket about the sniffer trace, and get back here as soon as you have gotten it working. Then I&amp;#39;ll take a look at it.&lt;/p&gt;
[quote user="esisk"] Just to clarify my understanding, what&amp;#39;s the benefit of using the requests then? Is it just acked higher up in the BLE stack (GATT, application)?[/quote]
&lt;p&gt;&lt;span&gt;Write requests can be useful in situations where you want to start some time consuming operation on the server side, and you want to restrict the ability to send more data or commands while the current operation is running. The server can send a response to the request once the operation is complete,&amp;nbsp;and is guaranteed not to receive any new commands before this, since you can only have one indication pending at the time.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Indications/notifications are the equivalents of Write request/write command, just in the opposite direction. So the answer above was inspired by&amp;nbsp;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/44482/use-cases-of-indications---when-is-it-better-to-use-indications-over-notifications/174571"&gt;RE: Use cases of indications - When is it better to use indications over notifications?&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increasing BLE Throughput</title><link>https://devzone.nordicsemi.com/thread/391524?ContentTypeID=1</link><pubDate>Wed, 19 Oct 2022 17:59:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14dca02f-95ea-4788-b890-356f2e2c7a40</guid><dc:creator>esisk</dc:creator><description>&lt;p&gt;Hey Simon,&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote userid="72692" url="~/f/nordic-q-a/92683/increasing-ble-throughput/391480"]What is your current throughput? Have you managed to get close to the numbers in&amp;nbsp;&lt;a title="Bluetooth Low Energy data throughput" href="https://infocenter.nordicsemi.com/topic/sds_s140/SDS/s1xx/ble_data_throughput/ble_data_throughput.html?cp=4_7_4_0_16"&gt;Bluetooth Low Energy data throughput&lt;/a&gt;?[/quote]
&lt;p&gt;&lt;span&gt;After performing write commands instead of write requests drastically improved the throughput. I&amp;#39;ve demonstrated sending the 500 KB file in about 1 min. That link is helpful for setting expectations on the speed.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
[quote userid="72692" url="~/f/nordic-q-a/92683/increasing-ble-throughput/391480"]There are some useful blogs about BLE throughput you might want to check out:&amp;nbsp;&amp;nbsp;[/quote]
&lt;p&gt;I&amp;#39;ve read 2/3 of those blogs and they helped me get to where I am now.&amp;nbsp;&lt;/p&gt;
[quote userid="72692" url="~/f/nordic-q-a/92683/increasing-ble-throughput/391494"]The throughput also depends on how you store the file on the peer device, if you need to erase flash pages and write to flash. This will be a bottleneck.[/quote]
&lt;p&gt;This paired with my first response regarding write commands and that link you sent me gives me some better context on my situation. My current setup is the file is stored on flash on another MCU (ESP32) that is the Internet link. That MCU downloads the file. The nRF52840 is scanning for&amp;nbsp;peripherals that need to update. Once it finds one to update, the 840 connects to the peripheral and starts sending it the file. That whole process though consists of the 840 asking the ESP32 for a chunk of the file at a certain offset over UART, chunk gets sent over UART to 840 after it reads that chunk from flash at the specified offset, 840 sends chunk to peripheral via write command, and the whole process repeats itself.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Based off the throughput link you sent me, it says that over 2M PHY, conn interval 7.5ms, and using write commands the throughput could reach up to 256 kbps with just straight data to peripheral, no other operations involved. That comes out to about 15 seconds for the transfer of a 500 KB file. Since I&amp;#39;m doing all these other transactions, the ~1 min transfer sounds right to me. Maybe it could be slightly improved.&lt;/span&gt;&lt;/p&gt;
[quote userid="72692" url="~/f/nordic-q-a/92683/increasing-ble-throughput/391494"]Could you provide a sniffer trace? Then it will be easier to spot where the issue is.[/quote]
&lt;p&gt;I set it up on a dev kit that I have but once I had Wireshark open it was a little tough for me to discern how to sniff a connection based off of the instructions I found on Infocenter.&lt;/p&gt;
[quote userid="72692" url="~/f/nordic-q-a/92683/increasing-ble-throughput/391480"]Both write commands and write requests should be acked in the link layer, so both are&amp;nbsp;reliable.[/quote]
&lt;p&gt;That is good to know, I feel much better about using the commands instead of requests since they&amp;#39;re both reliable. Just to clarify my understanding, what&amp;#39;s the benefit of using the requests then? Is it just acked higher up in the BLE stack (GATT, application)?&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks so much for all of your help so far&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;Ethan&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increasing BLE Throughput</title><link>https://devzone.nordicsemi.com/thread/391494?ContentTypeID=1</link><pubDate>Wed, 19 Oct 2022 15:18:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6dd9d2a8-21f7-44b4-b97e-4e1e6d0fe085</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;The throughput also depends on how you store the file on the peer device, if you need to erase flash pages and write to flash. This will be a bottleneck.&lt;/p&gt;
&lt;p&gt;Could you provide a sniffer trace? Then it will be easier to spot where the issue is.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increasing BLE Throughput</title><link>https://devzone.nordicsemi.com/thread/391480?ContentTypeID=1</link><pubDate>Wed, 19 Oct 2022 14:47:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69be82f5-1095-4cdc-9c02-da383c5ef86d</guid><dc:creator>Simon</dc:creator><description>[quote user="esisk"]Any other tips Simon? [/quote]
&lt;p&gt;What is your current throughput? Have you managed to get close to the numbers in&amp;nbsp;&lt;a title="Bluetooth Low Energy data throughput" href="https://infocenter.nordicsemi.com/topic/sds_s140/SDS/s1xx/ble_data_throughput/ble_data_throughput.html?cp=4_7_4_0_16"&gt;Bluetooth Low Energy data throughput&lt;/a&gt;?&lt;/p&gt;
&lt;p&gt;There are some useful blogs about BLE throughput you might want to check out:&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://interrupt.memfault.com/blog/ble-throughput-primer"&gt;https://interrupt.memfault.com/blog/ble-throughput-primer&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://punchthrough.com/ble-throughput-part-4/"&gt;https://punchthrough.com/ble-throughput-part-4/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://novelbits.io/bluetooth-5-speed-maximum-throughput/"&gt;https://novelbits.io/bluetooth-5-speed-maximum-throughput/&lt;/a&gt;&lt;/p&gt;
[quote user="esisk"] Another question I have is are write requests commands reliable?&amp;nbsp;[/quote]
&lt;p&gt;Both write commands and write requests should be acked in the link layer, so both are&amp;nbsp;reliable.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increasing BLE Throughput</title><link>https://devzone.nordicsemi.com/thread/390999?ContentTypeID=1</link><pubDate>Mon, 17 Oct 2022 13:09:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:40eadff0-68e0-4820-9614-52c07e418102</guid><dc:creator>esisk</dc:creator><description>&lt;p&gt;Any other tips Simon? My main option may just be switching to write commands instead of write requests. That significantly improved the throughput. Another question I have is are write requests commands reliable?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increasing BLE Throughput</title><link>https://devzone.nordicsemi.com/thread/390289?ContentTypeID=1</link><pubDate>Tue, 11 Oct 2022 13:49:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f03cb6a0-9e1d-406d-a2f1-7a7307c1af5f</guid><dc:creator>esisk</dc:creator><description>&lt;p&gt;I&amp;#39;ll try that out. That would make sense as to why I could be experiencing a bottleneck.&lt;/p&gt;
&lt;p&gt;Edit: Increasing to 400ms connection interval really slowed the process down. I&amp;#39;ll continue to experiment with different intervals though&lt;/p&gt;
&lt;p&gt;Edit 2: After playing around with the parameters some more, I&amp;#39;m definitely seeing faster speeds with the lower connection intervals&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Increasing BLE Throughput</title><link>https://devzone.nordicsemi.com/thread/390286?ContentTypeID=1</link><pubDate>Tue, 11 Oct 2022 13:43:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:011e70c5-1fbe-45d4-979d-c6bc9c94b8cd</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Can you try to increase the connection interval higher than 7.5 ms? A low connection interval doesn&amp;#39;t necessarily lead to a high throughput&lt;/p&gt;
&lt;p&gt;To understand why, read this answer by Torbjørn:&amp;nbsp;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/69999/what-is-the-relation-between-connection-interval-and-the-throughput/287212"&gt;RE: what is the relation between connection interval and the throughput?&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The throughput example uses a connection interval of 400 ms:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/0a77f4d53ee9fcc3662a8888c8290dde96da412e/samples/bluetooth/throughput/src/main.c#L32-L33"&gt;https://github.com/nrfconnect/sdk-nrf/blob/0a77f4d53ee9fcc3662a8888c8290dde96da412e/samples/bluetooth/throughput/src/main.c#L32-L33&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Let me know what the throughput is after you&amp;#39;ve increased the conn. interval. Also try to play around with the throughput example to get an understanding of how the different &lt;a href="https://github.com/nrfconnect/sdk-nrf/tree/0a77f4d53ee9fcc3662a8888c8290dde96da412e/samples/bluetooth/throughput#changing-connection-parameter-values"&gt;connection parameters&lt;/a&gt; affects the throughput&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>