# Spreadsheet for LoRa airtime calculation

**URL:** <https://www.thethingsnetwork.org/forum/t/spreadsheet-for-lora-airtime-calculation/1190>\
**Category:** Uncategorized\
**Created:** [February 4, 2016, 2:45pm UTC](https://www.thethingsnetwork.org/forum/t/spreadsheet-for-lora-airtime-calculation/1190 "2016-02-04T14:45:50Z")\
**Posts on this page:** 1\
**Showing post:** 19

<div class="post-metadata">

**Author:** ![hanshenrik](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/h/76d3ee/32.png) [@hanshenrik](https://www.thethingsnetwork.org/forum/u/hanshenrik)\
**Post date:** [April 6, 2016, 2:12pm UTC](https://www.thethingsnetwork.org/forum/t/spreadsheet-for-lora-airtime-calculation/1190/19 "2016-04-06T14:12:13Z")

</div>

Very nice sheet, incredibly helpful!

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:

```auto
char sendableString[frame.length*2 + 1];
Utils.hex2str(frame.buffer, sendableString, frame.length);

```

Here’s some output from a transmission:

```auto
Frame Length: 105
Frame (STR): <=>#012345678#0123456789#0#BAT:42#IN_TEMP:17.00#GP_TC:-26.774#GP_HUM:25.70#GP_CO:25.918#GP_CO2:304.826#
Sendable string: 3c3d3e3f062330313233343536373823303132333435363738392330234241543a343223494e5f54454d503a31372e30302347505f54433a2d32362e3737342347505f48554d3a32352e37302347505f434f3a32352e3931382347505f434f323a3330342e38323623
strlen(sendableString): 210
sizeof(sendableString): 211
ADR: 1
DataRate: 5 (= SF7BW125)
Radio frequency: 869525000
Radio spreading factor: sf12
Radio bandwidth: 125
Radio coding rate: 4/5
Radio preamble length: 8

```

The corresponding TheThingsNetwork `data` field is:

```auto
PD0+gAYjNDAzMzE1ODQwI1dNMDIwMzIyMjIjMCNCQVQ6NDIjSU5fVEVNUDoxNy4wMCNHUF9UQzotMjYuNzc0I0dQX0hVTToyNS43MCNHUF9DTzoyNS45MTgjR1BfQ08yOjMwNC44MjYj

```

htdvisser’s ttntool calculated the air time to be **174.3ms** , which working backwards in the spreadsheet suggests a payload of **87-90 bytes** (if the header is 13 bytes).

So my question is simply: how do I know my payload and header sizes without working backwards based on air time calculated?

---

_[View the full topic](https://www.thethingsnetwork.org/forum/t/spreadsheet-for-lora-airtime-calculation/1190)._
