Portenta LoRa shield with MKRWAN library - Adjusting the payload size

Hi, kind of newbie here, I reopened my LoRa project recently, using arduinos Portenta H7 with Vision Shield - LoRa. I am in EU region

I Installed MKRWAN firmware, and I successfully made LoRa work with TTN v3, and I am able to send messages . . . as long as they are 64B

So my first question would be: Why is the cap 64B, when looking at document here, minimum should be 51B? Is this how the code is optimized?

Given I adhere to the regulations, if I change code rate, I should be able to use bigger payloads with higher CRs, right? Looking into the document from STM, on page 17 there is description of AT+SEND command, and payload is described there as “maximum 242B”

I’ve even found the line (and it’s area) in github, that caps data at 64 here.

So I guess my questions are:

  1. Why the cap of 64B instead of 51B?
  2. I should be able to adjust the library to allow bigger payload on coderates I want to use?
  3. Will the LoRa chip / TTN warn me if I will mess up and send “illegal” packets?

64 bytes is already pretty long for a LoRaWAN payload, you probably should consider a different technology if you need longer.

The actual maximum will depend on the spreading factor in use, and the local regulations - it could be as little as 12 bytes.

Note that the TTN fair use policy is far more stringent in terms of overall daily airtime use than most regional regulations.

If you’re pushing limits, LoRaWAN is probably the wrong choice.

IIRC The LoRaWAN overhead is 13B so 51 + 13 = … :wink: Guess you need to consider payload vs msg length. As @cslorabox says in some jurisdictions things like Dwell time may limit further and with overhead actual length may be 11 or 12B max payload. I believe you are EU based so at SF12 51B would indeed be max payload, with 64B message length… You should aim to keep payload as short as possible - look at bits/byte/encoding and compression methods where you can to minimise airtime etc. Poss use FPort to indicate type of data etc.

1 Like

So therefore, payload != the data I want to transmit

I could transmit 222B on SF7 then, if I understand right?

No, that would really not be appropriate on a more than extremely rare basis.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.