value of tx_time_on_air of the lora.stats() function
-
I needed to know how long it takes my lopy to send data packets of different sizes to the gateway. I use the lora.stats() function, but even if I modify the package size, it still gives the same value as tx_time_on_air, so I think it's not the value I'm looking for. Is there any way to get this data?
-
@braulio The time on air changes with the data rate. And for larger distances, the sending device may be set for lower data rates. But that does not happen by itself.
-
@robert-hh The time on air can change with the distance???
-
I suggest some air time/data rate calculator, e.g. :
https://www.loratools.nl/#/airtime
http://www.rfwireless-world.com/calculators/LoRa-Data-Rate-Calculator.htmlI've also created a topic with Python 3/MicroPython code to calculate air time :
Air Time calculation in (Micro)Python
-
@robert-hh
lora.stats()
also includes some data about the last sent message. But it seems the LoRa stack gets some of the info wrong...
-
@imasd The time on air can be calculated from the data rate and the message size plus overhead. If you connect to TTN, it will tell you too the stimated time on air. Using two messages with different payload length, you can determine the parameters for future messages.
The bit rate for a cerrain data rate is given by the LoRA regional parameters document. It varies with the region you're in.
Besides that, lora.stats() gives you the information for the most recent received message. I could not tell from your post whther you call lora.stat() at the sender or receiver side.
-
The values that I obtained, with lora raw, are the following:
sf = 7, 1byte = 83ms, 10bytes = 83ms, 26bytes = 83ms
sf = 10, 1b = 535ms, 10b = 535ms, 26b = 535ms
sf = 12, 1b = 1975ms, 10b = 1975ms, 26b = 1975ms
As you can see, regardless of the number of bytes, the function returns the same time values in the air. I've tried LORAWAN and the same thing happens.
-
@imasd How much are you changing the payload size? There's quite a bit of overhead in LoRaWAN, so for small payloads the total time on air does not vary much (say, if you change from 1 to 3 bytes for instance). If you go from 1 to the max payload for that data rate you should indeed see a significant difference, though.
Can you share the values you got (including region, data rate, and payload size)?