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

    LoPy Cannot Change DR or SF in LoRaWAN mode (always SF10, dr 0, bw 125kHz)

    Scheduled Pinned Locked Moved LoPy
    data ratespreading factolopy lorawanadr
    4 Posts 3 Posters 682 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.
    • B Offline
      brady.aiello
      last edited by

      I'm having a lot of difficulty manually setting the data rate and spread factor with the LoPy. I'm wondering if anyone has been able to manually set dr and sf in LoRaWAN mode? I'm doing this:

      lora = LoRa(mode=LoRa.LORAWAN, sf=7, region=LoRa.US915)
      
      for i in range(72):
          if 0 <= i < 8:
              print(curr)
              lora.add_channel(index=i, frequency=curr, dr_min=3, dr_max=3)
              curr += f_inc
          else:
              lora.remove_channel(i)
      
      lora.join(activation=LoRa.ABP, auth=(dev_addr, nwk_skey, app_skey))
      s = socket.socket(socket.AF_LORA, socket.SOCK_RAW)
      

      What happens is that the first 7 messages won't even be detected by the gateway. The 8th message uses sf 10 on 905.1. If I set this value on the socket itself, with

      s.setsockopt(socket.SOL_LORA, socket.SO_DR, 3)

      nothing is ever picked up by the gateway. BTW, I'm using TTN's US frequencies. Thanks.

      J robert-hhR 2 Replies Last reply Reply Quote 0
      • J Offline
        jcaron @brady.aiello
        last edited by

        @brady-aiello what gateway are you using, and what frequencies is it listening on?

        B 1 Reply Last reply Reply Quote 0
        • B Offline
          brady.aiello @jcaron
          last edited by

          @jcaron The Rising HF RHF301, on the frequencies described here:
          https://account.thethingsnetwork.org/api/v2/frequency-plans/US_902_928

          So, it looks like that's
          903900000
          904100000
          904300000
          904500000
          904700000
          904900000
          905100000
          905300000
          all on 125 kHz bw.

          1 Reply Last reply Reply Quote 0
          • robert-hhR Offline
            robert-hh @brady.aiello
            last edited by

            This post is deleted!
            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