LoRaWAN FCnt size 16 or 32 bit?



  • What is the length of the LoRaWAN frame counters (FCnt), is it 16 or 32 bits?



  • @bed said in LoRaWAN FCnt size 16 or 32 bit?:

    @bmarkus The PyCom LoraWAN stack uses 32 bits for the uplink and downlink frame counters, even though only the bottom 16 bits are transmitted / received.

    Thanks!



  • @bmarkus The PyCom LoraWAN stack uses 32 bits for the uplink and downlink frame counters, even though only the bottom 16 bits are transmitted / received.



  • @bed said in LoRaWAN FCnt size 16 or 32 bit?:

    @robert-hh @bmarkus

    In the LoRaWAN specs (1.0.1 - 1.1) in section 4.3.1.5 the Frame counters says that it ALLOWS for the counters to be either 16-bits or 32-bits. But, importantly, if they are 32, still only the least significant 16 bits are transmitted, and the server must 'infer' the 16 most sig bits.

    So if the server is expecting 32 bits, and you send a lower frame count (16 bits), it COULD decide that the end device has wrapped. It would be interesting to see how the server code handles it. It may be a good option to do another OTAA join when your frame counter gets high so that they reset.

    I know what is in the LoRaWAAN Specification. My question is, on Pycom LoRaWAN stack 16-bit or 32-bit counters implemented?



  • @robert-hh @bmarkus

    In the LoRaWAN specs (1.0.1 - 1.1) in section 4.3.1.5 the Frame counters says that it ALLOWS for the counters to be either 16-bits or 32-bits. But, importantly, if they are 32, still only the least significant 16 bits are transmitted, and the server must 'infer' the 16 most sig bits.

    So if the server is expecting 32 bits, and you send a lower frame count (16 bits), it COULD decide that the end device has wrapped. It would be interesting to see how the server code handles it. It may be a good option to do another OTAA join when your frame counter gets high so that they reset.



  • @bmarkus Sorry, the LoRa spec about the message format says 16 bits, but I recall during my scanning through the sources, that the counter field has 32 bits. That was at the time when I searched for the reason why the nano-gateway code did not work. Counters wasn't it. Practically, during my tests, it did not make a difference. But I may never have exceeded the 16 bit range.



  • @robert-hh said in LoRaWAN FCnt size 16 or 32 bit?:

    @bmarkus Accoring to the spec it's 32 bits.

    Which spec?



  • @bmarkus Accoring to the spec it's 32 bits.


Log in to reply
 

Pycom on Twitter