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

    Lopy4 not retry join request every 15 secs

    Scheduled Pinned Locked Moved Issues & Bugs
    10 Posts 2 Posters 456 Views 2 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.
    • F Offline
      fernandes.son
      last edited by fernandes.son

      The documentation says that:
      Join a LoRaWAN network. Internally the stack will automatically retry every 15 seconds until a Join Accept message is received.

      Seeing in the NS, after the first request, the next one comes just 2 min later

      J 1 Reply Last reply Reply Quote 0
      • J Offline
        jcaron @fernandes.son
        last edited by

        @fernandes-son what region are you in? What channels are configured on the LoPy? What channels are configured in the gateway? What firmware version are you using?

        In most cases such issues are related to the LoPy sending the requests on channels the gateway is not listening on. Quite frequent in the US region which has lots of channels but where gateways only listen on a very small subset of them, for instance.

        F 1 Reply Last reply Reply Quote 0
        • F Offline
          fernandes.son
          last edited by

          Using AU915, Lopy4 release='1.20.1.r2', version='v1.11-06dfad0.

          for i in range(0, 72):
                  lora.remove_channel(i)
              lora.add_channel(index=0, frequency=915200000, dr_min=0, dr_max=5)
              lora.add_channel(index=1, frequency=915400000, dr_min=0, dr_max=5)
              lora.add_channel(index=2, frequency=915600000, dr_min=0, dr_max=5)
              lora.add_channel(index=3, frequency=915800000, dr_min=0, dr_max=5)
              lora.add_channel(index=4, frequency=916000000, dr_min=0, dr_max=5)
              lora.add_channel(index=5, frequency=916200000, dr_min=0, dr_max=5)
              lora.add_channel(index=6, frequency=916400000, dr_min=0, dr_max=5)
              lora.add_channel(index=7, frequency=916600000, dr_min=0, dr_max=5)
              lora.add_channel(index=64,frequency=915900000, dr_min=4, dr_max=4)
          

          WhatsApp Image 2020-03-09 at 14.50.30.jpeg

          1 Reply Last reply Reply Quote 0
          • F Offline
            fernandes.son @jcaron
            last edited by

            @jcaron What do you think?

            J 2 Replies Last reply Reply Quote 0
            • J Offline
              jcaron @fernandes.son
              last edited by

              @fernandes-son It looks like it matches, which invalidates my first theory, time to find another one :-/

              Do you have anything else you can use to monitor traffic actually send over the air?

              Also, do you have the logs of what the gateway sees (including channels, data rates...)?

              I'm wondering if there is any difference in the AU915 code compared to other regions, though I don't quite see why.

              1 Reply Last reply Reply Quote 0
              • J Offline
                jcaron @fernandes.son
                last edited by

                @fernandes-son It's been a long time since I looked into that, and I was under the impression that, at least in the EU868 region join requests were indeed repeated every 15 seconds, but the logic is actually a lot more complex than that (not sure if that changed recently or not), and it seems there is a 1% duty cycle limitation across the whole band for join requests during the first hour after power-on (it becomes much worse after that), see section 7 of the LoRaWAN spec.

                As the join request is supposed to be sent at SF12/BW125 (the slowest data rate), it probably takes over a second to send, which in turns means it has to wait 99 times that TX time (this is how the duty cycle limitation is enforced in the code), which brings us to over 100 seconds, which is probably what you are observing. It's supposed to also add a bit of randomness, I didn't check if/how that was done.

                So it's probably just the documentation which is not accurate (either because it changed or because the behaviour varies between regions).

                I have only skimmed through the code & specs so I may be wrong, though.

                F 1 Reply Last reply Reply Quote 1
                • F Offline
                  fernandes.son @jcaron
                  last edited by

                  @jcaron On AU915, duty cycle is not used

                  J 1 Reply Last reply Reply Quote 0
                  • J Offline
                    jcaron @fernandes.son
                    last edited by

                    @fernandes-son not in regular operation, no, but for join requests there is a mandatory 1% duty cycle (and even less past the first hour) which applies in all regions, per section 7 of the LoRaWAN spec (and not due to local regulations like duty cycles in other regions).

                    You’ll see this in the RegionCommon.c file.

                    Again, I may be wrong, but it does seem consistent. One would have to check when that changed.

                    F 1 Reply Last reply Reply Quote 0
                    • F Offline
                      fernandes.son @jcaron
                      last edited by

                      @jcaron I did a test with these other channels and had the same result :\

                          lora.add_channel(index=8, frequency=916800000, dr_min=0, dr_max=5)
                          lora.add_channel(index=9, frequency=917000000, dr_min=0, dr_max=5)
                          lora.add_channel(index=10,frequency=917200000, dr_min=0, dr_max=5)
                          lora.add_channel(index=11,frequency=917400000, dr_min=0, dr_max=5)
                          lora.add_channel(index=12,frequency=917600000, dr_min=0, dr_max=5)
                          lora.add_channel(index=13,frequency=917800000, dr_min=0, dr_max=5)
                          lora.add_channel(index=14,frequency=918000000, dr_min=0, dr_max=5)
                          lora.add_channel(index=15,frequency=919200000, dr_min=0, dr_max=5)
                          lora.add_channel(index=65,frequency=916400000, dr_min=4, dr_max=4)
                      
                      J 1 Reply Last reply Reply Quote 0
                      • J Offline
                        jcaron @fernandes.son
                        last edited by

                        @fernandes-son That would be consistent with what I believe the code does.

                        The AU915 region only sends join requests at SF12, which take a long time to send, and are thus affected by the specific duty cycle. Some other regions can use faster data rates which mitigates the issue, depending on what data rate is used first.

                        Is there a specific reason this is an issue for you? Normally a device just joins once and after that it doesn't need to do it again, so it shouldn't be a big issue.

                        You may try restricting data rates on the channels, but I wouldn't be surprised if the code actually enforced the DR0 rule for joins per the spec.

                        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