<?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>Transfer large files from mobile app to NRF52. How ble receives files in DFU mode with 10kbs speed?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/65020/transfer-large-files-from-mobile-app-to-nrf52-how-ble-receives-files-in-dfu-mode-with-10kbs-speed</link><description>Hi, I want to transfer 900KB file from mobile to NRF52. 
 I am using nRF5_SDK_15.3.0_59ac345. - Can you guide me for that? - How BLE receives a bin file from DFU via the NRF Connect app? - Is there any way to implement services like DFU to just transfer</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 20 Aug 2020 12:33:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/65020/transfer-large-files-from-mobile-app-to-nrf52-how-ble-receives-files-in-dfu-mode-with-10kbs-speed" /><item><title>RE: Transfer large files from mobile app to NRF52. How ble receives files in DFU mode with 10kbs speed?</title><link>https://devzone.nordicsemi.com/thread/265556?ContentTypeID=1</link><pubDate>Thu, 20 Aug 2020 12:33:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0ee2741-c2eb-4ebd-b75f-5fbdb185ac02</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I suggest you spend a little time looking into BLE in general, as throughput and delays are controlled by several factors.&lt;/p&gt;
[quote user=""]- How BLE receives a bin file from DFU via the NRF Connect app?[/quote]
&lt;p&gt;The data is transferred by sending notifications. That is the most efficient way of transmitting data with high throughput.&lt;/p&gt;
[quote user=""]- Is there any way to implement services like DFU to just transfer files.Not for DFU purposes.Then guide me for that.[/quote]
&lt;p&gt;Yes, you just send large notifications. You can refer to for instance the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.0/ble_sdk_app_nus_eval.html"&gt;Nordic UART service example&lt;/a&gt; or the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.0/ble_sdk_app_att_mtu.html"&gt;throughput example&lt;/a&gt;.&lt;/p&gt;
[quote user=""]- What is the maximum byte size of a single packet which I can receive or send over BLE?[/quote]
&lt;p&gt;If you use data length extension, then the maximum&amp;nbsp;payload is 251, giving room for maximum 247 byte ATT MTU size.&lt;/p&gt;
[quote user=""]- What is the minimum delay between to consecutive packet while transfer data? is there any way to optimize this time.[/quote]
&lt;p&gt;To answer the question directly, that is the Inter Frame Space (IFS), which is 150 us. However, that may not be the number you are looking for. There are many factors affecting how fast you can get packts through:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Connection interval&lt;/li&gt;
&lt;li&gt;Connection event duration&lt;/li&gt;
&lt;li&gt;Availability of data to send and possibility handle incoming data&lt;/li&gt;
&lt;li&gt;Packet loss&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To get high throughput, you would want to (counter-intuitively) use a bit longer connection intervals than minimum, and make sure that the length of the connection event is about equal to the connection interval. Then make sure you use long packets and send packets back to back. Then you can get a very high throughput, up to 700 kB on the 1Mbps PHY (though in practice you will only get this in a test setup with two nRF devices, as everything must be perfect). You can use the throughput example to see this.&lt;/p&gt;
[quote user=""]- Is there any option to select &lt;strong&gt;with&lt;/strong&gt;&amp;nbsp;a&amp;nbsp;&lt;strong&gt;response and without response&lt;/strong&gt; while I am sending any data to mobile app to optimize delay between two consecutive packets.[/quote]
&lt;p&gt;Yes. But if you want high throughput and just push data, then this is not really that relevant, as you probably want to use notifications instead of writes.&lt;/p&gt;
[quote user=""]When I use ble_nus_service to send data on the app constantly, I am facing 70ms delay between two consecutive packets.[/quote]
&lt;p&gt;Is this with a mobile phone? What is the connection parameters on the link? You can see this from a sniffer or by adding more logging when you get the&amp;nbsp;BLE_GAP_EVT_CONNECTED event.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>