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

    LoPy node sends join requests, and my nano gateway tries to forward it. But no sccessful join?

    Scheduled Pinned Locked Moved LoPy
    lopyjoinissues
    15 Posts 4 Posters 4.8k Views 5 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.
    • lollisoftL Offline
      lollisoft
      last edited by

      And which one would work with the nano gateway code from this repository?

      I am wondering, how examples are intended for - to show functioning stuff...

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

        @lollisoft
        Sorry for the confusion I meant the script I linked to is the correct one. If you use the one in the documentation it won't work with the nanogateway.

        1 Reply Last reply Reply Quote 0
        • lollisoftL Offline
          lollisoft
          last edited by

          That is the code I am using. I have changed the dev_eui, app_eui and app_key accordingly to those I have shown above.
          The gateway takes these packets and forwards them.

          Currently I have tested to send the udp packets (in the gateway) to my own server, just to see packets arriving (tcpdump). Otherwise, they go to router.eu.thethings.network.

          So the gateway continuously forward the join requests. And that's it.

          I have no idea how to dig deeper debugging the packets. I hoped someone can confirm, the config is valid at a whole.

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

            @lollisoft
            Well your join packet seems to be going out correctly, if you take your data

            APpHAPB+1bNw7BR/5wa66QD4jBJ0lPk=

            As decode it for example using https://runkit.io/avbentem/lorawan-packet-decoder/branches/master?data=APpHAPB%2B1bNw7BR%2F5wa66QD4jBJ0lPk%3D you get:

            Message Type = Join Request
                  AppEUI = 70B3D57EF00047FA
                  DevEUI = 00E9BA06E77F14EC
                DevNonce = 8CF8
                     MIC = 127494F9
            

            Which is correct.

            What you need is to check the incoming (Join Accept) response from Things Network.

            Maybe on the nanogateway script try adding some debugging (printing) the data received in send_down_link and decode it via the web interface above.

            1 Reply Last reply Reply Quote 0
            • lollisoftL Offline
              lollisoft
              last edited by

              Just one important question: Should the gateway get reported online after I start it up?

              I have the feeling that there is something wrong with the gateway. It just sends some data to the servers, but I do not see an online state change thereof.

              Is the gateway able to send it's own health messages (as a node of it's own)?

              J 2 Replies Last reply Reply Quote 0
              • J Offline
                jmarcelino @lollisoft
                last edited by jmarcelino

                This post is deleted!
                1 Reply Last reply Reply Quote 0
                • J Offline
                  jmarcelino @lollisoft
                  last edited by

                  @lollisoft

                  The online indicator in TTN has been frequently broken in the past weeks, but you can try the alternative methods listed at

                  https://www.thethingsnetwork.org/forum/t/known-issue-gateways-show-as-not-connected-in-the-console/6527

                  lollisoftL 1 Reply Last reply Reply Quote 0
                  • lollisoftL Offline
                    lollisoft @jmarcelino
                    last edited by

                    @jmarcelino The link mentioned in that post, reports the same error as one complains.

                    My link to check is http://noc.thethingsnetwork.org:8085/api/v2/gateways/eui-a282f287ef724724
                    As of my gateway id is mentioned above, the link here is just a repeat (and I tried).

                    I have my firewall as a suspect to make trouble. Also my DSL router needs to forward a packet. I have therefore setup an open port to 1700 using UDP and send that to the gateway address in the same network as the DSL router.

                    Are the ports (sending at 1700 and ansering back over 1700) correct?

                    I also would setup the UDP port to point to my firewall. That way I may have a chance to see a possible answer.

                    1 Reply Last reply Reply Quote 0
                    • lollisoftL Offline
                      lollisoft
                      last edited by

                      The packets are sent to my firewall and then I do see these. If the packets are send to ttn, I can't see them but I also did not get any acknowledge back on the udp port 1700.

                      I have no more ideas...

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

                        @lollisoft
                        What does your config.py on the nanogateway look like? (But remove the wifi keys)

                        1 Reply Last reply Reply Quote 0
                        • lollisoftL Offline
                          lollisoft
                          last edited by

                          Haha,

                          tried several times to setup the gateway. Wrong gateway id. Now the gateway got a Push Ack.

                          1 Reply Last reply Reply Quote 1
                          • Z Offline
                            zetxx @lollisoft
                            last edited by

                            @lollisoft https://www.youtube.com/watch?v=jL7hSx9qNjc

                            1 Reply Last reply Reply Quote 0
                            • B Offline
                              berni
                              last edited by

                              I know this is an old post, but I have similar issues and after some debugging this is what I found:

                              1. The nanogateway gets the join request from the node using OTAA and it forwards it to TTN.

                              2. TTN sees the join requests and replies back to the gateway:

                              0_1502281030657_upload-048f98c6-4102-4923-a308-a7e4133b21d8

                              1. Adding some debugging I can display the data received from TTN and sent to the node using the _send_down_link function:
                              def _send_down_link(self, data, tmst, datarate, frequency):
                                      self.lora.init(mode=LoRa.LORA, frequency=frequency, bandwidth=LoRa.BW_125KHZ,
                                                     sf=self._dr_to_sf(datarate), preamble=8, coding_rate=LoRa.CODING_4_5,
                                                     tx_iq=True)
                                      while time.ticks_us() < tmst:
                                          pass
                                      print(binascii.hexlify(data).upper())
                                      self.lora_sock.send(data)
                              
                              1. Decoding the returned data shows that TTN is accepting the node to join:
                                https://lorawan-packet-decoder-0ta6puiniaut.runkit.sh/?data=20B6330995FA5AD1601C019F596C711FE11FF096E1C4915F94F183BEA903746F23
                              Assuming hex-encoded packet
                              20B6330995FA5AD1601C019F596C711FE11FF096E1C4915F94F183BEA903746F23
                              
                              Message Type = Join Accept
                                  AppNonce = 0933B6
                                     NetID = 5AFA95
                                   DevAddr = 011C60D1
                                       MIC = 03746F23
                              
                              1. However, the node keeps trying and is unable to join or takes several attempts until it is successful.

                              I hope this helps solving this issue...

                              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