arduino-libraries / MKRWAN

An Arduino library for sending and receiving data using LoRaWAN protocol and LoRa® radios.
https://www.arduino.cc
GNU Lesser General Public License v3.0
88 stars 60 forks source link

Sending more than 11 bytes in ABP mode #56

Open daniel-pach opened 5 years ago

daniel-pach commented 5 years ago

I need to know if someone could send more than 11 bytes in ABP mode? I could not send more than 11 bytes

cstratton commented 4 years ago

This is likely a limitation driven by spreading factor and region, not literally by ABP.

LoRaWAN packets include quiet a bit of overhead. When operating at a slow spreading factor, the overhead itself may consume much of the permitted time duration of a packet. For example, if in your locality you must operate within a 400 millisecond (0.4 second) limit, then at SF10 you have room for about 11 bytes of payload, and at SF11 you cannot even fit the headers alone. In contrast, in Europe even SF12 is usable and packets may exceed a second in length.

Spreading factor should be dynamically adjusted to link conditions, for example by use of Adaptive Data Rate (ADR) - if the connectivity is good, the spreading factor should reduce (packet encoding speed up) and it will become possible to fit more payload bits in the same packet duration.

While it is possible in the specification to use ADR with ABP, for many ADR is associated more with OTAA operation.

It is also possible to manually set a lower (faster) spreading factor - if doing so still means the signal gets through that not only saved battery by finishing faster, but also more quickly makes the radio spectrum available for others to use.

These are LoRaWAN reasons why you such a restriction of packet length may be appropriate, but that doesn't mean they are the reasons why you are seeing an issue in your case - the software could be correctly limiting you, or it could be limiting you based on something that would be true in another case, but not actually true at that instant of time in your case. To distinguish the difference, you would need to be clear about the LoRaWAN regional parameters in use (ie, US915, EU868, etc) and the spreading factor in effect at the instant in time when you experience this limitation.