LoRaWan and MatchX



  • i have my lopy working with multitec hbut having issue with MatchX gateway. Any help would be great.

    from network import LoRa
    import socket
    import time
    import binascii
    import struct
    
    lora = LoRa(mode=LoRa.LORAWAN)
    
    app_eui = binascii.unhexlify('00 XX 00 00 00 00 B7 E2'.replace(' ',''))
    app_key = binascii.unhexlify('2B 7E 15 16 28 AE D2 A6 AB F7 15 88 09 CF 4F 3C'.replace(' ',''))
    
    lora.join(activation=LoRa.OTAA, auth=(app_eui, app_key), timeout=0)
    
    for channel in range(0, 8):
            lora.remove_channel(channel)
    
    for channel in range(16, 64):
            lora.remove_channel(channel)
        
    # wait until the module has joined the network
    i = 0
    while not lora.has_joined():
        time.sleep(5)
        i = i+1
        print('joining LoRa'+ str(i*5) +' second has passed...')
    
    print('LoRaWan connect.')
    # create a LoRa socket
    s = socket.socket(socket.AF_LORA, socket.SOCK_RAW)
    s.setsockopt(socket.SOL_LORA, socket.SO_DR, 3)
        
    
    i = 0
    while True:
        print("Lora send::1")
        # set the LoRaWAN data rate
        s.setblocking(True)
        print("Lora send::3")
        # send some data
        count = s.send("Hello lora" + str(i))
        print('Sent %s bytes' % count)
        print("Lora send::4")
        i += 1
    

    0_1519818082578_matchx gateway setup node.PNG

    0_1519818194032_matchx gateway setup node2.PNG



  • @misterlisty I just told you what is work for me .....
    BTW why did u remove channels? On this firmware u can set Region Eu, US AS from code without remove channels and add others ...

    Also you can try to set from your MatchX lbt_cfg": {
    "enable": false,



  • I have this same code working with my multi-tech by not matchx. I can see in logs that its connecting but the lopy thinks its not connected.

    0_1519826320457_Capture.PNG



  • Hi .. remove from your code below lines and try again...

    for channel in range(0, 8):
    lora.remove_channel(channel)

    for channel in range(16, 64):
    lora.remove_channel(channel)

    Also try to update lopy with last firmware and use OTAA example from
    https://docs.pycom.io/chapter/tutorials/lopy/lorawan-otaa.html

    I've try it yesterday Lopy OTAA with MatchX gateway and working


Log in to reply
 

Pycom on Twitter

Looks like your connection to Pycom Forum was lost, please wait while we try to reconnect.