{"id":31160,"date":"2020-09-25T08:40:48","date_gmt":"2020-09-25T13:40:48","guid":{"rendered":"http:\/\/www.multitech.net\/developer\/?page_id=31160"},"modified":"2025-09-09T14:12:09","modified_gmt":"2025-09-09T19:12:09","slug":"lorawan-device-provisioning","status":"publish","type":"page","link":"https:\/\/www.multitech.net\/developer\/software\/aep\/lora-configuration\/lorawan-device-provisioning\/","title":{"rendered":"LoRaWAN Device Provisioning"},"content":{"rendered":"<h2>LoRaWAN OTA Device Credentials<\/h2>\n<p>End-device EUI, Keys and profile settings can be imported in to the Conduit via CSV or JSON file upload or API calls. <\/p>\n<h3>mPower >= 6.3.6<\/h3>\n<p>GenAppKey has been added as an optional field to be used with Multicast setup.<\/p>\n<h4>JSON File Format<\/h4>\n<pre class=\"brush:text\">\r\n{\r\n\t\"devices\": [{\r\n\t\t\t\"appeui\": \"123aa31212312312\",\r\n\t\t\t\"appkey\": \"12312312123155551231231212312312\",\r\n\t\t\t\"genappkey\": \"12312312123155551231231212312312\",\r\n\t\t\t\"class\": \"A\",\r\n\t\t\t\"deveui\": \"123FF31212312312\",\r\n\t\t\t\"device_profile_id\": \"LW102-OTA-US915\",\r\n\t\t\t\"network_profile_id\": \"DEFAULT-CLASS-A\"\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"appeui\": \"123bb31212312312\",\r\n\t\t\t\"appkey\": \"12312312123188881231231212312312\",\r\n\t\t\t\"genappkey\": \"12312312123155551231231212312312\",\r\n\t\t\t\"class\": \"A\",\r\n\t\t\t\"deveui\": \"1231EE1212312311\",\r\n\t\t\t\"device_profile_id\": \"LW102-OTA-US915\",\r\n\t\t\t\"network_profile_id\": \"DEFAULT-CLASS-A\"\r\n\t\t}\r\n\t]\r\n}\r\n<\/pre>\n<h3>mPower >= 5.3.0 UI<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/www.multitech.net\/developer\/wp-content\/uploads\/2020\/09\/device-upload.png\" alt=\"Device Upload\" \/><\/p>\n<ol>\n<li>Navigate to LoRaWAN > Key Management<\/li>\n<li>Choose Local Keys from the drop down box for Join Server Location<\/li>\n<li>Click the upload link above the table<\/li>\n<li>Select a CSV or JSON formatted file containing the device credentials<\/li>\n<li>Click OK<\/li>\n<li>Click Save and Apply<\/li>\n<\/ol>\n<h4>JSON File Format<\/h4>\n<pre class=\"brush:text\">\r\n{\r\n\t\"devices\": [{\r\n\t\t\t\"appeui\": \"123aa31212312312\",\r\n\t\t\t\"appkey\": \"12312312123155551231231212312312\",\r\n\t\t\t\"class\": \"A\",\r\n\t\t\t\"deveui\": \"123FF31212312312\",\r\n\t\t\t\"device_profile_id\": \"LW102-OTA-US915\",\r\n\t\t\t\"network_profile_id\": \"DEFAULT-CLASS-A\"\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"appeui\": \"123bb31212312312\",\r\n\t\t\t\"appkey\": \"12312312123188881231231212312312\",\r\n\t\t\t\"class\": \"A\",\r\n\t\t\t\"deveui\": \"1231EE1212312311\",\r\n\t\t\t\"device_profile_id\": \"LW102-OTA-US915\",\r\n\t\t\t\"network_profile_id\": \"DEFAULT-CLASS-A\"\r\n\t\t}\r\n\t]\r\n}\r\n<\/pre>\n<h4>CSV File Format<\/h4>\n<pre class=\"brush:text\">\r\ndeveui, appeui,\tappkey,\tclass, device_profile_id, network_profile_id\t\t\r\n1111111111111111, 1231231299992312, 1231231212312312123FF31212312312, A, LW102-OTA-US915, DEFAULT-CLASS-A\r\n2222222222222222, 1235533212312312, 1231231212312312123FF31212312312, B, LW102-OTA-US915, DEFAULT-CLASS-B\r\n3333333333333333, 12355331231231e2, 123123121231232123FFe31212312312, C, LW102-OTA-US915, DEFAULT-CLASS-C\r\n<\/pre>\n<h3>API Method<\/h3>\n<ol>\n<li>Login to the API to get a token\n<pre class=\"brush:text\">\r\ncurl -k 'https:\/\/192.168.2.1\/api\/login?username=admin&password=admin'\r\n{\r\n   \"code\" : 200,\r\n   \"result\" : {\r\n      \"address\" : \"192.168.2.1\",\r\n      \"isipcuser\" : false,\r\n      \"isremoteuser\" : false,\r\n      \"permission\" : \"admin\",\r\n      \"port\" : \"41154\",\r\n      \"timestamp\" : \"13:47:6:752\",\r\n      \"token\" : \"361B68C6F85877384363E45416E36F78\",\r\n      \"user\" : \"admin\"\r\n   },\r\n   \"status\" : \"success\"\r\n}\r\n<\/pre>\n<\/li>\n<li>Use the token to upload the list of devices\n<pre class=\"brush:text\">\r\ncurl -k 'https:\/\/192.168.2.1\/api\/loraNetwork?token=361B68C6F85877384363E45416E36F78' -X PUT -d @whitelist.json -H \"Content-Type: application\/json\"\r\n<\/pre>\n<\/li>\n<li>Save and apply for mPower >= 5.2.1\n<pre class=\"brush:text\">\r\ncurl -k 'https:\/\/192.168.2.1\/api\/command\/save_apply?token=361B68C6F85877384363E45416E36F78' -X POST -d ''\r\n<\/pre>\n<p>or save and restart for mPower < 5.2.1\n\n\n<pre class=\"brush:text\">\r\ncurl -k &#8216;https:\/\/192.168.2.1\/api\/command\/save_restart?token=361B68C6F85877384363E45416E36F78&#8217; -X POST -d &#8221;\r\n<\/pre>\n<\/li>\n<\/ol>\n<h4>File Format<\/h4>\n<pre class=\"brush:text\">\r\n{\r\n\t\"whitelist\": {\r\n\t\t\"devices\": [{\r\n\t\t\t\t\"appeui\": \"1231231212312312\",\r\n\t\t\t\t\"appkey\": \"12312312123123121231231212312312\",\r\n\t\t\t\t\"class\": \"A\",\r\n\t\t\t\t\"deveui\": \"1231231212312312\",\r\n\t\t\t\t\"device_profile_id\": \"LW102-OTA-US915\",\r\n\t\t\t\t\"network_profile_id\": \"DEFAULT-CLASS-A\"\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\t\"appeui\": \"1231231212312312\",\r\n\t\t\t\t\"appkey\": \"12312312123123121231231212312312\",\r\n\t\t\t\t\"class\": \"A\",\r\n\t\t\t\t\"deveui\": \"1231231212312311\",\r\n\t\t\t\t\"device_profile_id\": \"LW102-OTA-US915\",\r\n\t\t\t\t\"network_profile_id\": \"DEFAULT-CLASS-A\"\r\n\t\t\t}\r\n\t\t],\r\n\t\t\"enabled\": true\r\n\t}\r\n}\r\n<\/pre>\n<h2>LoRaWAN ABP Device Credentials<\/h2>\n<ol>\n<li>Login to the API to get a token\n<pre class=\"brush:text\">\r\ncurl -k 'https:\/\/192.168.2.1\/api\/login?username=admin&password=admin'\r\n{\r\n   \"code\" : 200,\r\n   \"result\" : {\r\n      \"address\" : \"192.168.2.1\",\r\n      \"isipcuser\" : false,\r\n      \"isremoteuser\" : false,\r\n      \"permission\" : \"admin\",\r\n      \"port\" : \"41154\",\r\n      \"timestamp\" : \"13:47:6:752\",\r\n      \"token\" : \"361B68C6F85877384363E45416E36F78\",\r\n      \"user\" : \"admin\"\r\n   },\r\n   \"status\" : \"success\"\r\n}\r\n<\/pre>\n<\/li>\n<li>Use the token to upload the device information\n<pre class=\"brush:text\">\r\ncurl -k 'https:\/\/192.168.2.1\/api\/lora\/device?token=2F5159A7C16F7ACDDC2FDBC0DAA23F78' -X POST  --data '&lt;DEVICE-JSON&gt;' -H \"Content-Type: application\/json\"\r\n<\/pre>\n<p>Device JSON Format<\/p>\n<pre class=\"brush:text\">\r\n{\r\n\t\"deveui\": \"1231231212312312\",\r\n\t\"name\": \"Device-1\",\r\n\t\"device_profile_id\": 1,\r\n\t\"network_profile_id\": 1,\r\n\t\"serial_number\": \"123123\",\r\n\t\"product_id\": \"MDOT-915\",\r\n\t\"hardware_version\": \"1.0\",\r\n\t\"firmware_version\": \"4.0.0\"\r\n}\r\n<\/pre>\n<\/li>\n<li>Use the token to upload the session information\n<pre class=\"brush:text\">\r\ncurl -k 'https:\/\/192.168.2.1\/api\/lora\/session?token=2F5159A7C16F7ACDDC2FDBC0DAA23F78' -X POST  --data '&lt;SESSION-JSON&gt;' -H \"Content-Type: application\/json\"\r\n<\/pre>\n<p>Session JSON Format<\/p>\n<pre class=\"brush:text\">\r\n{\r\n\t\"deveui\": \"1231231212312312\",\r\n\t\"dev_addr\": \"12312312\",\r\n\t\"joineui\": \"1111111111111111\",\r\n\t\"appeui\": \"1111111111111111\",\r\n\t\"net_id\": \"000000\",\r\n\t\"app_senc_key\": \"11111111111111111111111111111111\",\r\n\t\"fnwk_sint_key\": \"11111111111111111111111111111111\"\r\n}\r\n<\/pre>\n<\/li>\n<li>Repeat POSTs to device and session API for all devices<\/li>\n<li>Save and apply for mPower >= 5.2.1\n<pre class=\"brush:text\">\r\ncurl -k 'https:\/\/192.168.2.1\/api\/command\/save_apply?token=2F5159A7C16F7ACDDC2FDBC0DAA23F78' -X POST -d ''\r\n<\/pre>\n<p>or save and restart for mPower < 5.2.1\n\n\n<pre class=\"brush:text\">\r\ncurl -k &#8216;https:\/\/192.168.2.1\/api\/command\/save_restart?token=2F5159A7C16F7ACDDC2FDBC0DAA23F78&#8217; -X POST -d &#8221;\r\n<\/pre>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>LoRaWAN OTA Device Credentials End-device EUI, Keys and profile settings can be imported in to the Conduit via CSV or JSON file upload or API calls. mPower >= 6.3.6 GenAppKey has been added as an optional field to be used with Multicast setup. JSON File Format { &#8220;devices&#8221;: [{ &#8220;appeui&#8221;: &#8220;123aa31212312312&#8221;, &#8220;appkey&#8221;: &#8220;12312312123155551231231212312312&#8221;, &#8220;genappkey&#8221;: &#8220;12312312123155551231231212312312&#8221;, [&hellip;]<\/p>\n","protected":false},"author":1337,"featured_media":0,"parent":8556,"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-31160","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/31160","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=31160"}],"version-history":[{"count":14,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/31160\/revisions"}],"predecessor-version":[{"id":33940,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/31160\/revisions\/33940"}],"up":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/8556"}],"wp:attachment":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/media?parent=31160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}