pamoja

An SDK for IoT, robotics, and drones

pamojaRev 0.2.0MIT licensepamoja.molex.cloud

Rust reference#

Every crate, generated by rustdoc from this commit. Each row below opens a crate's API pages, and the same capability in the other three languages is one step away.

The same documentation for each published version is on docs.rs. Each crate's README, on crates.io and in the repository, is its overview and getting-started page, generated from the same rustdoc.

By domain#

The pamoja crate is every capability crate behind a feature each, all on by default; pamoja::mqtt is pamoja-mqtt, with the same types and documentation. Six of its features name a domain instead of a single capability, one per chapter that holds more than one:

cargo add pamoja --no-default-features --features std,field-io
cargo add pamoja --no-default-features --features std,sensing
cargo add pamoja --no-default-features --features std,radio
cargo add pamoja --no-default-features --features std,trust
cargo add pamoja --no-default-features --features std,profiles

Naming features is what makes a Rust build small, and the install page measures how small per feature set.

Every capability#

One row per capability: the crate to add, its reference here and on docs.rs, the guide with the worked example, and the same capability on the other three reference pages, one step away.

Engine#

Your own devicepamoja-core

A sensor and an actuator pamoja has never heard of, written against the core traits, run against a rule, and published with nothing plugged in

cargo add pamoja-core
Engine surfacepamoja-core

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

cargo add pamoja-core

Identity#

Device identitypamoja-security

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

cargo add pamoja-security

Codecs#

Codecspamoja-codec

CBOR, JSON, and raw codecs behind one trait, and batch packing for metered links: delta and varint for integers, and a quantizer for f32 readings

cargo add pamoja-codec

Helpers#

Helperspamoja-kit

Plain-language helper math: smoothing, calibration, PID and thermostat control, a trigger with hysteresis, trend and surge prediction, rolling windows, unit conversions, geo, and robot motion

cargo add pamoja-kit

Field I/O#

Serial framingpamoja-serial

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

cargo add pamoja-serial
Modbus RTUpamoja-modbus

Modbus RTU for RS485 field devices: a client that polls them over a serial port with the line's timing, simulated devices that answer as real ones do, and the frames with their CRC-16/MODBUS

cargo add pamoja-modbus
CAN and J1939pamoja-can

CAN 2.0 and CAN FD frames with 11- and 29-bit identifiers, J1939 decode and compose, and a node on a bus, simulated or a Linux interface through SocketCAN

cargo add pamoja-can
I2C, SPI, and GPIOpamoja-gpio

I2C address frames with reserved-range checks, the four SPI clock modes, active-high or active-low switches and contacts, and GPIO lines opened on a Linux board

cargo add pamoja-gpio
Busespamoja-hal

The embedded-hal traits every driver takes, a bit-banged 1-Wire bus, simulated parts and scripted buses that stand in for hardware, the Linux backends over i2c-dev, spidev, and the GPIO character device, one I2C bus and one serial port a program and its drivers share, and delays that sleep or only count

cargo add pamoja-hal

Sensing and actuation#

Sensor driverspamoja-sensors

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

cargo add pamoja-sensors
Actuator driverspamoja-actuators

A PCA9685 driver for servos, LEDs, and valves, and stepper drivers for four coil lines or a step and direction chip, in every language

cargo add pamoja-actuators

Radio and reach#

LoRa airtime and rangepamoja-lora

Time-on-air, duty-cycle off-time, the regional channel plans a LoRa node must keep to, and the link budget that sets its range

cargo add pamoja-lora
LoRaWANpamoja-lorawan

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

cargo add pamoja-lorawan
LoRa radiospamoja-radios

The Semtech SX126x and SX127x LoRa radios and the SX1302 and SX1303 gateway concentrators: their commands, registers, and decoders, the amplifier setting a regional EIRP ceiling allows, a duty-cycle guard, and simulated chips that stand in for a module

cargo add pamoja-radios
LoRaWAN gatewayspamoja-gateway

What a LoRaWAN gateway speaks: the Semtech packet forwarder protocol and the Basics Station protocol on both sides, the network side of a single site, and a bridge from the radio to the link that leaves it

cargo add pamoja-gateway
Mesh framespamoja-mesh

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

cargo add pamoja-mesh
Routingpamoja-routing

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

cargo add pamoja-routing

Trust and operation#

Audit logpamoja-audit

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

cargo add pamoja-audit
Secured sessionpamoja-session

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

cargo add pamoja-session
Signed updatespamoja-update

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

cargo add pamoja-update
Powerpamoja-power

Duty cycling and an energy-aware governor that stretches work as the battery drains and holds its mode against a wandering charge

cargo add pamoja-power
Telemetrypamoja-telemetry

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

cargo add pamoja-telemetry

Transports and testing#

MQTTpamoja-mqtt

An MQTT client with the topic and wildcard rules, acknowledged delivery, retained messages, a last will, and TLS, as the core transport

cargo add pamoja-mqtt
CoAPpamoja-coap

A CoAP client and the server it reports to, over UDP, with confirmable delivery and observe

cargo add pamoja-coap
Loopbackpamoja-loopback

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

cargo add pamoja-loopback
Store and forwardpamoja-sync

Offline-first queues in memory or on disk, bounded or not, the on-disk one surviving power loss, and the drain that forwards them in order when a link returns

cargo add pamoja-sync
Transport ladderpamoja-ladder

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

cargo add pamoja-ladder
Event buspamoja-bus

An in-memory typed publish and subscribe event bus, with publishers that never wait and subscribers that count what they miss

cargo add pamoja-bus
Simulatorspamoja-sim

Noisy and replay sensors, a recording actuator, a simulated robot that dead-reckons its pose, and a link that loses sends on a pattern

cargo add pamoja-sim

Profiles and robotics#

Device profilespamoja-profile

Named, ready-to-run device profiles from plain data or a JSON manifest, run as a node in every language

cargo add pamoja-profile
Rulespamoja-core

Rules between nodes as a file: a condition over one node's topic with hysteresis, and the actions that drive another node's actuator or publish, run by an engine off any link in every language, or judged reading by reading

cargo add pamoja-core
Robot motionpamoja-core

Wheel speeds for differential, skid-steer, car-like, and mecanum chassis, a two-link arm and Denavit-Hartenberg forward kinematics, odometry, waypoint guidance, a safety gate, and servo, ESC, and encoder conversions

cargo add pamoja-core
ROS 2 rulespamoja-ros2

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

cargo add pamoja-ros2
Zenoh keyspamoja-zenoh

Zenoh key expressions: validity, canonical form, matching, and whether two expressions share or cover keys

cargo add pamoja-zenoh

The engine and the bundle#

The engine crates define the traits (Transport, Device, Sensor, Actuator, Store, the event bus) that every capability crate implements, the C ABI the .NET binding rides on, and the fleet dashboard. The bundle is every capability above behind a feature each.

ChapterCrateWhat it does
EverythingpamojaThe whole pamoja device SDK in one crate: every capability behind a feature, all on by default, for IoT, robotics, and drones.
Enginepamoja-coreCore engine for the pamoja device SDK: device model, transport, event bus, and error types.
pamoja-ffiCurated C ABI surface over the pamoja device SDK, for C, C++, and .NET.
pamoja-dashboardLocal-first device dashboard for pamoja: a node serves a hand-built, localized web UI on its local network from a language-neutral state snapshot, fully offline.

Edit this page on GitHub