LoRaWAN Multicast Setup and Firmware Updates OTA
The following APIs can be used to create fota schedule files or files can be created directly into the /var/run/.fota directory.
-
- Uploads a file and copies it into /var/run/.fota/
https://<SERVER-IP>/api/command/upload_lora_fota_file
------WebKitFormBoundaryfX3HU1aeZkuK5C0A
Content-Disposition: form-data; name="fotafile"; filename="mbed-os.bin"
Content-Type: application/octet-stream------WebKitFormBoundaryfX3HU1aeZkuK5C0A--
- Uploads a file and copies it into /var/run/.fota/
-
Creates a schedule file using “schedule_file_name” field in /var/run/.fota with the above JSON
The operation scheduled time and time until setup starts is encoded in the file name.
fota__A fota daemon is running in mPower that will kick off the scheduled operation from this file at the encoded time info in the filename.
https://<SERVER-IP>/api/lora/fota
{
"scheduledTimeSinceUnixEpoch": 1749562414,
"keep_log": false,
"ssleep_time": 1000,
"sleep_time": 1500,
"schedule_filename": "fota_1749562414_0",
"setupTimeFromScheduledTime": 0,
"launchTimeFromSetupTime": 60,
"browserTimeBias": 0,
"transmission_type": "FOTA",
"multicastDeveui": "00-80-00-f5-d8-ec-69-a3",
"endDeviceDeveuis": ["00-80-00-00-00-aa-bb-01"],
"schedule_source": "Conduit",
"fotaFile": "mbed-os.bin",
"fotaDescriptor": 0,
"parity_fragments_per_session": 100,
"psleep_time": 3000
}
- See progress of operations with these API calls, this API pulls data from files in /var/run/.fota, progress and results are created by the fota daemon.
https://<SERVER-IP>/api?fields=lora/fotaprogress,lora/fotaschedule,lora/fotaresults
{
"code" : 200,
"result" :
{
"lora_fotaprogress" : [],
"lora_fotaresults" : [],
"lora_fotaschedule" :
[
{
"browserTimeBias" : -5,
"endDeviceDeveuis" : [],
"fotaDescriptor" : 0,
"fotaFile" : "mbed-os.bin",
"keep_log" : false,
"launchTimeFromSetupTime" : 60,
"multicastDeveui" : "00-80-00-f5-d8-ec-69-a3",
"parity_fragments_per_session" : 100,
"psleep_time" : 3000,
"schedule_filename" : "fota_36753562_1749562419_0",
"schedule_source" : "Conduit",
"scheduledTimeSinceUnixEpoch" : 1749562419,
"setupTimeFromScheduledTime" : 0,
"sleep_time" : 1500,
"ssleep_time" : 1000,
"transmission_type" : "FOTA"
}
]
},
"status" : "success"
}
-
Creating a cancel file will stop the fota process and clean up the temporary session and device of the multicast EUI.
The log and progress files will be removed.
$ cd /var/run/.fota
$ sudo touch cancel_36753562admin@mtcdt-444555:/var/run/.fota$ ps aux | grep fota
root 7265 0.9 1.6 16968 4220 ? Sl 08:06 0:00 /usr/bin/lora-fota -d /var/run/.fota -log /var/log/log_fota_36753562_1750165566_0.log -resultfile /var/run/.fota/results_fota_36753562_1750165566_0.json -progfile /var/log/progress_fota_36753562_1750165566_0.json -vv -rminput -j /var/run/.fota/fota_36753562_1750165566_0
The server will NOT send downlinks to the end-devices to cancel the multicast and fragmentation session though.
The Downloads page has IPKs available for MTS Beta and LoRa Alliance Compliant versions of the FUOTA application. The 0.0.9 MTS Beta version is compatible with Dot 3.0.x and 3.1.x firmware releases. The 1.0.10 and later versions are compatible with Dot 3.3.x and later firmwares.
To install 0.0.9 on mPower 5.1.5 use the –force-downgrade option with opkg.
$ sudo /etc/init.d/fotad stop
$ wget http://www.multitech.net/downloads/fotad_0.0.19-r11.0_arm926ejste.ipk
$ sudo opkg install --force-downgrade fotad_0.0.19-r11.0_arm926ejste.ipk
$ sudo /etc/init.d/fotad start
To install 1.0.10 on mPower 5.1.5
$ sudo /etc/init.d/fotad stop
$ wget http://www.multitech.net/downloads/fotad_1.0.10-r11.0_arm926ejste.ipk
$ sudo opkg install --force-downgrade fotad_1.0.10-r11.0_arm926ejste.ipk
$ sudo /etc/init.d/fotad start