transfer files from mbed-os block device (i.e. SD card) over LoRa radio.
radio chip selection
Radio chip driver is not included, allowing choice of radio device.
If you're using SX1272 or SX1276, then import sx127x driver into your program.
if you're using SX1261 or SX1262, then import sx126x driver into your program.
if you're using SX1280, then import sx1280 driver into your program.
If you're using NAmote72 or Murata discovery, then you must import only sx127x driver.
This program uses mbed serial terminal at 115200 8N1.
Files (on SD Card) are transferred between two LoRa devices.
Use ? question mark to see available commands on serial terminal.
Send file to other side using send /fs/somefile
, then use cmp /fs/somefile
to compare the file on the other side of radio link with local file with same name.
Use cmp
to test radio link.rm
command to delete files must not include /fs/
directory prefix, filename only.
send
and cmp
require /fs/
directory.
sx1280 thruput
bytes/sec | sf12 | sf11 | sf10 | sf9 | sf8 | sf7 | sf6 | sf5 |
1600KHz | 276 | 482 | 1081 | 1887 | 3277 | 5365 | 6400 | 12000 |
800KHz | 529 | 970 | 1720 | 2800 | 4766 | 6500 | ||
400KHz | 1465 | 2265 | 4033 |
sx126x thruput
bytes/sec | sf12 | sf11 | sf10 | sf9 | sf8 | sf7 | sf6 | sf5 |
500KHz | 207 | 381 | 706 | 1257 | 2154 | 3570 | 5608 | |
250KHz | 103 | 193 | 344 | 641 | 1114 | 1887 | 3064 | |
125KHz | 97 | 173 | 324 | 547 | 972 | 1607 |
sx127x thruput
sx126x recommended at 500KHz bandwidth.
bytes/sec | sf12 | sf11 | sf10 | sf9 | sf8 | sf7 |
500KHz | 111 | 207 | 385 | 697 | 1220 | 2050 |
250KHz | 48.7 | 103 | 192 | 345 | 632 | 1115 |
125KHz | 24.2 | 44 | 97 | 151 | 313 | 552 |
62.5KHz | 12.2 | 22.1 | 39.4 | 86 | 157 | 276 |
SD Card
SD card driver must be enabled in mbed_app.json
with the line "target.components_add": ["SD"]
Pins for SD card connection can be overridden as shown in mbed_app.json
.
The default pin configuration for SD card is found in mbed_lib.json
in mbed-os/components/storage/blockdevice/COMPONENT_SD/
.
If no pin configuration exists in this mbed_lib.json
, or needs to be changed, the included mbed_app.json
is example pin declaration for SD card.
FAT filesystem is only used in this project for demonstration purpose; for easily copying files to SD card.
However, for production projects, LittleFileSystem needs to be used instead for reliability and wear leveling.
Platforms such as K64F have SD card slot already.
See all boards with arduino shield connector and SD card here. (arduino connector needed for LoRa radio board)
...but if you want to use nucleo board: