Error:pkg/networkserver:field_value (invalid value of field `session.dev_addr`)

Hello,

I am trying to register an end device with the API. Therefor I send a PUT request to
https://XXX:8885/api/v3/ns/applications/XXX/devices/026000aa-23720-7?
While 026000aa-23720-7 is my self-chosen deviceId.

I send this as BODY

{
    "end_device": {
        "lorawan_version": "MAC_V1_0_2",
        "ids": {
            "device_id": "026000aa-23720-7",
            "application_ids": {
                "application_id": "XXX"
            },
            "dev_eui": "F80DF10000000504"
        },
        "lorawan_phy_version": "PHY_V1_0_2_REV_A",
        "frequency_plan_id": "EU_863_870_TTN",
        "supports_join": false,
        "session": {
            "dev_addr": "026000AA",
            "keys": {
                "f_nwk_s_int_key": {
                    "key": "F80DF10000005616F80DF10000005616"
                }
            }
        }
    },
    "field_mask": {
        "paths": [
            "supports_join",
            "lorawan_version",
            "lorawan_phy_version",
            "frequency_plan_id"
        ]
    }
}

The device is fictional.
As RESPONSE I get this:

{
    "code": 3,
    "message": "error:pkg/networkserver:field_value (invalid value of field `session.dev_addr`)",
    "details": [
        {
            "@type": "type.googleapis.com/ttn.lorawan.v3.ErrorDetails",
            "namespace": "pkg/networkserver",
            "name": "field_value",
            "message_format": "invalid value of field `{field}`",
            "attributes": {
                "field": "session.dev_addr"
            },
            "correlation_id": "dbf98c7e0da74df3aa1ca66afc1c7a2e",
            "code": 3
        }
    ]
}

What am I doing wrong? I think it’s a valid DevAddr.

Ah, with DevAddr 260000AA it works, so it means TTN doesn’t allow DevAddr that don’t match their own prefix

What about the limitations to the NwkSKey?
With the well-prefixed DevAddr I now get

{
    "code": 3,
    "message": "error:pkg/networkserver:field_value (invalid value of field `session.keys.f_nwk_s_int_key.key`)",
    "details": [
        {
            "@type": "type.googleapis.com/ttn.lorawan.v3.ErrorDetails",
            "namespace": "pkg/networkserver",
            "name": "field_value",
            "message_format": "invalid value of field `{field}`",
            "attributes": {
                "field": "session.keys.f_nwk_s_int_key.key"
            },
            "correlation_id": "daebac8c26f04e22a08cc20db3ed546d",
            "code": 3
        }
    ]
}

Are there any limitations? Cannot find information about that in the docs.

Nobody?

TTN/TTI support their own dev address range - 25/26xxx :thinking: or Is that 26/27xxx…need to check docs, as well as supporting the ‘experimental’ dev address range starting 00/01xxx. Others may get supported if specifically arranged and allowed by PacketBroker or private roaming agreements. Given the limited number of possible dev addrs which may then get allocated across the network an individual device is identified by the combination of dev addr and it’s dev-eui.

What you are trying is rather esoteric - why would anyone try and transfer an un-routable session over?

As with many topics, the WHY or context helps considerably!

I thought using ABP one could add a device and configure its network session key on TTN.
That way you don’t have to use the OTAA and JOIN procedure.

You can

You can. But as you’ve only told us that you got an error message but we don’t know what you tried, it’s hard to comment. Try generating a key via the console to see if that works when you use it.