pamoja

Documentation

Install#

pamoja is the whole framework in one package, in every language:

Shell
cargo add pamoja                 # Rust
npm install pamoja               # TypeScript and Node
pip install pamoja               # Python
dotnet add package Pamoja        # C# and .NET

That is the right default. Every capability is also its own package, and the sections below list them, but what you gain by picking them differs between Rust and the bindings. It is worth knowing which before you choose.

Every crate, package, and binding shares one version and is released together, so 0.1.15 of any package wraps 0.1.15 of every other. The changelog covers all of them in one entry.

What picking packages changes#

In Rust, it changes what gets compiled. A crate you do not name is never built, and its dependencies are never fetched, so a narrow build is genuinely smaller and carries less third-party code.

In the bindings it changes what you import, not what you download. Node, Python, and .NET each load one compiled engine that carries every capability, and every package depends on it. Choosing packages narrows the API you see, the manifest you ship, and the code your dependency scanners have to account for. It does not shrink the engine.

Neither is a workaround. Compiling only what you use is a property of a compiled language, and the deployments that need it (a microcontroller with kilobytes of flash) run Rust and could not host a Python or .NET runtime at all.

The two things called core#

A binding has one package you never name and one you sometimes do, and they are easy to confuse.

The compiled engine is @pamoja/native, pamoja-native, and Pamoja.Native. It is the built Rust library, the generated contract over it, and the plumbing every facade needs to call it: the handle type, the error every failed call raises, and string marshalling. Every package declares it, so it arrives on its own and you never install it by hand. Rust has no equivalent, because there you compile the crates.

The engine surface is @pamoja/core, pamoja-core, and Pamoja.Core, the counterpart of the pamoja-core crate. It is the runtime version and Transport, the abstraction MQTT, CoAP, and the loopback all implement. It is a capability like any other, listed first in the tables below, and most packages do not depend on it: only the transports do, because they are the ones that return a Transport. Install it when you want to hold a link behind that interface.

Rust#

Shell
cargo add pamoja                        # every capability, behind a feature each
cargo add pamoja-modbus                 # or one crate on its own

From examples/tests/guides/imports.rs:

Rust
use pamoja::modbus::Adu; // the same type as pamoja_modbus::Adu
use pamoja_codec::CborCodec;

Each module of pamoja is the crate of the same name, so the two ways in share one API and one set of documentation, and code moves between them unchanged.

Naming features is what makes a build small. Measured from the resolved dependency graph, for a x86_64-unknown-linux-gnu build:

BuildWhat you writeCrates compiledFrom this workspaceExternal
Every capabilitycargo add pamoja1073176
Codecs and identitycargo add pamoja --no-default-features --features codec,security36432
Field I/Ocargo add pamoja --no-default-features --features field-io660
One capabilitycargo add pamoja --no-default-features --features modbus330
Bare metal, no stdcargo add pamoja --no-default-features --features modbus,sensors,lora550

field-io there is a group feature. Six domains have one, so a build names a domain rather than listing its parts:

cargo add pamoja --features field-io
Sensing and actuation

Sensor drivers, Actuator drivers

cargo add pamoja --features sensing
cargo add pamoja --features radio
cargo add pamoja --features trust
cargo add pamoja --features transports
Profiles and robotics

Device profiles, ROS 2 rules, Zenoh keys

cargo add pamoja --features profiles

The narrow builds carry no third-party code at all: pamoja, pamoja-core, and the capability crates, and nothing else. Most capability crates are no_std, so the same code runs on a gateway and on a microcontroller. The Rust reference lists every crate.

TypeScript and Node#

Shell
npm install pamoja                            # every capability
npm install @pamoja/modbus @pamoja/codec      # or only the packages you use
TypeScript
import { readHoldingRegisters } from '@pamoja/modbus'
import { toCbor, fromCbor } from '@pamoja/codec'

Every package depends on @pamoja/native, the compiled engine, prebuilt for Linux (x64, arm64), macOS (x64, arm64), and Windows (x64); npm picks the right one, and installs on anything else without a binary to load. Alpine and Windows on ARM are the two that catch people out. It is one binary carrying every capability whichever packages you install, so the choice is about the API surface and your dependency manifest, not the download. Node 16 or later.

The same six domains, one package each. A domain package brings in its capabilities and re-exports each under its own name, so a name two of them share stays unambiguous:

npm install @pamoja/field-io
Sensing and actuation@pamoja/sensing

Sensor drivers, Actuator drivers

npm install @pamoja/sensing
Radio and reach@pamoja/radio

LoRa airtime, LoRaWAN, Mesh frames, Routing

npm install @pamoja/radio
Trust and operation@pamoja/trust

Audit log, Secured session, Signed updates, Power, Telemetry

npm install @pamoja/trust
npm install @pamoja/transports
Profiles and robotics@pamoja/profiles

Device profiles, ROS 2 rules, Zenoh keys

npm install @pamoja/profiles

Engine#

Engine surface@pamoja/core

The transport every link shares (send, receive, subscribe, and a faulty wrapper for tests) and the runtime version

npm install @pamoja/core

Identity#

Device identity@pamoja/security

ed25519 device identity: sign a reading and verify it, so a gateway can prove it is authentic

npm install @pamoja/security

Codecs#

Codecs@pamoja/codec

CBOR, JSON, and raw codecs behind one trait, delta and varint batch packing, and an f32 quantizer for metered links

npm install @pamoja/codec

Helpers#

Helpers@pamoja/kit

Plain-language helper math: smoothing, calibration, PID and thermostat control, trend and surge prediction, rolling windows, kinematics, and geo

npm install @pamoja/kit

Field I/O#

Serial framing@pamoja/serial

SLIP and COBS byte stuffing with streaming decoders, so a UART byte stream carries discrete packets

npm install @pamoja/serial
Modbus RTU@pamoja/modbus

Modbus RTU requests and replies with CRC-16/MODBUS for RS485 field devices

npm install @pamoja/modbus
CAN and J1939@pamoja/can

CAN 2.0 and CAN-FD frames with 11- and 29-bit identifiers, plus J1939 decode and compose

npm install @pamoja/can
I2C, SPI, and GPIO@pamoja/gpio

I2C address frames with reserved-range checks, the four SPI clock modes, and active-high or active-low pins

npm install @pamoja/gpio

Sensing and actuation#

Sensor drivers@pamoja/sensors

Datasheet-anchored decoders for eleven parts: the BME280, BMP280, DS18B20, HDC1080, INA219, INA226, ADS1115, OPT3001, SCD4x, SHT3x, and TMP117

npm install @pamoja/sensors
Actuator drivers@pamoja/actuators

PCA9685 PWM and servo pulses, and stepper coil sequencing

npm install @pamoja/actuators

Radio and reach#

LoRa airtime@pamoja/lora

Time-on-air, duty-cycle off-time, and the regional channel plans a LoRa node must keep to

npm install @pamoja/lora
LoRaWAN@pamoja/lorawan

LoRaWAN 1.0.x MAC framing, AES-CMAC and AES encryption, and both halves of the OTAA join

npm install @pamoja/lorawan
Mesh frames@pamoja/mesh

Addressed, hop-limited, CRC-checked frames and duplicate suppression that floods a packet exactly once

npm install @pamoja/mesh
Routing@pamoja/routing

Reverse-path routing that learns the cheapest route from overheard traffic

npm install @pamoja/routing

Trust and operation#

Audit log@pamoja/audit

A tamper-evident, hash-chained log; altering, reordering, or dropping a record breaks verification

npm install @pamoja/audit
Secured session@pamoja/session

X25519 key agreement, HKDF, and ChaCha20-Poly1305 with an anti-replay window, with no TLS stack

npm install @pamoja/session
Signed updates@pamoja/update

Signed firmware manifests, streaming image verification, and A/B slots that fall back on their own

npm install @pamoja/update
Power@pamoja/power

Duty cycling and an energy-aware governor that stretches work as the battery drains

npm install @pamoja/power
Telemetry@pamoja/telemetry

Observability that ships only what is worth the bytes as link cost rises, while counting everything

npm install @pamoja/telemetry

Transports and testing#

MQTT@pamoja/mqtt

An MQTT client with the topic and wildcard rules, as the core transport

npm install @pamoja/mqtt
CoAP@pamoja/coap

A CoAP client over UDP with confirmable delivery and observe

npm install @pamoja/coap
Loopback@pamoja/loopback

An in-process transport with topic matching and a fault injector, for testing with no broker

npm install @pamoja/loopback
Store and forward@pamoja/sync

Offline-first queues: in memory, and a crash-safe on-disk queue that survives power loss

npm install @pamoja/sync
Transport ladder@pamoja/ladder

Cheapest reachable link first, buffering to a store when every link is down

npm install @pamoja/ladder
Event bus@pamoja/bus

An in-memory typed publish and subscribe event bus

npm install @pamoja/bus
Simulators@pamoja/sim

Noisy and replay sensors, a recording actuator, and a simulated robot that dead-reckons its pose

npm install @pamoja/sim

Profiles and robotics#

Device profiles@pamoja/profile

Named, ready-to-run device profiles from plain data or a JSON manifest

npm install @pamoja/profile
ROS 2 rules@pamoja/ros2

ROS 2 names, RIHS01 type hashes, CDR encoding, and rmw_zenoh key assembly, with no ROS 2 installed

npm install @pamoja/ros2
Zenoh keys@pamoja/zenoh

Zenoh key expressions: validity, canonical form, and wildcard matching

npm install @pamoja/zenoh

Python#

Shell
pip install pamoja                          # every capability
pip install pamoja-modbus pamoja-codec      # or only the distributions you use
Python
from pamoja.modbus import read_holding_registers
from pamoja.codec import to_cbor, from_cbor

pamoja is a namespace package: each distribution ships one pamoja.<name> module and they merge on import. Every distribution depends on pamoja-native, the compiled engine, with wheels for the same platforms as the Node engine and for Python 3.10 and later; elsewhere pip builds it from the sdist, which needs a Rust toolchain.

The same six domains, one package each. A domain package brings in its capabilities and re-exports each under its own name, so a name two of them share stays unambiguous:

pip install pamoja-field-io
Sensing and actuationpamoja.sensing

Sensor drivers, Actuator drivers

pip install pamoja-sensing
Radio and reachpamoja.radio

LoRa airtime, LoRaWAN, Mesh frames, Routing

pip install pamoja-radio
Trust and operationpamoja.trust

Audit log, Secured session, Signed updates, Power, Telemetry

pip install pamoja-trust
pip install pamoja-transports
Profiles and roboticspamoja.profiles

Device profiles, ROS 2 rules, Zenoh keys

pip install pamoja-profiles

Engine#

Engine surfacepamoja.core

The transport every link shares (send, receive, subscribe, and a faulty wrapper for tests) and the runtime version

pip install pamoja-core

Identity#

Device identitypamoja.security

ed25519 device identity: sign a reading and verify it, so a gateway can prove it is authentic

pip install pamoja-security

Codecs#

Codecspamoja.codec

CBOR, JSON, and raw codecs behind one trait, delta and varint batch packing, and an f32 quantizer for metered links

pip install pamoja-codec

Helpers#

Helperspamoja.kit

Plain-language helper math: smoothing, calibration, PID and thermostat control, trend and surge prediction, rolling windows, kinematics, and geo

pip install pamoja-kit

Field I/O#

Serial framingpamoja.serial

SLIP and COBS byte stuffing with streaming decoders, so a UART byte stream carries discrete packets

pip install pamoja-serial
Modbus RTUpamoja.modbus

Modbus RTU requests and replies with CRC-16/MODBUS for RS485 field devices

pip install pamoja-modbus
CAN and J1939pamoja.can

CAN 2.0 and CAN-FD frames with 11- and 29-bit identifiers, plus J1939 decode and compose

pip install pamoja-can
I2C, SPI, and GPIOpamoja.gpio

I2C address frames with reserved-range checks, the four SPI clock modes, and active-high or active-low pins

pip install pamoja-gpio

Sensing and actuation#

Sensor driverspamoja.sensors

Datasheet-anchored decoders for eleven parts: the BME280, BMP280, DS18B20, HDC1080, INA219, INA226, ADS1115, OPT3001, SCD4x, SHT3x, and TMP117

pip install pamoja-sensors
Actuator driverspamoja.actuators

PCA9685 PWM and servo pulses, and stepper coil sequencing

pip install pamoja-actuators

Radio and reach#

LoRa airtimepamoja.lora

Time-on-air, duty-cycle off-time, and the regional channel plans a LoRa node must keep to

pip install pamoja-lora
LoRaWANpamoja.lorawan

LoRaWAN 1.0.x MAC framing, AES-CMAC and AES encryption, and both halves of the OTAA join

pip install pamoja-lorawan
Mesh framespamoja.mesh

Addressed, hop-limited, CRC-checked frames and duplicate suppression that floods a packet exactly once

pip install pamoja-mesh
Routingpamoja.routing

Reverse-path routing that learns the cheapest route from overheard traffic

pip install pamoja-routing

Trust and operation#

Audit logpamoja.audit

A tamper-evident, hash-chained log; altering, reordering, or dropping a record breaks verification

pip install pamoja-audit
Secured sessionpamoja.session

X25519 key agreement, HKDF, and ChaCha20-Poly1305 with an anti-replay window, with no TLS stack

pip install pamoja-session
Signed updatespamoja.update

Signed firmware manifests, streaming image verification, and A/B slots that fall back on their own

pip install pamoja-update
Powerpamoja.power

Duty cycling and an energy-aware governor that stretches work as the battery drains

pip install pamoja-power
Telemetrypamoja.telemetry

Observability that ships only what is worth the bytes as link cost rises, while counting everything

pip install pamoja-telemetry

Transports and testing#

MQTTpamoja.mqtt

An MQTT client with the topic and wildcard rules, as the core transport

pip install pamoja-mqtt
CoAPpamoja.coap

A CoAP client over UDP with confirmable delivery and observe

pip install pamoja-coap
Loopbackpamoja.loopback

An in-process transport with topic matching and a fault injector, for testing with no broker

pip install pamoja-loopback
Store and forwardpamoja.sync

Offline-first queues: in memory, and a crash-safe on-disk queue that survives power loss

pip install pamoja-sync
Transport ladderpamoja.ladder

Cheapest reachable link first, buffering to a store when every link is down

pip install pamoja-ladder
Event buspamoja.bus

An in-memory typed publish and subscribe event bus

pip install pamoja-bus
Simulatorspamoja.sim

Noisy and replay sensors, a recording actuator, and a simulated robot that dead-reckons its pose

pip install pamoja-sim

Profiles and robotics#

Device profilespamoja.profile

Named, ready-to-run device profiles from plain data or a JSON manifest

pip install pamoja-profile
ROS 2 rulespamoja.ros2

ROS 2 names, RIHS01 type hashes, CDR encoding, and rmw_zenoh key assembly, with no ROS 2 installed

pip install pamoja-ros2
Zenoh keyspamoja.zenoh

Zenoh key expressions: validity, canonical form, and wildcard matching

pip install pamoja-zenoh

C# and .NET#

Shell
dotnet add package Pamoja                        # every capability
dotnet add package Pamoja.Modbus Pamoja.Codec    # or only the packages you use
C#
using Pamoja.Modbus;
using Pamoja.Codec;

A domain package there brings in its capabilities and ships no assembly of its own, since C# has no way to re-export a namespace, so a type is named the way it is when its package is referenced directly.

Each package is one namespace of the same name. Every package depends on Pamoja.Native, which carries the native library for win-x64, linux-x64, linux-arm64, osx-x64, and osx-arm64, and targets .NET 8. Those five are the whole list: on any other runtime identifier, win-arm64 and the musl-based distributions among them, the packages restore and compile and then throw DllNotFoundException on the first call, because there is no native library to load and, unlike Python, no source build to fall back on.

The same six domains, one package each. A domain package brings in its capabilities and re-exports each under its own name, so a name two of them share stays unambiguous:

dotnet add package Pamoja.FieldIo
Sensing and actuation

Sensor drivers, Actuator drivers

dotnet add package Pamoja.Sensing
dotnet add package Pamoja.Radio
dotnet add package Pamoja.Trust
dotnet add package Pamoja.Transports
Profiles and robotics

Device profiles, ROS 2 rules, Zenoh keys

dotnet add package Pamoja.Profiles

Engine#

Engine surfacePamoja.Core

The transport every link shares (send, receive, subscribe, and a faulty wrapper for tests) and the runtime version

dotnet add package Pamoja.Core

Identity#

Device identityPamoja.Security

ed25519 device identity: sign a reading and verify it, so a gateway can prove it is authentic

dotnet add package Pamoja.Security

Codecs#

CodecsPamoja.Codec

CBOR, JSON, and raw codecs behind one trait, delta and varint batch packing, and an f32 quantizer for metered links

dotnet add package Pamoja.Codec

Helpers#

HelpersPamoja.Kit

Plain-language helper math: smoothing, calibration, PID and thermostat control, trend and surge prediction, rolling windows, kinematics, and geo

dotnet add package Pamoja.Kit

Field I/O#

Serial framingPamoja.Serial

SLIP and COBS byte stuffing with streaming decoders, so a UART byte stream carries discrete packets

dotnet add package Pamoja.Serial
Modbus RTUPamoja.Modbus

Modbus RTU requests and replies with CRC-16/MODBUS for RS485 field devices

dotnet add package Pamoja.Modbus
CAN and J1939Pamoja.Can

CAN 2.0 and CAN-FD frames with 11- and 29-bit identifiers, plus J1939 decode and compose

dotnet add package Pamoja.Can
I2C, SPI, and GPIOPamoja.Gpio

I2C address frames with reserved-range checks, the four SPI clock modes, and active-high or active-low pins

dotnet add package Pamoja.Gpio

Sensing and actuation#

Sensor driversPamoja.Sensors

Datasheet-anchored decoders for eleven parts: the BME280, BMP280, DS18B20, HDC1080, INA219, INA226, ADS1115, OPT3001, SCD4x, SHT3x, and TMP117

dotnet add package Pamoja.Sensors
Actuator driversPamoja.Actuators

PCA9685 PWM and servo pulses, and stepper coil sequencing

dotnet add package Pamoja.Actuators

Radio and reach#

LoRa airtimePamoja.Lora

Time-on-air, duty-cycle off-time, and the regional channel plans a LoRa node must keep to

dotnet add package Pamoja.Lora
LoRaWANPamoja.Lorawan

LoRaWAN 1.0.x MAC framing, AES-CMAC and AES encryption, and both halves of the OTAA join

dotnet add package Pamoja.Lorawan
Mesh framesPamoja.Mesh

Addressed, hop-limited, CRC-checked frames and duplicate suppression that floods a packet exactly once

dotnet add package Pamoja.Mesh
RoutingPamoja.Routing

Reverse-path routing that learns the cheapest route from overheard traffic

dotnet add package Pamoja.Routing

Trust and operation#

Audit logPamoja.Audit

A tamper-evident, hash-chained log; altering, reordering, or dropping a record breaks verification

dotnet add package Pamoja.Audit
Secured sessionPamoja.Session

X25519 key agreement, HKDF, and ChaCha20-Poly1305 with an anti-replay window, with no TLS stack

dotnet add package Pamoja.Session
Signed updatesPamoja.Update

Signed firmware manifests, streaming image verification, and A/B slots that fall back on their own

dotnet add package Pamoja.Update
PowerPamoja.Power

Duty cycling and an energy-aware governor that stretches work as the battery drains

dotnet add package Pamoja.Power
TelemetryPamoja.Telemetry

Observability that ships only what is worth the bytes as link cost rises, while counting everything

dotnet add package Pamoja.Telemetry

Transports and testing#

MQTTPamoja.Mqtt

An MQTT client with the topic and wildcard rules, as the core transport

dotnet add package Pamoja.Mqtt
CoAPPamoja.Coap

A CoAP client over UDP with confirmable delivery and observe

dotnet add package Pamoja.Coap
LoopbackPamoja.Loopback

An in-process transport with topic matching and a fault injector, for testing with no broker

dotnet add package Pamoja.Loopback
Store and forwardPamoja.Sync

Offline-first queues: in memory, and a crash-safe on-disk queue that survives power loss

dotnet add package Pamoja.Sync
Transport ladderPamoja.Ladder

Cheapest reachable link first, buffering to a store when every link is down

dotnet add package Pamoja.Ladder
Event busPamoja.Bus

An in-memory typed publish and subscribe event bus

dotnet add package Pamoja.Bus
SimulatorsPamoja.Sim

Noisy and replay sensors, a recording actuator, and a simulated robot that dead-reckons its pose

dotnet add package Pamoja.Sim

Profiles and robotics#

Device profilesPamoja.Profile

Named, ready-to-run device profiles from plain data or a JSON manifest

dotnet add package Pamoja.Profile
ROS 2 rulesPamoja.Ros2

ROS 2 names, RIHS01 type hashes, CDR encoding, and rmw_zenoh key assembly, with no ROS 2 installed

dotnet add package Pamoja.Ros2
Zenoh keysPamoja.Zenoh

Zenoh key expressions: validity, canonical form, and wildcard matching

dotnet add package Pamoja.Zenoh

Edit this page on GitHub