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

    Failed to connect to gateway - fault finding steps?

    Scheduled Pinned Locked Moved LoPy
    lopyttnloralorawan
    7 Posts 3 Posters 2.1k 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.
    • philwilkinsonP Offline
      philwilkinson
      last edited by

      I have a LoPy 1.0 and have, by using Atom 1.21.1 running PyMakr 1.5.1, obtained the LoPy's EUI.
      I have set up my LoPy as a device on TheThingsNetwork and obtained the Application Key.

      At this point, I have then attempted to connect to a local gateway using OTAA.
      using the sample code provided . I have changed EUI and application key to my values.

      The Python code runs fine on the LoPy but the device fails to connect to a local gateway (which I know is in range, and resitered on TTN). I get no errors returned, just simply the LoPy fails to connect.

      Can anyone recommend a prioritised list of things to check to fault find this issue?

      1 Reply Last reply Reply Quote 0
      • J Offline
        jmarcelino
        last edited by jmarcelino

        @philwilkinson
        I see you’re in Australia, do you know which frequencies your gateway is configured to?

        You’ll probably need to remove the frequencies configured by default on the LoPy and use LoRa.add_channel to set the ones you actually use.

        1 Reply Last reply Reply Quote 0
        • philwilkinsonP Offline
          philwilkinson
          last edited by

          Thanks for responding @jmarcelino. I am not sure of how to confirm the gateway's frequencies but I have just contacted the closest gateway owner directly to confirm.
          In any case, in addition to the standard US out of the box frequencies, I have tried to run some code suggested to reconfigure the frequencies for Australian networks however this still does not allow me to connect to a local gateway.
          I think you may have helped Leo in Adelaide, Australia tackle the same issue before! Please can you have a quick review of his published Python code and see if you think it is suitable.

          J 1 Reply Last reply Reply Quote 0
          • J Offline
            jmarcelino @philwilkinson
            last edited by jmarcelino

            @philwilkinson
            Ok, it'd be good to get confirmation from the gateway owner. Unfortunately the AU915 plan is still a bit new and not all gateways support it so some owners still use the American US915.

            To add to confusion - as in the US - almost all gateways only support listening on 8 channels out of the possible 72.

            Can you try a simplified version of his code:

            lora = LoRa(mode=LoRa.LORAWAN)
            
            # Remove default channels
            for index in range(0, 72):
                lora.remove_channel(index)
            
            
            # Set  simplified AU ISM 915 channel plan for TTN Australia
            for index in range(0, 7):
                lora.add_channel(index, frequency=916800000+index*200000, dr_min=0, dr_max=3)
            
            
            #Join TTN Network via OTAA
            lora.join(activation=LoRa.OTAA, auth=(app_eui, app_key), timeout=0)
            

            of course adding your keys before this code and the while not lora.has_joined() after it.

            With this code running check the TTN console under your application data to see if you get any activation requests.

            philwilkinsonP 1 Reply Last reply Reply Quote 0
            • philwilkinsonP Offline
              philwilkinson
              last edited by

              @jmarcelino said in Failed to connect to gateway - fault finding steps?:

              Set simplified AU ISM 915 channel plan for TTN Australia

              for index in range(0, 7):
              lora.add_channel(index, frequency=916800000+index*200000, dr_min=0, dr_max=3)

              Thanks for the advice Jose however this still made no contact with the gateway. I contacted the gateway owner and they confirmed the channels were as per TTN requirements AU915 ttn channels (8-15).

              I will try a few more locations that I know have (different) gateway access and see if that resolves anything.

              I can start to see why so many people on this forum have purchased single channel gateways! At least you can get them to communicate!
              I will keep you up to date with any developments,
              thanks again

              J 1 Reply Last reply Reply Quote 0
              • J Offline
                jcaron @philwilkinson
                last edited by

                @philwilkinson How far away are you from the gateway? Are you (and the gateway) indoors or outdoors? What kind of antenna are you using?

                I have seen situations where a node next to an open window would be seen by several gateways several kilometres away, but just closing the window would make communication impossible. And the same node would not be seen by another gateway in the same building.

                1 Reply Last reply Reply Quote 0
                • philwilkinsonP Offline
                  philwilkinson @jmarcelino
                  last edited by

                  OK I managed to spend a little time this weekend tackling the LORA issue @jmarcelino .
                  After a bit of travel and lots of outdoor testing I can confirm the issue was gateway related...!
                  The code you recommended worked fine.
                  As @jcaron mentioned, if the gateway is indoors you have to be really, really close to get a connection.
                  As I can't get a connection near my home, I need to either persuade the local gateways to put up an external antenna, or go and buy myself a gateway!!
                  Many thanks @jmarcelino and @jcaron for your advice.

                  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