How can I calculate the maximum throughput for an application running on the nRF51822 and the S110, when connecting to different kind of Central devices?
There are primarily 3 factors that determine maximum throughput with BLE:
For high-throughput applications, you should make sure to use either Write Commands (Write without response) or Notification. In each such Write Command or Notification, you can have 20 B data. These packets are link-level ACK-ed, but does not provide any application level ACK-ing, and can hence be queued. If you instead use Write Requests or Indications, you can by spec not queue packets and must wait for an ACK to the first packet before sending the next. This significantly reduces throughput (perhaps 10-fold).
Both the nRF8001 and the nRF51822 supports the lowest connection interval allowed by spec, 7.5 ms. This is also supported by some Android devices, while others does not seem to allow intervals below 37.5 ms. The latest versions of iOS seems to have 30 ms as the lowest documented interval supported.
Number of packets per event
With regard to number of packets per connection event, the nRF8001 will be able to receive 2-3 but can transmit only 1. The nRF51822 on the other hand can both send or transmit up to 6 packets per interval. It seems that most Android devices supports ~4 packets per interval, while most iOS devices supports up to 6 packets.
As you can see from the above, throughput with BLE isn't quite straightforward, but given a number of packets per interval n and a connection interval T, the maxiumum throughput can be calculated like this:
n * 20 B * 1/T
How to receive BLE packets via nRF51822/nRF51422 and Master Emulator Firmware is described in this tutorial, section "Using the nRF51 Dongle". Further discussion on BLE throughput test is on this thread. Also different BLE packet types heavily influence the maximum throughput, as described in this blog.
Also, for a suggestion of an application algorithm to get high throughput, take a look at this: https://devzone.nordicsemi.com/index.php/dealing-large-data-packet-s-through-ble
Hi, I'm still confused about few things.
How can I calculate the maximum throughput for a ble link between peripheral and central device ? I'm sending a packet (20bytes = 160 bits) every 40ms until send a total of 1000 packets.
R = (160*1000)/40s = 4000bps => 3.9kbps
That is a correct way for calculate throughput for ble ?? and the max and min connection interval ? at this moment my parameters are:
DEFAULT_DESIRED_MIN_CONN_INTERVAL 32; // 40ms
DEFAULT_DESIRED_MAX_CONN_INTERVAL 64; //80ms
How do these values interfere with my calculations?
I dont understand your examples because my propose is calculate throughput after sending 1000 packets.
Thank you for everyone and please, help me :)
As stated above, the throughput is dependent on the connection interval, and you can take a look at this question for an explanation of connection parameters: https://devzone.nordicsemi.com/index.php/what-is-connection-parameters
If you want to transfer data every 40 ms, you should use a connection interval of 40 ms. For a link with a connection interval of 40 ms, max throughput will be 6 * 20 B * 1/(0.040 s) = 3 kB/s if your devices are capable of transferring six packet per interval and 1 * 20 B * 1/(0.040 s) = 0.5 kB/s if you transfer one packets per interval.
Hi Ole Morten,
thanks for the quick response.
But how do I know how many packets can I send per interval ?
And i want calculate throughput after receiving 1000 packets, so i have to consider this value in calculations right ? total time would be 40seconds and not 40ms...
thanks a lot again, but I want to make sure my calculations are correct :\