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

    TX callback bug

    Scheduled Pinned Locked Moved LoPy
    buglopycallback
    6 Posts 2 Posters 1.5k 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.
    • R Offline
      rpp0
      last edited by

      Hi,

      I noticed that for SF 12 and a payload length > 155, the tx callback doesn't fire anymore. This behavior only occurs for SF 12, so it is probably related to the transmission length on the physical layer, and not to the payload length itself.

      Example code to reproduce:

      >>> import pycom
      >>> import socket
      >>> import binascii
      >>> from network import LoRa
      >>> lora = LoRa(mode=LoRa.LORA, frequency=868100000, tx_power=2, bandwidth=LoRa.BW_125KHZ, sf=7, preamble=8, coding_rate=LoRa.CODING_4_8, power_mode=LoRa.ALWAYS_ON, tx_iq=False, rx_iq=False, adr=False, public=True, tx_retries=1)
      >>> s = socket.socket(socket.AF_LORA, socket.SOCK_RAW)
      >>> s.setblocking(True)
      >>>
      >>> def lora_cb(lora):
      ...     print("callback fired")
      ...     
      ...     
      ... 
      >>> lora.callback(trigger=LoRa.TX_PACKET_EVENT,handler=lora_cb)
      >>> lora.sf(12)
      >>> s.send(binascii.unhexlify("00"))
      callback fired
      1
      >>> s.send(binascii.unhexlify("00"*155))
      callback fired
      155
      >>> s.send(binascii.unhexlify("00"*156))
      156
      >>> 
      
      1 Reply Last reply Reply Quote 0
      • bmarkusB Offline
        bmarkus
        last edited by bmarkus

        For SF12 payload >155 length is not allowed by the LoRaWAN Specification. It is valid only for DR4/DR5 up to 222 in EU868.

        1 Reply Last reply Reply Quote 1
        • R Offline
          rpp0
          last edited by

          Thanks for the clarification! Are you referring to section 7.1.6 of the specification? I couldn't find a maximum payload size for 868 MHz specifically. I still think this behavior is not intended for two reasons:

          • The radio does not reject the command and happily transmits payloads larger than 155 bytes for SF12 (I tried up to 255 bytes)
          • SF 11 at 125 KHz (DR1) has the same payload size restrictions (if I am correct to assume that the table in section 7.1.6 applies to 868 MHz), but the callback does fire correctly in this case.
          1 Reply Last reply Reply Quote 0
          • bmarkusB Offline
            bmarkus
            last edited by bmarkus

            LoRaWAN 1.0.2 Regional Parameters document Chapter 2.1.6 EU863-870 Maximum payload size, Table 7.

            R 1 Reply Last reply Reply Quote 0
            • R Offline
              rpp0 @bmarkus
              last edited by

              @bmarkus I still don't understand: the table you are referring to shows that the same packet length restrictions apply to SF 10 and SF 11. But in these cases the callback does fire when exceeding the limit. The same is true when using DR4/DR5 and sending a 255-byte frame (thus again exceeding the limit imposed by the specification): the callback fires correctly. SF 12 is the only configuration that doesn't work.

              1 Reply Last reply Reply Quote 0
              • bmarkusB Offline
                bmarkus
                last edited by

                I have no idea how LoRaWAN stack is implemented by PyCom. I just responded to your opening post that 155 bytes payload is not allowed with SF12 by the LoRaWAN Specification.

                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