LoRaWAN Device Provisioning
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 >= 5.3.0 UI
- Navigate to LoRaWAN > Key Management
- Choose Local Keys from the drop down box for Join Server Location
- Click the upload link above the table
- Select a CSV or JSON formatted file containing the device credentials
- Click OK
- Click Save and Apply
JSON File Format
{ "devices": [{ "appeui": "123aa31212312312", "appkey": "12312312123155551231231212312312", "class": "A", "deveui": "123FF31212312312", "device_profile_id": "LW102-OTA-US915", "network_profile_id": "DEFAULT-CLASS-A" }, { "appeui": "123bb31212312312", "appkey": "12312312123188881231231212312312", "class": "A", "deveui": "1231EE1212312311", "device_profile_id": "LW102-OTA-US915", "network_profile_id": "DEFAULT-CLASS-A" } ] }
CSV File Format
deveui, appeui, appkey, class, device_profile_id, network_profile_id 1111111111111111, 1231231299992312, 1231231212312312123FF31212312312, A, LW102-OTA-US915, DEFAULT-CLASS-A 2222222222222222, 1235533212312312, 1231231212312312123FF31212312312, B, LW102-OTA-US915, DEFAULT-CLASS-B 3333333333333333, 12355331231231e2, 123123121231232123FFe31212312312, C, LW102-OTA-US915, DEFAULT-CLASS-C
API Method
- Login to the API to get a token
curl -k 'https://192.168.2.1/api/login?username=admin&password=admin' { "code" : 200, "result" : { "address" : "192.168.2.1", "isipcuser" : false, "isremoteuser" : false, "permission" : "admin", "port" : "41154", "timestamp" : "13:47:6:752", "token" : "361B68C6F85877384363E45416E36F78", "user" : "admin" }, "status" : "success" }
- Use the token to upload the list of devices
curl -k 'https://192.168.2.1/api/loraNetwork?token=361B68C6F85877384363E45416E36F78' -X PUT -d @whitelist.json -H "Content-Type: application/json"
- Save and apply for mPower >= 5.2.1
curl -k 'https://192.168.2.1/api/command/save_apply?token=361B68C6F85877384363E45416E36F78' -X POST -d ''
or save and restart for mPower < 5.2.1
curl -k ‘https://192.168.2.1/api/command/save_restart?token=361B68C6F85877384363E45416E36F78’ -X POST -d ”
File Format
{ "whitelist": { "devices": [{ "appeui": "1231231212312312", "appkey": "12312312123123121231231212312312", "class": "A", "deveui": "1231231212312312", "device_profile_id": "LW102-OTA-US915", "network_profile_id": "DEFAULT-CLASS-A" }, { "appeui": "1231231212312312", "appkey": "12312312123123121231231212312312", "class": "A", "deveui": "1231231212312311", "device_profile_id": "LW102-OTA-US915", "network_profile_id": "DEFAULT-CLASS-A" } ], "enabled": true } }
LoRaWAN ABP Device Credentials
- Login to the API to get a token
curl -k 'https://192.168.2.1/api/login?username=admin&password=admin' { "code" : 200, "result" : { "address" : "192.168.2.1", "isipcuser" : false, "isremoteuser" : false, "permission" : "admin", "port" : "41154", "timestamp" : "13:47:6:752", "token" : "361B68C6F85877384363E45416E36F78", "user" : "admin" }, "status" : "success" }
- Use the token to upload the device information
curl -k 'https://192.168.2.1/api/lora/device?token=2F5159A7C16F7ACDDC2FDBC0DAA23F78' -X POST --data '<DEVICE-JSON>' -H "Content-Type: application/json"
Device JSON Format
{ "deveui": "1231231212312312", "name": "Device-1", "device_profile_id": 1, "network_profile_id": 1, "serial_number": "123123", "product_id": "MDOT-915", "hardware_version": "1.0", "firmware_version": "4.0.0" }
- Use the token to upload the session information
curl -k 'https://192.168.2.1/api/lora/session?token=2F5159A7C16F7ACDDC2FDBC0DAA23F78' -X POST --data '<SESSION-JSON>' -H "Content-Type: application/json"
Session JSON Format
{ "deveui": "1231231212312312", "dev_addr": "12312312", "joineui": "1111111111111111", "appeui": "1111111111111111", "net_id": "000000", "app_senc_key": "11111111111111111111111111111111", "fnwk_sint_key": "11111111111111111111111111111111" }
- Repeat POSTs to device and session API for all devices
- Save and apply for mPower >= 5.2.1
curl -k 'https://192.168.2.1/api/command/save_apply?token=2F5159A7C16F7ACDDC2FDBC0DAA23F78' -X POST -d ''
or save and restart for mPower < 5.2.1
curl -k ‘https://192.168.2.1/api/command/save_restart?token=2F5159A7C16F7ACDDC2FDBC0DAA23F78’ -X POST -d ”