master
Shoichi Sakane 2017-10-23 09:12:26 +09:00
parent 9dddd35f70
commit d5f181e0f4
1 changed files with 40 additions and 35 deletions

View File

@ -1,7 +1,7 @@
LoRa Time on Air calculator LoRa/LoRaWAN Time on Air calculator
=========================== ===================================
A calculator of the time on air of LoRa PHY frame in Python. A calculator of the time on air (ToA) of LoRa/LoRaWAN PHY frame in Python.
This script refers to the section 4.1.1.6. LoRa Packet Structure, This script refers to the section 4.1.1.6. LoRa Packet Structure,
[SX1276/77/78/79 Datasheet rev.5][http://www.semtech.com/images/datasheet/sx1276.pdf]. [SX1276/77/78/79 Datasheet rev.5][http://www.semtech.com/images/datasheet/sx1276.pdf].
@ -34,32 +34,34 @@ the --downlink option should be specified.
## Usage ## Usage
lorawan_toa.py [-h] [--band-width N_BW] [--disable-auto-ldro] lorawan_toa.py [-h] [--band-width NUMBER] [--disable-auto-ldro]
[--enable-ldro] [--disable-eh] [--downlink] [--enable-ldro] [--disable-eh] [--downlink]
[--disable-crc] [--cr N_CR] [--preamble N_PREAMBLE] [-v] [--disable-crc] [--cr NUMBER] [--preamble NUMBER]
[-d] [--duty-cycle NUMBER] [-v] [-d]
SF SIZE SF SIZE
LoRa Time on Air calculator.
positional arguments: positional arguments:
SF Spreading Factor. It should be from 7 to 12. SF Spreading Factor. It should be from 7 to 12.
SIZE PHY payload size in byte. It's equal to the MAC SIZE PHY payload size in byte. It's equal to the MAC payload
payload + 5. + 5.
optional arguments: optional arguments:
-h, --help show this help message and exit -h, --help show this help message and exit
--band-width N_BW bandwidth in kHz. default is 125 kHz. --band-width NUMBER bandwidth in kHz. default is 125 kHz.
--disable-auto-ldro disable the auto LDRO and disable LDRO. --disable-auto-ldro disable the auto LDRO and disable LDRO.
--enable-ldro This option is available when the auto LDRO is --enable-ldro This option is available when the auto LDRO is
disabled. disabled.
--disable-eh disable the explicit header. --disable-eh disable the explicit header.
--downlink disable the CRC field, which is for the LoRaWAN --downlink disable the CRC field, which is for the LoRaWAN
downlink stream. downlink stream.
--disable-crc same effect as the --downlink option. --disable-crc same effect as the --downlink option.
--cr N_CR specify the CR value. default is 1 as LoRaWAN does. --cr NUMBER specify the CR value. default is 1 as LoRaWAN does.
--preamble N_PREAMBLE --preamble NUMBER specify the preamble. default is 8 for AS923.
specify the preamble. default is 8 for AS923. --duty-cycle NUMBER specify the duty cycle in percentage. default is 1 %.
-v enable verbose mode. -v enable verbose mode.
-d increase debug mode. -d increase debug mode.
## Examples ## Examples
@ -68,20 +70,23 @@ below example, it show detail information in SF 12, 64 bytes of PHY payload,
125 kHz bandwidth, preamble 8. 125 kHz bandwidth, preamble 8.
% python lorawan_toa.py 12 64 -v % python lorawan_toa.py 12 64 -v
PHY payload size : 64 Bytes PHY payload size : 16 Bytes
MAC payload size : 59 Bytes MAC payload size : 11 Bytes
Spreading Factor : 12 Spreading Factor : 7
Band width : 125 kHz Band width : 125 kHz
Low data rate opt. : enable Low data rate opt. : disable
Explicit header : enable Explicit header : enable
CR (coding rate) : 1 (4/5) CR (coding rate) : 1 (4/5)
Symbol Rate : 30.518 symbol/s Symbol Rate : 976.562 symbol/s
Symbol Time : 32.768 msec/symbol Symbol Time : 1.024 msec/symbol
Preamble size : 8 symbols Preamble size : 8 symbols
Packet symbol size : 73 symbols Packet symbol size : 38 symbols
Preamble ToA : 401.408 msec Preamble ToA : 12.544 msec
Payload ToA : 2392.064 msec Payload ToA : 38.912 msec
Time on Air : 2793.472 msec Time on Air : 51.456 msec
Duty Cycle : 1 %
Min span of a cycle : 5 sec
Max Frames per day : 16791 frames
without the -v option, it simply shows the ToA. without the -v option, it simply shows the ToA.