LoRaWAN might have a fixed coding rate of 1? (So, CR=1.) I cannot find that in the specification. Even more: it does mention it explicitly for transmission of Class B beacons, so I doubt it’s also fixed for other operations?
As LoRaWAN includes its own header, the explicit LoRa header might not be needed? (So, H=1.) That would indeed need a fixed coding rate to start with (which otherwise would be set in the LoRa header). But it would also need some way to determine the payload length (which is in the LoRa header, but not in the LoRaWAN header). I think the LoRaWAN specification claims the LoRa header is always included though:
3.1 Uplink Messages
Uplink messages use the LoRa radio packet explicit mode in which the LoRa physical header (PHDR) plus a header CRC (PHDR_CRC) are included.
To avoid issues surrounding drift of the crystal reference oscillator due to either temperature change or motion, the low data rate optimization bit is used. Specifically for 125 kHz bandwidth and SF = 11 and 12, this adds a small overhead to increase robustness to reference frequency variations over the timescale of the LoRa packet.
Does anyone know if this is automatically enabled by the chipset or the LoRaWAN stack, for SF11 and SF12? In ttntool this is currently indeed the case:
Okay, I’ve changed my copy of the sheet to auto-enable low data rate correction for SF11…12, and to also make clear that SF6 is not used in LoRaWAN. So basically LoRaWAN users only need to adjust the value for application payload to see the results.
(@matthijs, if you ever copy those changes in your sheet at the original URL then let me know, so I can delete these posts.)
First of all, thank you very much for the sheet! Very useful for indication!
I have a question about payload comment in the sheet.
‘For LoRaWAN: maximum 55 for low data rates (SF12), up to about 222 bytes for best conditions (SF7).’
In the LoRaWAN spec (7.1.6 EU863-870 Maximum payload size) DR0 - DR2 have a maximum payload of 51 bytes (absence of Fopt)
Would this be a maximum of 51 for SF12 (DR0) according to this table, or am I missing something? Could you please elaborate?
@bvanderpol, that comment is something I added to the original sheet, and took from the FAQ.
The numbers were added to the FAQ after another discussion. But reading it again, that discussion is clear about the maximum, and indeed also mentions 55 but does not explicitly state that’s the minimum. So maybe the minimum in the FAQ is indeed wrong. (I also think the figures are slightly different for different regions? I’m not sure though.)
I am still not quite sure how to calculate the header and payload sizes though. I am using a Waspmote to send frames containing sensor data. The frame is converted into a hexadecimal array—which is the required format by the LoRaWAN.sendUnconfirmed(...) function—by using the following util function:
Note that there are some minor bugs there as mentioned above, for which I promised a pull request which I still did not create… Not sure how much that affects the result though.
As far as I know, the headers are always 13 bytes (as explained above), and the payload is just a number of bytes too, so 105 in your example. So in matthijs’ original sheet that’s 118 in total; in my version it’s 105 and 13.
I guess one alternative would be to just send the values as csv (and not label them), and have a fixed, known position for each value. However, this somewhat restricts the flexibility of the system, e.g. allowing different devices to measure different things, and still be able to parse the values on the other side. When you say don’t use text, is this what you mean? (I read the post, but didn’t really see where you talk about text vs. something else)
[quote="arjanvanb, post:20, topic:1190]
Also, it seems #BAT:42# is a counter value?[/quote]
BAT:42 indicates the battery level of the device : )
No, that would still imply you’re sending numbers as characters, and are adding separators that are not useful.
But, stupid, I gave you the wrong link… See Best practices to limit application payloads: numbers can be sent much more efficient than that. As for devices measuring different things: just keep track of the node’s ids, or use the LoRaWAN “port” like explained in the new link as well.
So basically LoRaWAN users only need to adjust the value for application payload to see the results.
I’m confused now. Do I or do I not put 13 as the LoRaWAN header size? Since the sheet starts out with a header size of 1, but this thread mentions multiple times the LoRaWAN header size is 13 bytes.
Currently I’m entering the below configurations to determine the amount of packets I can send on TTN with the max payload of 51 bytes on the lowest datarate of SF12. Is that correct or should LoRaWAN header size be 1?
The 13 bytes is correct. (So for a 51 bytes payload the LoRa packet would be 51 + 13 = 64 bytes.) I don’t know what happened, my copy of the sheet indeed showed just 1 when I opened it a minute ago. Thanks for letting me know; I changed it to 13 again (and added some conditional formatting in case it’s not 13).
Hello @matthijs & @Thomas
According to your spreadsheet:
Total bytes = 13 payload + 13 LoRaWAN header = 26 bytes
Total bits = 268 = 208 bits
After encoding = 2085/4 = 260 bits
As SF = 9, so,
Output Payload symbols should be => 260/9 = 28.89 ~ 29 LoRa symbols
But according to your spreadsheet it is 28.
Is my calculation correct?
As an aside: Matthijs’ original version expects the total number of bytes to be in the input. So, for 13 bytes of data you should enter 26, for which the spreadsheet will give you 38 symbols. That’s much higher than your manual calculation.
Beware that disabling the Forward Error Correction code comes with a significant penalty when it comes to sensitivity/range. The trade-of, a small increase in data-rate vs a significant loss in sensitivity, is not worth it, except in very special cases like class B beacon when it was done on purpose for specific reasons.
Always use a 4/5 (in “nice” environments) or 4/6 (in environments with bursted interferes) redundancy for data transmission.
Thank you for the spreadsheet, it does explain better the LoRa symbol / bit conversion.
I would like to ask you about the 8 mandatory symbols in the payloadnb symbol. I searched everywhere to explain their utility, since it’s not representing the preamble length. A payload has at least 8 symbols, what are those representing?