I am experiencing the same error -
End Devices are working fine when created through the console directly.
The error occurs when creating the end devices using either the CLI and or the API. I’m currently working on automating bulk enrollment of devices (100+). Although I am testing the process with only a single device.
When using the API, I am posting the following to /api/v3/applications/{my_app_id}/devices endpoint and I get status 200. I am also posting the same to the endpoints for the JS, NS and AS Reg.s - also status 200.
{
"end_device": {
"ids": {
"device_id": "lt-100e-1062375d",
"application_ids": {
"application_id": "globalsat100"
},
"dev_eui": "000DB5351062375D",
"join_eui": "70B3D57ED00200A7"
},
"name": "LT-100E-1062375D",
"description": "LT-100E-1062375Dadded using TTN Enroller",
"network_server_address": "eu1.cloud.thethings.network",
"application_server_address": "eu1.cloud.thethings.network",
"join_server_address": "eu1.cloud.thethings.network",
"root_keys": {
"app_key": {
"key": "78FA7A693AC10421E3C267E6F93572A0"
}
}
}
}
When viewed in web console’s end device list, they are displayed properly, but when trying to view the specific end device I get the error.
The same happens when I try creating the device using the TTN CLI integrated into my own CLI - status 200, device returned, showing in TTN console, but error when trying to access its page.
Code snippet from own CLI that uses:
ttn-lw-cli end-devices create [application-id] [device-id] [flags]
foreach (var endDevice in endDevices)
{
process.StartInfo.Arguments = $"/C ttn-lw-cli end-devices " +
$"create {endDevice.ids.application_ids.application_id} {endDevice.ids.device_id} " +
$"--dev-eui {endDevice.ids.dev_eui} " +
$"--join-eui {endDevice.ids.join_eui} ";
process.Start();
string output = process.StandardOutput.ReadToEnd();
process.WaitForExit();
Console.WriteLine(output);
}
I am clearly missing something since I get status 200 on creation but error on web console - although I cannot solve this one…
If anyone here can pin-point my mistake or point me in a better direction for csv bulk enrollment of 100+ devices then thanks in advance!
Sincerely,