I am integrating the TTN v3 API in my application, Though i am seeing many issues.
-
When I register a device in the Au1 cluster then it’s creating a device with the Activation method ABP, while I want to use the OTAA method. and there is no way to update the activation method later through API nor console.
-
As per another topic I got to know that we need to call 4 APIs to register a device in a cluster, I’ve followed the same, but I am seeing “Duplicate identifier” error, in my account this is the first device that i am trying to register. So not sure why i am seeing this error. Please correct me if i am doing anything wrong in the below API calls.
Identity Server API Call: POST
https://eu1.cloud.thethings.network/api/v3/applications/radiobridge-app-aus1/devices
Request JSON:
{
"end_device": {
"ids": {
"device_id": "au1-4491600000f7c5b9",
"dev_eui": "4491600000F7C5B9",
"join_eui": "0101010101010101"
},
"join_server_address": "au1.cloud.thethings.network",
"network_server_address": "au1.cloud.thethings.network",
"application_server_address": "au1.cloud.thethings.network",
"name": "Door Window Sensor"
},
"field_mask": {
"paths": [
"join_server_address",
"network_server_address",
"application_server_address",
"ids.dev_eui",
"ids.join_eui",
"name"
]
}
}
Response:
{
"ids": {
"device_id": "au1-4491600000f7c5b9",
"application_ids": {
"application_id": "radiobridge-app-aus1"
},
"dev_eui": "4491600000F7C5B9",
"join_eui": "0101010101010101"
},
"created_at": "2021-06-30T18:09:30.248Z",
"updated_at": "2021-06-30T18:09:30.248Z",
"name": "Door Window Sensor",
"version_ids": {},
"network_server_address": "au1.cloud.thethings.network",
"application_server_address": "au1.cloud.thethings.network",
"join_server_address": "au1.cloud.thethings.network"
}
Network Server API Call: POST
https://au1.cloud.thethings.network/api/v3/ns/applications/radiobridge-app-aus1/devices
Request:
{
"end_device": {
"multicast": false,
"supports_join": true,
"lorawan_version": "MAC_V1_0_2",
"ids": {
"device_id": "au1-4491600000f7c5b9",
"dev_eui": "4491600000F7C5B9",
"join_eui": "0101010101010101"
},
"mac_settings": {
"supports_32_bit_f_cnt": true
},
"supports_class_c": false,
"supports_class_b": false,
"lorawan_phy_version": "PHY_V1_0_2_REV_A",
"frequency_plan_id": "AU_915_928_FSB_2"
},
"field_mask": {
"paths": [
"multicast",
"supports_join",
"lorawan_version",
"ids.device_id",
"ids.dev_eui",
"ids.join_eui",
"mac_settings.supports_32_bit_f_cnt",
"supports_class_c",
"supports_class_b",
"lorawan_phy_version",
"frequency_plan_id"
]
}
}
Response:
{
"code": 6,
"message": "error:pkg/networkserver/redis:duplicate_identifiers (duplicate identifiers)",
"details": [
{
"@type": "type.googleapis.com/ttn.lorawan.v3.ErrorDetails",
"namespace": "pkg/networkserver/redis",
"name": "duplicate_identifiers",
"message_format": "duplicate identifiers",
"correlation_id": "7ea7a6461d3f4eddaf7ffe33057ed833",
"code": 6
}
]
}
Application Server API Call: POST
https://au1.cloud.thethings.network/api/v3/as/applications/radiobridge-app-aus1/devices
Request:
{
"end_device": {
"ids": {
"device_id": "au1-4491600000f7c5b9",
"dev_eui": "4491600000F7C5B9",
"join_eui": "0101010101010101"
}
},
"field_mask": {
"paths": [
"ids.device_id",
"ids.dev_eui",
"ids.join_eui"
]
}
}
Response:
{
"code": 6,
"message": "error:pkg/applicationserver/redis:duplicate_identifiers (duplicate identifiers)",
"details": [
{
"@type": "type.googleapis.com/ttn.lorawan.v3.ErrorDetails",
"namespace": "pkg/applicationserver/redis",
"name": "duplicate_identifiers",
"message_format": "duplicate identifiers",
"correlation_id": "e515b4b170de434489d054455e32790e",
"code": 6
}
]
}
Join Server API call: POST
https://eu1.cloud.thethings.network/api/v3/js/applications/radiobridge-app-aus1/devices
Request:
{
"end_device": {
"ids": {
"device_id": "au1-4491600000f7c5b9",
"dev_eui": "4491600000F7C5B9",
"join_eui": "0101010101010101"
},
"network_server_address": "au1.cloud.thethings.network",
"application_server_address": "au1.cloud.thethings.network",
"network_server_kek_label": "",
"application_server_kek_label": "",
"application_server_id": "",
"net_id": null,
"root_keys": {
"app_key": {
"key": "1F7FA60649841A4095164139B3B1D5AF"
}
}
},
"field_mask": {
"paths": [
"network_server_address",
"application_server_address",
"ids.device_id",
"ids.dev_eui",
"ids.join_eui",
"network_server_kek_label",
"application_server_kek_label",
"application_server_id",
"net_id",
"root_keys.app_key.key"
]
}
}
Response:
{
"code": 6,
"message": "error:pkg/joinserver/redis:duplicate_identifiers (duplicate identifiers)",
"details": [
{
"@type": "type.googleapis.com/ttn.lorawan.v3.ErrorDetails",
"namespace": "pkg/joinserver/redis",
"name": "duplicate_identifiers",
"message_format": "duplicate identifiers",
"correlation_id": "5aa904b5afba4d90b70b449b77c68412",
"code": 6
}
]
}
Note: To resolve this problem, I tried to delete the devices from AS, NS, and JS servers, but that returns device not found error, which means the device is not registered on these servers, so not sure why I am seeing this error.
Also, I am calling these APIs in the following sequence:
Identity server, Join Server, Network server, Application Server
Can anybody please help me? I am trying to solve this from 2 Days but no luck.
If I try to register this same device in the EU and North America Cluster then that seems to be fine. I would like to know what I am missing or what’s wrong happening.