This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Transfer large files from mobile app to NRF52. How ble receives files in DFU mode with 10kbs speed?

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 files.Not for DFU purposes.Then guide me for that.
- What is the maximum byte size of a single packet which I can receive or send over BLE?
- What is the minimum delay between to consecutive packet while transfer data? is there any way to optimize this time.

- Is there any option to select with a response and without response while I am sending any data to mobile app to optimize delay between two consecutive packets.

When I use ble_nus_service to send data on the app constantly, I am facing 70ms delay between two consecutive packets.

Thanks.

Parents
  • Hi,

    I suggest you spend a little time looking into BLE in general, as throughput and delays are controlled by several factors.

    - How BLE receives a bin file from DFU via the NRF Connect app?

    The data is transferred by sending notifications. That is the most efficient way of transmitting data with high throughput.

    - Is there any way to implement services like DFU to just transfer files.Not for DFU purposes.Then guide me for that.

    Yes, you just send large notifications. You can refer to for instance the Nordic UART service example or the throughput example.

    - What is the maximum byte size of a single packet which I can receive or send over BLE?

    If you use data length extension, then the maximum payload is 251, giving room for maximum 247 byte ATT MTU size.

    - What is the minimum delay between to consecutive packet while transfer data? is there any way to optimize this time.

    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:

    • Connection interval
    • Connection event duration
    • Availability of data to send and possibility handle incoming data
    • Packet loss

    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.

    - Is there any option to select with a response and without response while I am sending any data to mobile app to optimize delay between two consecutive packets.

    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.

    When I use ble_nus_service to send data on the app constantly, I am facing 70ms delay between two consecutive packets.

    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 BLE_GAP_EVT_CONNECTED event.

Reply
  • Hi,

    I suggest you spend a little time looking into BLE in general, as throughput and delays are controlled by several factors.

    - How BLE receives a bin file from DFU via the NRF Connect app?

    The data is transferred by sending notifications. That is the most efficient way of transmitting data with high throughput.

    - Is there any way to implement services like DFU to just transfer files.Not for DFU purposes.Then guide me for that.

    Yes, you just send large notifications. You can refer to for instance the Nordic UART service example or the throughput example.

    - What is the maximum byte size of a single packet which I can receive or send over BLE?

    If you use data length extension, then the maximum payload is 251, giving room for maximum 247 byte ATT MTU size.

    - What is the minimum delay between to consecutive packet while transfer data? is there any way to optimize this time.

    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:

    • Connection interval
    • Connection event duration
    • Availability of data to send and possibility handle incoming data
    • Packet loss

    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.

    - Is there any option to select with a response and without response while I am sending any data to mobile app to optimize delay between two consecutive packets.

    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.

    When I use ble_nus_service to send data on the app constantly, I am facing 70ms delay between two consecutive packets.

    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 BLE_GAP_EVT_CONNECTED event.

Children
No Data
Related