TX callback bug

  • 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
    >>> s.send(binascii.unhexlify("00"*155))
    callback fired
    >>> s.send(binascii.unhexlify("00"*156))

  • 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.

  • @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.

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

  • 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.

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

Log in to reply

Pycom on Twitter