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

    FiPy OTAA join not working

    Scheduled Pinned Locked Moved FiPy
    5 Posts 3 Posters 301 Views 3 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.
    • F Offline
      ftorres
      last edited by

      Hi,
      I have the following code running on two LoPy boards without any problem

      from network import LoRa
      import socket
      import time
      import ubinascii
      
      lora = LoRa(mode=LoRa.LORAWAN, region=LoRa.US915, adr=False, public=True)
      
      for channel in range(0, 72):
          lora.remove_channel(channel)
      
      for channel in range(0, 8):
          lora.add_channel(channel, frequency=902300000 + channel*200000, dr_min=0, dr_max=3)
      
      app_eui = ubinascii.unhexlify('ADA4DAE3AC12676B')
      app_key = ubinascii.unhexlify('11B0282A189B75B0B4D2D8C7FA38548B')
      
      lora.join(activation=LoRa.OTAA, auth=(app_eui, app_key), timeout=0)
      
      while not lora.has_joined():
          time.sleep(2.5)
          print('Not yet joined...')
      
      s = socket.socket(socket.AF_LORA, socket.SOCK_RAW)
      
      s.setsockopt(socket.SOL_LORA, socket.SO_DR, 2)
      s.setsockopt(socket.SOL_LORA, socket.SO_CONFIRMED, True)
      
      while True:
          s.setblocking(True)
      
          s.send(bytes([0x01, 0x02, 0x03]))
      
          s.setblocking(False)
      
          time.sleep(10)
      

      I recently got two FiPy boards but, when I try to run the exact same code, they are unable to join to the network because they get stuck in

      while not lora.has_joined():
          time.sleep(2.5)
          print('Not yet joined...')
      

      I'm using LoRa Server as network server, so I checked the application logs and the join request messages don't even appear. Does anyone know what could be happening?

      Thanks in advance.

      T 1 Reply Last reply Reply Quote 0
      • T Offline
        thinginnovations @ftorres
        last edited by

        Are you within range of a gateway?

        F 1 Reply Last reply Reply Quote 0
        • F Offline
          ftorres @thinginnovations
          last edited by

          @thinginnovations Yes, I am (it is a Multitech Conduit). As I said in the first post, I'm using two LoPy boards with the same code and setup and they are working fine, but when I try it with the FiPy boards I can't make it work, so I'm clueless.

          R 1 Reply Last reply Reply Quote 0
          • R Offline
            rskoniec @ftorres
            last edited by rskoniec

            @ftorres

            • What do you mean by same setup - same f/w, same hardware setup (connected devices)?
            • Do you have something connected to the FiPy (especially to pins P5, P6, P7 - these are used by LoRa/Sigfox radio). Details in FiPy Pinout Diagram

            The machine is working as good as it's code.

            F 1 Reply Last reply Reply Quote 0
            • F Offline
              ftorres @rskoniec
              last edited by

              @rskoniec

              • By "same setup" I mean same firmware as the LoPy boards (1.18.1.r1), same code running on the boards, same gateway (Multitech Conduit), same network server (LoRa Server) and they are registered to the same application with the same configuration.
              • The FiPy are connected to Expansion Boards 3.0, but they don't have anything connected to its pins.
              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