Developing a low power sensor node, I use an external timer IC to power on and off the entire rak3172 and attached sensors.
I use ABP and once the sensor data is sent, I do not need RX1 or RX2 and I shut down the power of the module via the external timer IC by sending a “done”-signal once the sendCallback is received, no matter if sending failed or was successful.
It seems that the module stays on the same frame counter value and doesn’t increment it after reset (or start at 0) which makes TTN reject the message, even if “resets frame counters” is selected in the TTN device settings. For example, it stays at frame counter “15”, which probably doesn’t count as a “frame counter reset” and is considered the same message and thus ignored by TTN.
Is there a way to increase the frame counter manually or does it perhaps need to complete rx1 and rx2 in order to increment the counter internally? Does anyone know under which conditions is it incremented, so that I can respect that in my code?
If I power the module continuously for debugging, the counter increases as expected.
We have no exposed way to configure the frame counters.
As for TTN, can you try to register again a device and immediately check Reset Frame Counters before the first send of ABP uplink?
When the device restarts, it should work fine. As you see here, I restart the device couple of times an change the port and the abp uplink is received as expected.
But: I was able to test more and it behaves likes this now:
When I kill the power right after TX-done, the frame counter does not increase
When I wait for RX1 to finish (I see it in current draw in my power analyzer) and then kill the power, the counter does not increase
When I wait for RX1 and RX2 to finish, the frame counter increases!
So I need to set the timer in a way to wait until RX1 and 2 are done and only after that kill the power. It seems that the modem internally only considers a frame done, when both RX windows have passed successfully.
This will work for me; the additional time spent in sleep is not necessary for my use case but doesn’t harm me too much either.
Just one next question; I tried to shorten the RX window delays via an api call but when I use the “get” to see what it is, RX1dl instead of 1000 is -998 and RX2dl is 2 instead of 2000.
Also looking at the current draw, the 5 seconds for rx1 delay are still present, so nothing has changed.