Create new End-node with special MAC settings via API

nnyland
Mon, 03 Feb 2025 13:12:13 +0000
The Things Stack v3

Hi,
I’d like to know if there is a way to set some specific MAC settings values when creating a new node on my application.

I’ve tried to follow the logic from this post: Register device The Things Stack v3 API
together with the docs: Network Server APIs | The Things Stack for LoRaWAN

but no success so far.
This is what is sent to the NS server when creating the node:

{
    "end_device": {
        "frequency_plan_id": "EU_863_870_TTN",
        "ids": {
            "dev_eui": "0080XXXXXXXXXXXX",
            "device_id": "new-node-test",
            "join_eui": "FAXXXXXXXXXXXXXX"
        },
        "lorawan_phy_version": "PHY_V1_0_3_REV_A",
        "lorawan_version": "MAC_V1_0_3",
        "mac_settings": {
            "rx1_delay": "RX_DELAY_1"
        },
        "supports_join": true
    },
    "field_mask": {
        "paths": [
            "supports_join",
            "lorawan_version",
            "ids.device_id",
            "ids.dev_eui",
            "ids.join_eui",
            "lorawan_phy_version",
            "frequency_plan_id",
            "mac_settings.rx1_delay"
        ]
    }
}

and this is what I get back:

{
    "created_at": "2025-02-03T12:52:36.534465003Z",
    "frequency_plan_id": "EU_863_870_TTN",
    "ids": {
        "application_ids": {
            "application_id": "test-app"
        },
        "dev_eui": "0080XXXXXXXXXXXX",
        "device_id": "new-node-test",
        "join_eui": "FAXXXXXXXXXXXXXX"
    },
    "lorawan_phy_version": "PHY_V1_0_3_REV_A",
    "lorawan_version": "MAC_V1_0_3",
    "mac_settings": {
        "rx1_delay": 1
    },
    "supports_join": true,
    "updated_at": "2025-02-03T12:52:36.534465003Z"
}

But when I look into the settings of the created device, I find the “Desired Rx1 delay” set to its default value 5s, instead of 1s.

Am I doing something wrong? How could I set the Desired Rx1 delay settings to 1 second, via API?

Many thanks in advance,
Nathan

4 posts - 3 participants