{"id":30434,"date":"2020-03-16T11:29:18","date_gmt":"2020-03-16T16:29:18","guid":{"rendered":"http:\/\/www.multitech.net\/developer\/?page_id=30434"},"modified":"2025-06-17T08:16:40","modified_gmt":"2025-06-17T13:16:40","slug":"lorawan-multicast-setup-and-firmware-updates-ota","status":"publish","type":"page","link":"https:\/\/www.multitech.net\/developer\/software\/lora\/lorawan-multicast-setup-and-firmware-updates-ota\/","title":{"rendered":"LoRaWAN Multicast Setup and Firmware Updates OTA"},"content":{"rendered":"<p>The following APIs can be used to create fota schedule files or files can be created directly into the \/var\/run\/.fota directory.<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li>Uploads a file and copies it into \/var\/run\/.fota\/<br \/>\nhttps:\/\/&lt;SERVER-IP&gt;\/api\/command\/upload_lora_fota_file<br \/>\n<code><br \/>\n------WebKitFormBoundaryfX3HU1aeZkuK5C0A<br \/>\nContent-Disposition: form-data; name=\"fotafile\"; filename=\"mbed-os.bin\"<br \/>\nContent-Type: application\/octet-stream<\/p>\n<p>------WebKitFormBoundaryfX3HU1aeZkuK5C0A--<br \/>\n<\/code>\n<\/li>\n<\/ol>\n<\/li>\n<li>\nCreates a schedule file using &#8220;schedule_file_name&#8221; field in \/var\/run\/.fota with the above JSON<\/p>\n<p>The operation scheduled time and time until setup starts is encoded in the file name.<br \/>\nfota__<\/p>\n<p>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.<\/p>\n<p>https:\/\/&lt;SERVER-IP&gt;\/api\/lora\/fota<br \/>\n<code><br \/>\n{<br \/>\n\"scheduledTimeSinceUnixEpoch\": 1749562414,<br \/>\n\"keep_log\": false,<br \/>\n\"ssleep_time\": 1000,<br \/>\n\"sleep_time\": 1500,<br \/>\n\"schedule_filename\": \"fota_1749562414_0\",<br \/>\n\"setupTimeFromScheduledTime\": 0,<br \/>\n\"launchTimeFromSetupTime\": 60,<br \/>\n\"browserTimeBias\": 0,<br \/>\n\"transmission_type\": \"FOTA\",<br \/>\n\"multicastDeveui\": \"00-80-00-f5-d8-ec-69-a3\",<br \/>\n\"endDeviceDeveuis\": [\"00-80-00-00-00-aa-bb-01\"],<br \/>\n\"schedule_source\": \"Conduit\",<br \/>\n\"fotaFile\": \"mbed-os.bin\",<br \/>\n\"fotaDescriptor\": 0,<br \/>\n\"parity_fragments_per_session\": 100,<br \/>\n\"psleep_time\": 3000<br \/>\n}<br \/>\n<\/code>\n<\/li>\n<li>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.\n<p>https:\/\/&lt;SERVER-IP&gt;\/api?fields=lora\/fotaprogress,lora\/fotaschedule,lora\/fotaresults<br \/>\n<code><br \/>\n{<br \/>\n\"code\" : 200,<br \/>\n\"result\" :<br \/>\n{<br \/>\n\"lora_fotaprogress\" : [],<br \/>\n\"lora_fotaresults\" : [],<br \/>\n\"lora_fotaschedule\" :<br \/>\n[<br \/>\n{<br \/>\n\"browserTimeBias\" : -5,<br \/>\n\"endDeviceDeveuis\" : [],<br \/>\n\"fotaDescriptor\" : 0,<br \/>\n\"fotaFile\" : \"mbed-os.bin\",<br \/>\n\"keep_log\" : false,<br \/>\n\"launchTimeFromSetupTime\" : 60,<br \/>\n\"multicastDeveui\" : \"00-80-00-f5-d8-ec-69-a3\",<br \/>\n\"parity_fragments_per_session\" : 100,<br \/>\n\"psleep_time\" : 3000,<br \/>\n\"schedule_filename\" : \"fota_36753562_1749562419_0\",<br \/>\n\"schedule_source\" : \"Conduit\",<br \/>\n\"scheduledTimeSinceUnixEpoch\" : 1749562419,<br \/>\n\"setupTimeFromScheduledTime\" : 0,<br \/>\n\"sleep_time\" : 1500,<br \/>\n\"ssleep_time\" : 1000,<br \/>\n\"transmission_type\" : \"FOTA\"<br \/>\n}<br \/>\n]<br \/>\n},<br \/>\n\"status\" : \"success\"<br \/>\n}<br \/>\n<\/code><\/li>\n<li>\nCreating a cancel file will stop the fota process and clean up the temporary session and device of the multicast EUI.<br \/>\nThe log and progress files will be removed.<br \/>\n<code><br \/>\n$ cd \/var\/run\/.fota<br \/>\n$ sudo touch cancel_36753562<\/p>\n<p>admin@mtcdt-444555:\/var\/run\/.fota$ ps aux | grep fota<br \/>\nroot      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<br \/>\n<\/code><br \/>\nThe server will NOT send downlinks to the end-devices to cancel the multicast and fragmentation session though.\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>The <a title=\"Downloads\" href=\"https:\/\/www.multitech.net\/developer\/downloads\/\">Downloads<\/a> 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.<\/p>\n<h3>To install 0.0.9 on mPower 5.1.5 use the &#8211;force-downgrade option with opkg.<\/h3>\n<p><code><br \/>\n$ sudo \/etc\/init.d\/fotad stop<br \/>\n$ wget http:\/\/www.multitech.net\/downloads\/fotad_0.0.19-r11.0_arm926ejste.ipk<br \/>\n$ sudo opkg install --force-downgrade fotad_0.0.19-r11.0_arm926ejste.ipk<br \/>\n$ sudo \/etc\/init.d\/fotad start<br \/>\n<\/code><\/p>\n<h3>To install 1.0.10 on mPower 5.1.5<\/h3>\n<p><code><br \/>\n$ sudo \/etc\/init.d\/fotad stop<br \/>\n$ wget http:\/\/www.multitech.net\/downloads\/fotad_1.0.10-r11.0_arm926ejste.ipk<br \/>\n$ sudo opkg install --force-downgrade fotad_1.0.10-r11.0_arm926ejste.ipk<br \/>\n$ sudo \/etc\/init.d\/fotad start<br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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:\/\/&lt;SERVER-IP&gt;\/api\/command\/upload_lora_fota_file &#8212;&#8212;WebKitFormBoundaryfX3HU1aeZkuK5C0A Content-Disposition: form-data; name=&#8221;fotafile&#8221;; filename=&#8221;mbed-os.bin&#8221; Content-Type: application\/octet-stream &#8212;&#8212;WebKitFormBoundaryfX3HU1aeZkuK5C0A&#8211; Creates a schedule file using &#8220;schedule_file_name&#8221; field in \/var\/run\/.fota with the above JSON The operation scheduled time [&hellip;]<\/p>\n","protected":false},"author":1337,"featured_media":0,"parent":8462,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"class_list":["post-30434","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/30434","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/users\/1337"}],"replies":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/comments?post=30434"}],"version-history":[{"count":10,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/30434\/revisions"}],"predecessor-version":[{"id":33857,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/30434\/revisions\/33857"}],"up":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/8462"}],"wp:attachment":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/media?parent=30434"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}