pamoja-lora
Time-on-air, duty-cycle off-time, and the regional channel plans a LoRa node must keep to. One capability of pamoja, one memory-safe Rust core with bindings for TypeScript, Python, and C#.
Install
pip install pamoja-lora
from pamoja import lora
This pulls in pamoja-native, the compiled engine. pip install pamoja is the whole framework in one package.
Example
The script the test suite runs, spliced here as it ran.
From bindings/python/guides/lora.py:
from pamoja.lora import messages_per_hour, plan_for
# EU863-870 numbers its data rates from the slowest. DR0 is SF12 at 125 kHz, the setting
# that reaches furthest and holds the channel longest.
plan = plan_for("EU868")
link = plan.link_settings(0)
print(f"{plan.name} DR0 is SF{link.spreading_factor} at 125 kHz")
# The time on air for that setting, coding rate 4/5, an eight-symbol preamble, an explicit
# header and CRC on, carrying a ten-byte reading.
airtime = link.airtime_us(10)
print(f"airtime {airtime / 1e6:.2f} s for ten bytes")
# 868.1 MHz falls in a sub-band capped at 1% of the time and 16 dBm, so every transmission
# buys ninety-nine times its own length in silence.
channel = 868_100_000
permille = plan.duty_cycle_permille(channel)
print(f"channel {permille} per mille duty cycle, {plan.max_eirp_dbm(channel)} dBm")
off_time = link.min_off_time_us(10, permille)
print(f"silence {off_time / 1e6:.1f} s owed after each reading")
# The airtime plus that silence is what one reading really costs, which is the budget a
# deployment plans against.
print(f"budget {messages_per_hour(link, 10, permille)} readings an hour")
# A frequency in no sub-band the plan describes has no duty cycle to budget against. That
# is a limit published elsewhere, not permission to transmit.
outside = plan.duty_cycle_permille(700_000_000)
print(f"700 MHz is outside this plan, so it budgets nothing: {outside is None}")
The same capability in every language
| Language | Package | Reference |
|---|---|---|
| Rust | pamoja-lora |
reference, docs.rs, install |
| TypeScript | @pamoja/lora |
reference, install |
| Python | pamoja-lora |
reference, install |
| C# | Pamoja.Lora |
reference, install |
Documentation
pamoja.lorareference, every class and function in this module.- The LoRa airtime guide, with the same example in Rust, TypeScript, and C#.
- Every capability, and the install page.
License
MIT
Release files for pamoja-lora 0.1.18
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pamoja_lora-0.1.18.tar.gz | 4.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pamoja_lora-0.1.18-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.5 kB
Release files / pamoja_lora-0.1.18.tar.gz
| Download URL | pamoja_lora-0.1.18.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
08530070ab3a526524ac0c49fe6aff9fada72bb7f48ac734b7d180d0a5e3bf69
|
|
BLAKE2b-256 checksum How to use checksums |
c8027ac370403519a8630ac7fb8eff01526476c2f19514bab551865a093d60fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.15
|
Release files / pamoja_lora-0.1.18-py3-none-any.whl
| Download URL | pamoja_lora-0.1.18-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ed4ec4999f7426416bca29faf5a82c5dc359dd81b2717d26de86183729e67237
|
|
BLAKE2b-256 checksum How to use checksums |
f7be879c888973423d74f447d88bc781bbacf61b188231f2c05187854d3290da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.15
|