This test shows the limits of the library in terms of performace in case of large data transfer/streaming of data. The test settings are based on typical application Arduino(MCU) <-> Pi communication. A low-end RPi is used to have a conservative baseline in terms of transfer rates & cpu usage. The porformance on more powerfull boards could improve the performance considerably.
On the other hand the benchmark reference of typical transfer rates using optimized library in micro controllers is:
Speed |
w/ ACK |
w/o ACK |
2Mbps |
68KB/s |
200KB/s |
1Mbps |
47KB/s |
100KB/s |
250Kbps |
16KB/s |
22KB/s |
- Node A: Arduino Nano 5v/16Mhz
- Node B: Rapsberry Pi Zero W 1.1 (Forced to 700Mhz) with SPIDEV driver.
- Node A <-> Node B distance: in the same room about 2-3 meters: No packet loss.
- Channel: 70
- CRC: 8 bits
- IRQ connceted (not using IRQ will reduce the transfer rate big time)
- Max steam size 512 bytes.
Speed |
w/ ACK |
w/o ACK |
%CPU node B |
2Mbps |
62kb/s |
loss |
60% |
1Mbps |
33Kb/s |
loss |
55% |
250Kbps |
11Kb/s |
19kb/s |
35% |
Speed |
w/ ACK |
w/o ACK |
%CPU node B |
% CPU node B |
2Mbps |
60Kb/s |
100kb/s |
79% |
86% |
1Mbps |
32Kb/s |
80Kb/s |
75% |
82% |
250Kbps |
11Kb/s |
20Kb/s |
75% |
80% |
- Use allways IRQ line for improve transfer speeds and reduce CPU usage.
- Streaming from a PI will stress the cpu at high rates of transfers. Using faster & multiple core boards such RPI3 is recommended for streaming.
- Tunning max stream size variable can improve the transfer speeds.