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

-
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.htmlI've try it yesterday Lopy OTAA with MatchX gateway and working
-
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.

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