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

    LoRaWan and MatchX

    Scheduled Pinned Locked Moved LoPy
    lopymatchx
    4 Posts 2 Posters 1.0k Views 2 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.
    • M Offline
      misterlisty
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • C Offline
        chumelnicu
        last edited by chumelnicu

        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

        1 Reply Last reply Reply Quote 0
        • M Offline
          misterlisty
          last edited by

          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

          C 1 Reply Last reply Reply Quote 0
          • C Offline
            chumelnicu @misterlisty
            last edited by chumelnicu

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

            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