Airtime Calculator

Hi!

I wanted to investigate the airtime from various SF/payload combinations, so I implemented a python script calculating Time-on-air from the equations presented here LoRaWAN: Equal time-on-air for different sized payloads - #4 by trymjb

However, when I compare the results to the airtime calculator provided by TTN, the results differ…

One example is with SF=7, payload = 7, BW = 125 kHz and region = EU868. TTN gives me 56.6ms, and my calculations yield 36ms. What could cause this issue?

CRC = 1
IH = 0
CR = 1
DE = 0

Have you allowed for the (~13 Byte IIRC) header under LoRaWAN Spec?

Are you reffering to The preamble length? (8+4.25) In that case yes

No, not the preamble, the LoRaWAN header - the bit that says what the device is, the count etc.

I think many of us use this for comparing payload changes:

https://avbentem.github.io/airtime-calculator/ttn/eu868/2

@Jeff-UK @descartes If i understand it correctly, then The header is accounted for in The IH parameter from The equation posted above (IH = 0: enabled)

Yes the header is enabled (explicit

Bit hard to tell, the image you uploaded was too big for the forum so I can’t see the whole formula.

But to be clear, if you have IH = 0, that’s enabling the header??

Yes.

The equations for total airtime comes from the sx1276 datasheet

This link LoRaWAN Airtime calculator,LoRa Packet duration calculation gives me the same answer that I calculate, however it is different compared to the TTN calculator.

Maybe it is possible to view the source code for the calculator to see how they do it?

There seems to be a fair bit of confusion here.

At the LoRa level there is an optional header but that only has a small affect on total air time.

LoRaWAN (which is different to LoRa!) adds 13 bytes or so to the length of the actual data payload.

The calculations in the SX127x datasheets know nothing about LoRaWAN.

3 Likes

Hi @trymjb now you see why, in 1st reply to your original post after you said

“(I am writing about it in my masters thesis :smiley: )”

I suggested

And gave you some big clues

from the LoRaWAN specs and 1st principles” Note Not just the LoRa/Device specs

spoilers: LoRaWAN Headers, Payload format and structures, Forward error correct/CRC check/Coding scheme etc. yields a SF specific staircase/quantised increase in total payload/on airtime

:wink:

Good luck with the rest of your thesis :slight_smile: :+1:

1 Like

Alright! Now it is more clear

Thanks Jeff :smiley: