Skip to content

LoRa Calculator - command line tool to calculate lora packet

License

Notifications You must be signed in to change notification settings

JiapengLi/lorcalc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LoRa Calculator

A simple command line tool for lora packet calculation.

So, finally I am tired of the Semtech GUI tool and the customized Excel shits, let's move to the elegant cmdline tool together .

Feature

All below parameters are configurable:

  • SF5 - SF12 spread factor
  • Long Interleaving
  • Low Data Rate Optimize
  • Header
  • CRC
  • Prebuilt binary for Windows platform

Compile

For windows platform, please install mingw first. A prebuilt binary is included in the repo.

$ gcc lrc.c -o lrc

Usage

./lrc -h
Usage: lrc [OPTIONS]
 -h, --help                                      Help
 -v, --version                                   Version 0.0.1
 -b, --bw,   --bandwidth                 <uint>  Bandwidth in hz, eg: 125000, 250000, 203125
 -s, --sf,   --spread-factor             <uint>  Spread factor (5 - 12)
 -o, --ldro, --low-datarate-optimize     <bool>  Low datarate optimize (on / off)
 -f, --fs,   --fine-synch                <bool>  Fine synch for high speed lora SF5 and SF6,
 -i, --li,   --long-interleaving         <bool>  Available in 2.4GHz lora (sx128x)
 -c, --cr,   --coderate                  <uint>  coding rate CR4/5 CR4/6... (1 - 4)
 -r, --pr,   --preamble                  <uint>  Raw preamble lenght
 -d, --hdr,  --header                    <bool>  Header option (on / off)
 -k, --crc,                              <bool>  CRC option (on / off)
 -l, --pl,   --payload                   <uint>  payload length

Example

Default Paramters

./lrc

sf 7, bw 125000, cr 1, ldro off, fs off, li off, pr 8, hdr on, crc on, pl 12
toa: 41216us, 41.216ms, 0.041s

image-20210120163914135

SF12 with Low Data Rate Optimize On

./lrc --sf=12

toa: 1155072us, 1155.072ms, 1.155s
sf 12, bw 125000, cr 1, ldro on, fs off, li off, pr 8, hdr on, crc on, pl 12

image-20210120164441045

SF12 with Low Data Rate Optimize Off

./lrc --sf=12 --ldro=off

toa: 991232us, 991.232ms, 0.991s
sf 12, bw 125000, cr 1, ldro off, fs off, li off, pr 8, hdr on, crc on, pl 12

image-20210120164513969

Acknowledgement

About

LoRa Calculator - command line tool to calculate lora packet

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages