Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    LoRaWAN FCnt size 16 or 32 bit?

    Scheduled Pinned Locked Moved LoPy
    lopy lorawan
    8 Posts 3 Posters 1.6k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • bmarkusB Offline
      bmarkus
      last edited by

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

      robert-hhR 1 Reply Last reply Reply Quote 0
      • robert-hhR Offline
        robert-hh @bmarkus
        last edited by

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

        bmarkusB 1 Reply Last reply Reply Quote 0
        • bmarkusB Offline
          bmarkus @robert-hh
          last edited by

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

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

          Which spec?

          robert-hhR 1 Reply Last reply Reply Quote 0
          • robert-hhR Offline
            robert-hh @bmarkus
            last edited by

            @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.

            B 1 Reply Last reply Reply Quote 0
            • B Offline
              bed @robert-hh
              last edited by

              @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.

              bmarkusB 1 Reply Last reply Reply Quote 1
              • bmarkusB Offline
                bmarkus @bed
                last edited by

                @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?

                B 1 Reply Last reply Reply Quote 0
                • B Offline
                  bed @bmarkus
                  last edited by

                  @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.

                  bmarkusB 1 Reply Last reply Reply Quote 1
                  • bmarkusB Offline
                    bmarkus @bed
                    last edited by

                    @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!

                    1 Reply Last reply Reply Quote 0

                    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                    With your input, this post could be even better 💗

                    Register Login
                    • 1 / 1
                    • First post
                      Last post

                    Pycom on Twitter

                    Pycom