OTAA join failed



  • Hi,

    I have an error in joing the OTAA. I am able to send the join request to the network server. The message at network server also shows as join accepted. It never joins and always be in loop of Not joined yet. Here is my code below. Anyone please tell how to solve this problem.
    Im using the version as below os.uname()
    (sysname='LoPy4', nodename='LoPy4', release='1.18.2.r1', version='v1.8.6-849-e0fb68e on 2018-11-26', machine='LoPy4 with ESP32', lorawan='1.0.2', sigfox='1.0.1').

    Screenshot from 2019-07-20 11-01-00.png

    import binascii
    import pycom
    import socket
    import time
    from network import LoRa
    
    
    
    off =0x000000
    red = 0xff0000
    green = 0x00ff00
    blue = 0x0000ff
    pycom.heartbeat(False)
    
    lora = LoRa(mode=LoRa.LORAWAN, region=LoRa.EU868, adr=False,tx_retries = 0, device_class=LoRa.CLASS_A)
    print(binascii.hexlify(lora.mac()).upper().decode('utf-8'))
    app_eui = binascii.unhexlify('70B3D5499FFEB9D2')
    app_key = binascii.unhexlify('70B3D5499FFEB9D270B3D5499FFEB9D2')
    
    lora.join(activation=LoRa.OTAA, auth=(app_eui,app_key),timeout=0)
    
    while not lora.has_joined():
        print("Not joined yet")
        pycom.rgbled(off)
        time.sleep(0.1)
        pycom.rgbled(red)
        time.sleep(2)
    
    print('joined')
    pycom.rgbled(blue)
    
    s = socket.socket(socket.AF_LORA, socket.SOCK_RAW)
    s.setsockopt(socket.SOL_LORA, socket.SO_DR, 5)
    s.setblocking(False)
    
    pkt_send = 0
    while True:
    
        s.send(bytes([0x00,0x01]))
        s.settimeout(3.0)
    
        try:
            rx_pkt = s.recv(64)
            print(rx_pkt)
            #colorindex = int.from_bytes()
        except socket.timeout:
            print('no packet received')
    
        pycom.rgbled(green)
        time.sleep(0.1)
        pycom.rgbled(red)
        time.sleep(29.9)


  • @bmarkus I'm using Thingpark actility network server with regional settings of Eu868 europe regional settings.



  • Which Network Server and regional setting are you using?



  • @prashanth I do not understand fully the gateway log, but I cannot tell fomr it, that the downlink message has been sent at the right time. The highlighted line says 932 ms, which would even be wrong for a 'normal' message. The OTAA response message is expected after 5000 ms. I do not see that in the log. What I see in the middle is some negotiation for RX2 parameters at 869.525 MHz, SF9. And there was some discussion about that in other threads.



  • @robert-hh Cisco Lorawan gateway. I'm also able to see the data coming downlink at the gateway logs, but not receiving at node.Screenshot from 2019-07-16 18-29-04.png



  • @prashanth Which gateway are you using?


Log in to reply
 

Pycom on Twitter