No project description provided
Project description
lora-calc
A Python library for calculating LoRa (Long Range) wireless transmission parameters. Compute symbol times, airtime, throughput, and link budgets based on LoRa configuration settings.
Installation
pip install lora-calc
Or with Poetry:
poetry add lora-calc
Usage
from lora_calc import LoRaCalculator
# Create a calculator with your LoRa parameters
calc = LoRaCalculator(
tx_power=20, # Transmit power in dBm (-14 to 20)
payload_len=125, # Payload length in bytes (0-255)
preamble_len=8, # Preamble length in symbols (6-65535)
spreading_factor=10, # SF6-SF12
bandwidth=125, # 62.5, 125, 250, or 500 kHz
coding_rate=5, # 5, 6, 7, or 8 (representing 4/5, 4/6, 4/7, 4/8)
crc=True, # Enable CRC
explicit_header=True, # Use explicit header mode
low_data_rate_opt=True, # Low data rate optimization
)
# Get transmission parameters
print(f"Symbol time: {calc.symbol_time} ms")
print(f"Symbol rate: {calc.symbol_rate} symbols/sec")
print(f"Preamble duration: {calc.t_preamble} ms")
print(f"Payload duration: {calc.t_payload} ms")
print(f"Total airtime: {calc.t_total} ms")
print(f"Throughput: {calc.throughput} bps")
print(f"Effective data rate: {calc.effective_data_rate} bps")
print(f"Link budget: {calc.link_budget} dB")
Parameters
| Parameter | Range | Description |
|---|---|---|
tx_power |
-14 to 20 dBm | Transmit power |
payload_len |
0-255 bytes | Payload length |
preamble_len |
6-65535 symbols | Preamble length |
spreading_factor |
6-12 | LoRa spreading factor |
bandwidth |
62.5, 125, 250, 500 kHz | Signal bandwidth |
coding_rate |
5, 6, 7, 8 | Forward error correction (4/5, 4/6, 4/7, 4/8) |
crc |
True/False | Enable CRC check |
explicit_header |
True/False | Use explicit header mode |
low_data_rate_opt |
True/False | Low data rate optimization |
Calculated Properties
| Property | Unit | Description |
|---|---|---|
symbol_time |
ms | Duration of one symbol |
symbol_rate |
symbols/sec | Symbols transmitted per second |
t_preamble |
ms | Preamble duration (programmable symbols only) |
t_preamble_total |
ms | Total preamble including sync word overhead |
n_payload |
symbols | Number of payload symbols |
t_payload |
ms | Payload transmission time |
t_total |
ms | Total time on air |
throughput |
bps | Actual data throughput |
effective_data_rate |
bps | Theoretical channel capacity |
link_budget |
dB | Link budget based on SX1276 receiver sensitivity |
References
Other LoRa Calculator Implementations
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
lora_calc-0.1.1.tar.gz
(4.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lora_calc-0.1.1.tar.gz.
File metadata
- Download URL: lora_calc-0.1.1.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.12.11 Linux/6.6.87.2-microsoft-standard-WSL2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32c4eb4cb0122dc8d49b44b1ce3d3921344a2ca78e3408f95e0bd6ba3f0e773d
|
|
| MD5 |
fbb414ad6852fe2e18aed8f19b9351f6
|
|
| BLAKE2b-256 |
463c13d781e3901fb44e0d3e4cbcce65871771124760bbf95916b444ac4b963f
|
File details
Details for the file lora_calc-0.1.1-py3-none-any.whl.
File metadata
- Download URL: lora_calc-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.12.11 Linux/6.6.87.2-microsoft-standard-WSL2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38ef9bfc6f54205c858ea623634089b4302afc996b7c75dfab063a425046c413
|
|
| MD5 |
1a801be76b98d03b9f305663c3439e35
|
|
| BLAKE2b-256 |
c03424f27e5637f60ed396a18d7788af4d55e3cc808a1dedbb03df18beb7f7bf
|