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



  • Hi,

    I am now at a point in wich my node tries to join over my nano gateway. I see the LoRa packets within the event handler after adding some debug code:

    LoRa callback triggered
    RX_PACKET_EVENT
    (timestamp=764007723, rssi=-41, snr=29, sf=7)
    b'APpHAPB+1bNw7BR/5wa66QD4jBJ0lPk='
    Try send to router.eu.thethings.network

    But I keep in the not joined state, as the while not lora.is_joined() ever returns false.

    What is a possible cause for that?

    Why is my gateway not shown as connected before I even activate a node?

    I cannot check, if the gateway has an issue or the node.

    What parts of the configuration is relevant for the gateway, what for the node and what for the join and what after a join?

    I have double checked the OTAA parameters that have been created for my application.

    I have the following:

    A gateway (configured as packet forwarder) with this gateway id: eui-a282f287ef724724
    I do not yet have grabbed the gateway key, as of in the video 4 (Alex's Corner - Week 3 - LoRaWAN Nano-Gateway & TTN), he does not seem to use them.

    Then I have the following application:

    Application ID: eddd609f4b874817
    Handler: ttn-handler-eu
    One eui: 70B3D57EF00047FA
    Me as a collaborator

    Access keys (I have created a guid): deleted by moderator

    As device I do have the following settings:
    Application ID: eddd609f4b874817
    Device ID: eui-a282f287ef724724
    Activation method OTAA
    Device EUI: 00E9BA06E77F14EC
    Application EUI: 70B3D57EF00047FA
    App Key: Of course I have double checked this value. Hidden by purpose :-)

    The following values are unused in my node code:

    Device Address: 2601271D - not yet used
    Network Session Key: Hidden - not yet used
    App Session Key: Hidden - not yet used

    The Status shows some minutes and green.



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





  • Haha,

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



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



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



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



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



  • This post is deleted!


  • 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)?



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



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



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



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



  • @lollisoft
    Just checking but are you using the OTAA node code from

    https://github.com/pycom/pycom-libraries/blob/master/examples/lorawan-nano-gateway/otaa_node.py

    The nanogateway won't work with the generic OTAA script.


Log in to reply
 

Pycom on Twitter