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 join: operation not possible using spreading factor other than seven(?)

    Scheduled Pinned Locked Moved LoPy
    lopy lora modelopy connection
    3 Posts 2 Posters 1.7k 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
      matt_tait Pybytes Beta
      last edited by

      Hey guys,

      I am trying to send a packet with a size of 155 bytes. From my understanding of the lorawan specification with a spreading factor of 7, the maximum size is 51 bytes.

      However, when I try to change the spreading the factor the lora.join() method produces the error:

      Traceback (most recent call last): File "<stdin>", line 1, in <module> OSError: the requested operation is not possible

      The code I am using is as follows:

      from network import LoRa
      import socket
      import binascii
      import struct
      import pycom
      import time
      
      # Initialize LoRa in LORAWAN mode.
      # lora = LoRa(mode=LoRa.LORAWAN)
      lora = LoRa(mode=LoRa.LORAWAN)
      lora.BW_125KHZ
      lora.CODING_4_8
      lora.sf(12)
      
      # create an ABP authentication params
      dev_addr = struct.unpack(">l", binascii.unhexlify('00 00 00 05'.replace(' ','')))[0]
      nwk_swkey = binascii.unhexlify('70 b3 d5 49 95 be 95 0b 70 b3 d5 49 95 be 95 0b'.replace(' ',''))
      app_swkey = binascii.unhexlify('a3 1d 09 36 00 a1 8f fe 8c 62 56 99 35 3e 9b 31'.replace(' ',''))
      
      # join a network using ABP (Activation By Personalization)
      lora.join(activation=LoRa.ABP, auth=(dev_addr, nwk_swkey, app_swkey))
      

      As I said, the lora.join() method produces and error.

      The lora.join() only works with a spreading factor of 7 all other values produce the same error.

      Does anyone know of a solution/can see what I am doing wrong?

      Using firmware version:
      1.0.0.b1

      Thanks,

      Matt

      J 1 Reply Last reply Reply Quote 0
      • J Offline
        jmarcelino @matt_tait
        last edited by jmarcelino

        @matt_tait
        Your firmware is very old, try updating to the latest. Many things in LoRa have changed.

        I think longer packets are supported now, but as the documentation explains SF settings are reserved for raw LoRa, in LoRaWAN mode it expects SF to be set by the network using ADR. The default should already be 7 though.

        1 Reply Last reply Reply Quote 0
        • M Offline
          matt_tait Pybytes Beta
          last edited by

          okay cool, thanks very much for the reply. Will update the firmware

          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