The example of FUOTA over LoRaWAN
This example is forked from the repo https://github.com/ARMmbed/mbed-os-example-lorawan-fuota
Target device: L-TEK FF1705
- Install Mbed Studio-1.2.1
- Import this repository via:
$ mbed import https://github.com/asvin-io/lorawan-fuota-mbed-os-example.git
- In source folder, rename the device_details_copy.h file to device_details.h. Then specify the
APP_EUI
,APP_KEY
,GEN_APP_KEY
, andFW_VER_STR
in device_details.h file. Here theDEV_EUI
will be fetched from the internal memory. Please specify this Device EUI in your ChirpStack Application. - Also provide asvin device and user credentials in device_details.h
- In mbed_app.json specify the frequency plan
- Build the application using:
This will create binary files in
$ mbed compile -m FF1705_L151CC -t GCC_ARM --profile=./profiles/tiny.json
BUILD/FF1705_L151CC/GCC_ARM-TINY/
folder - From the folder
BUILD/FF1705_L151CC/GCC_ARM-TINY/
copy thembed-os-example-lorawan-fuota.bin
file to the development board (mounted as flash storage device). - After flashing, press on-board reset button and connect the device to serial monitor with baud rate of 115200 to view the device logs.
Tip!!
On Windows, it is better to use Ubuntu18 on WSL2 to run this tool
- Requirements: Node.js 8 o higher, Python 2.7, OpenSSL
- Install the lorawan-fota-signing-tool:
$ npm install lorawan-fota-signing-tool -g
- Create a public/private key pair:
Example:
$ lorawan-fota-signing-tool create-keypair -d yourdomain.com -m your-device-model-string
$ lorawan-fota-signing-tool create-keypair -d abc.com -m LTEK
- Before building the aplication with new updates, copy the file
mbed-os-example-lorawan-fuota_update.bin
to./updates
folder. And rename it asv1_update.bin
- Now build the application with updates. It will create binary files with necessary updates in
BUILD/FF1705_L151CC/GCC_ARM-TINY/
folder - Then copy the file
mbed-os-example-lorawan-fuota_update.bin
to./updates
folder. And rename it asv2_update.bin
- Create the delta file using:
$ lorawan-fota-signing-tool sign-delta --old ./updates/v1_update.bin --new ./updates/v2_update.bin --output-format bin -o ./updates/v1_to_v2.bin
Firmware update using asvin platform
- Upload the diff file
v1_to_v2.bin
to the filegroup of LoRaWAN update files. - Then create fuota deployment rollout in the rollouts tab
- This will create a Multicast-group for the mulcast session setup and distribute update
- After successful update, the device sends a success status LoRa uplink which will be used to store the current running firmware version of the end node.