ABP node stopped working -> Fixed by creating new ABP.. Why? :)

I guess you mean LoRa packets. I’m sure other sources can explain better, but I’d say that in LoRaWAN the data part in each transmission is called the frame. So, each uplink and downlink holds such frame, and for each new transmission their frame counter needs to be incremented.

I think that’s exactly what is described in this topic? Just in case you did not read it, from the TTN documentation:

Frame Counters

Because we’re working with a radio protocol, anyone will be able to capture and store messages. It’s not possible to read these messages without the AppSKey, because they’re encrypted. Nor is it possible to tamper with them without the NwkSKey, because this will make the MIC check fail. It is however possible to re-transmit the messages. These so-called replay attacks can be detected and blocked using frame counters.

When a device is activated, these frame counters (FCntUp and FCntDown) are both set to 0. Every time the device transmits an uplink message, the FCntUp is incremented and every time the network sends a downlink message, the FCntDown is incremented. If either the device or the network receives a message with a frame counter that is lower than the last one, the message is ignored.

This security measure has consequences for development devices, which often are statically activated (ABP). When you do this, you should realize that these frame counters reset to 0 every time the device restarts (when you flash the firmware or when you unplug it). As a result, The Things Network will block all messages from the device until the FCntUp becomes higher than the previous FCntUp. Therefore, you should re-register your device in the backend every time you reset it.

As for just the counters, the last sentence can also be circumvented by resetting the counters in TTN Console. However, after a reset the device will probably have lost much more state (such as network settings, ADR state, pending confirmations, …), so re-registering ensures TTN and the device are fully in sync again.

Or to avoid any manual intervention, your ABP device needs to preserve its state between restarts. Or it should use OTAA for which after an OTAA Join both the device and TTN are in a known state. (And then the device should only do a new join a few times in its lifetime.)

2 Likes