TheThingsArchive / ttn

The Things Network Stack V2
https://www.thethingsnetwork.org
MIT License
461 stars 277 forks source link

Gateway does not forward packets to the application after manually setting the device address #733

Closed FlorianCodes closed 6 years ago

FlorianCodes commented 6 years ago

Using the HTTP Application Manager API, we can create a device with arbitrary device address, e.g. "DE AD BE EF". The device is correctly registered in the application. The gateway receives packets from the device with the specified ID, but the packets are not forwarded to the application. Changing the first two bytes of the address to "26 01" did not solve this issue.

Again using the HTTP Application Manager API, we can create a device without a device address, i.e. the parameter "dev_addr" is completely missing in the request. Again, the device is correctly registered in the application, but the device address is not generated automatically and it is not possible to set it after registering.

This is the request sent to the application using the Application Manager API with Insomnia:


{
    "app_id": "fw-test",
    "dev_id": "abcdefghijkl",
    "lorawan_device": {
        "app_eui": "70B3D57ED000A7FF",
        "app_id": "fw-test",
        "dev_addr": "DEADBEEF",
        "dev_eui": "B76C00FC74F78B20",
        "dev_id": "abcdefghijkl",
        "app_s_key": "01020304050607080102030405060708",
        "nwk_s_key": "01020304050607080102030405060708",
        "activation_constraints": "abp"
    }
}
htdvisser commented 6 years ago

Can you try with a DevAddr from the "testing" range 00000000-03FFFFFF?

FlorianCodes commented 6 years ago

Using a device address from the testing range (01234567) does work as expected, i.e. the application receives the packages sent by the device.

htdvisser commented 6 years ago

Great. Testing addresses can be assigned freely by the developer. Network addresses (starting with 26 or 27) need to be assigned by the network.

FlorianCodes commented 6 years ago

Thank you.