Create new End-node with special MAC settings via API

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

Check out here>

https://www.thethingsindustries.com/docs/hardware/devices/configuring-devices/mac-settings/

I suspect TTN V3 network side insists on initial value of 5 seconds, requested changes happen only as part of join/rejoin process - ie you can request a desired change.

" The Things Stack configures the Rx1Delay to 5 seconds by default to accommodate for high latency backhauls and/or peering with Packet Broker, so this is the recommended configuration"

Perhaps this overrides values on creation - have you tried creating via the admin page and import a json file to see if the same things happens?

Hi jezd,

your answer gave me an idea, which at the end helped me finding the issue.
I’ve tried the export tool from TTS to export my own end-node created manually,
to verify how the output JSON looks like.

From that, I noticed that not only the “rx1_delay” must be defined, but also the “desired_rx1_delay”. By adding it to the request, I was able to create the node via REST API with this setting set to any other value than the default one.

Best Regards,
Nathan

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.