I have run into an issue in which confirmed downlinks are being acknowledged by the end device, but TTN keeps transmitting the downlink.
My end device is a Class A LoRaWAN v1.1.0 device on the Zephyr RTOS.
Example
I have a simple program that joins via OTAA and then uplinks the payload “hello” every minute. It prints downlink payloads to console, but does nothing more with them. It is derived from this sample, modified to save and correctly handle DevNonce
and to use LoRaWAN v1.1.0.
A couple of minutes after joining, I send the end device an unconfirmed downlink using the TTN Console with the payload 0x000000
. It receives the downlink and prints it to the console.
A few minutes later I schedule a confirmed downlink with the payload 0x010203
using the Console; I do this only once. The end device receives the payload, prints it to the screen, and sets the ACK
bit in the FCtrl
field in its next uplink to confirm that it received the downlink. So far this is exactly as expected.
However, TTN then continues to periodically send the same confirmed downlink message. It appears to be ignoring the ACK
bit sent by the end device.
The table below shows the contents of the traffic exchanged between the end device and TTN. In step 13, the server sends a confirmed downlink. In step 14, the end device sets the ACK
bit in its next uplink. However, the server continues to attempt to send the downlink (steps 16 and 19) as if it didn’t receive the ACK
response.
Step | Time [s] | Type | ACK | FCntUp | [A,N]FCntDown | FOpt | FRMPayload |
---|---|---|---|---|---|---|---|
1 | 000.000000 | join-request | |||||
2 | 001.805991 | join-accept | |||||
3 | 005.511201 | unconfirmed data up | 0 | 1 | 0b01 | 68656c6c6f | |
4 | 005.921428 | unconfirmed data down | 0 | 0 | 0b01033100ff01 | ||
5 | 070.772556 | unconfirmed data up | 0 | 2 | 0307 | 68656c6c6f | |
6 | 137.055912 | unconfirmed data up | 0 | 3 | 68656c6c6f | ||
7 | 203.330603 | unconfirmed data up | 0 | 4 | 68656c6c6f | ||
8 | 269.606463 | unconfirmed data up | 0 | 5 | 68656c6c6f | ||
9 | 270.013984 | unconfirmed data down | 0 | 1 | 000000 | ||
10 | 334.785355 | unconfirmed data up | 0 | 6 | 68656c6c6f | ||
11 | 401.056721 | unconfirmed data up | 0 | 7 | 68656c6c6f | ||
12 | 467.336085 | unconfirmed data up | 0 | 8 | 68656c6c6f | ||
13 | 467.745774 | confirmed data down | 0 | 2 | 010203 | ||
14 | 532.504250 | unconfirmed data up | 1 | 9 | 68656c6c6f | ||
15 | 598.787881 | unconfirmed data up | 0 | 10 | 68656c6c6f | ||
16 | 599.213361 | confirmed data down | 0 | 3 | 010203 | ||
17 | 663.947792 | unconfirmed data up | 1 | 11 | 68656c6c6f | ||
18 | 730.233779 | unconfirmed data up | 0 | 12 | 68656c6c6f | ||
19 | 730.654144 | confirmed data down | 0 | 4 | 010203 |
In this state (steps 14 onwards), the downlink queue for the device is empty as reported by the TTN CLI tool. The only way to stop the endless downlinking is to run this command:
ttn-lw-cli dev set $APP $DEV --unset mac-state.pending-application-downlink
It seems to me that the cause of this unexpected behavior is on the application or network server side of The Thing Stack v3 – the end device appears to be complying exactly with the LoRaWAN V1.1.0 specification. I’m at a loss for how to proceed with troubleshooting. Any tips, hints, or useful ideas?