Skip to main content

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#.

API reference read the guide documentation

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

License

MIT

Release files for pamoja-lora 0.1.17

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pamoja-lora 0.1.17
File Size Uploaded
pamoja_lora-0.1.17.tar.gz 4.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pamoja-lora 0.1.17
File Interpreter ABI Platform
pamoja_lora-0.1.17-py3-none-any.whl Python 3 none any Details

Total release size: 10.5 kB

Release files / pamoja_lora-0.1.17.tar.gz

Download URL pamoja_lora-0.1.17.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
0f87efec3e5324664c3a39eeadbfb3868c8ccea98a2629d0d1643137d50be93d
BLAKE2b-256 checksum
How to use checksums
4e8a13a05b0db81ffb7b41cba87018b2d0e2388ab5e1ee2be728abafc391c723
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.17-py3-none-any.whl

Download URL pamoja_lora-0.1.17-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bee8736640cba2524dc6d88b89d85956fc60f24a22f898cd9f1f6a818a78620d
BLAKE2b-256 checksum
How to use checksums
53e58017de4b2638ce1db263ec56cb067cdef1194df52bbae1e20f73517ae89d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release history Release notifications | RSS feed

0.2.0

2 release files

0.1.18

2 release files

This release

0.1.17 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page