Community#
pamoja means together. The people who know a field, a river, a clinic, or a workshop can add what they know without becoming Rust engineers, and what they add is held to the same bar as the rest: it runs, CI checks it, and it is documented where the next person will look.
| Add | What it is | Checked by | No toolchain? |
|---|---|---|---|
| A profile | one JSON file | cargo xtask profiles | share a profile |
| An example | one program that runs with nothing plugged in | CI runs it on every change | share an example |
| A driver | a decoder written from a datasheet | the audit checklist below | contribute a driver |
| A board | a page and a program that compiles | CI builds the program | capability request |
The rules for code are in CONTRIBUTING.md, and the building page runs everything locally.
Share a profile#
A profile is a node's behavior as data, so sharing one needs no code.
- Start from the closest one in the catalog and change the numbers
to the ones that worked: the setpoint and its deadband, the safe band, the sampling
intervals your battery allowed. Give it a
namein lowercase words joined by hyphens, areads, atopic, and a one or two sentencedescription. Keep the$schemaline, and an editor such as VS Code checks every field as you type. - Run it.
pamoja-nodeplays readings through it with nothing wired, or on the real part, and the device profiles guide loads it in any of the four languages. - Check it. Save it as
profiles/<name>.jsonand runcargo xtask profiles, which reads it with the parser a device uses and rewrites it into the library's own form.cargo xtask docsthen adds it to the catalog. - Open a pull request with the file and the regenerated page. The template asks how it was tested; "ran on a Pi in a chicken house for a week" is the right kind of answer.
Without a Rust toolchain, paste the manifest into the share a profile form, and a maintainer runs the steps and credits you in the pull request.
What every listed profile has been held to:
- Fields: every field is one the published schema has.
- Identity: the name matches the file and is unique, and the description reads as a sentence.
- Reading:
readsnames the quantity and unit, and the topic is one publishable path with no wildcards. - Policy: a setpoint has a deadband above zero and a safe band no narrower than it; a level warns at least one sample ahead; a surge has a limit above zero; a custom kind is named in lowercase words joined by underscores.
- Power: the sampling intervals do not shorten as the battery drains, and the two thresholds sit between zero and one in order.
- Drawing: every dashboard element has a snake_case key used once, a unit, a label,
a band with its low end first, and a starting state the dashboard has words for,
shipped or supplied under
messageswith anentext.
Share an example#
An example is a complete program with a main, written to be read top to
bottom, that runs with nothing plugged in because a simulator or the loopback transport
stands in for the hardware. CI runs every one on every change.
- Write it as
examples/community/<name>.rs. The module doc's first paragraph is what the examples page shows, and a line readingRun with:followed by a command in backticks is the command beside it. Say who wrote it in the doc. - Register it in
examples/Cargo.tomlas an[[example]]whosepathiscommunity/<name>.rs, and run it withcargo run -p pamoja-examples --example <name>. It must finish on its own and print what it found. - Run
cargo xtask docs, which lists it under "Community programs", and open a pull request.
A program in TypeScript, Python, or C# is welcome too: name the language in the share an example form, and it lands beside that language's guide examples.
Contribute a driver#
A driver decodes a part from the manufacturer's datasheet and nothing else, runs it
over the bus traits, and implements Sensor or Actuator, so the
kit, the profiles, and the dashboard take it like the ones that ship. The
your own device guide covers a part that stays in your own tree;
this is the path for one that ships with pamoja.
Claim the part first with the contribute a driver form and a link to the datasheet, so two people do not write the same decoder. Then work through the audit every shipped driver went through:
- Source. The datasheet is the manufacturer's own, linked from a new entry in
docs/hardware.tomlwith the figures the hardware page shows, a price band, and two or three places to buy it.cargo xtask linksmust fetch it; a vendor page that refuses scripted readers is marked as such, never swapped for a mirror. - Decoder. The module in
pamoja-sensorsorpamoja-actuatorsisno_std, has no dependencies, and names every register, command word, timing, and formula. - Constants. Each one is found in the datasheet text in every spelling a datasheet
uses (hex with and without
0x, zero-padded, decimal, scaled). A value split across table columns is checked by reading the table. - Formulas. Each is recomputed from the datasheet in a script, without reading the module first, and reproduces the values the tests assert.
- Registers. Every layout is checked field by field against the datasheet's table, reserved bits included.
- Tests. They anchor to the datasheet's own worked examples and check values, not only round trips. When code and datasheet disagree, find which other printed value the datasheet's number matches before blaming the code; a misprint has been found this way.
- Driver. It runs the part's transfer sequence over the bus traits, tested against a scripted bus playing the part's side.
- Docs. The hardware entry claims the module, so
cargo xtask docs --checkties the two together, and the sensors or actuators guide names the part. - Bindings. A decoded value that crosses into the bindings reaches all three, with a conformance vector every language asserts.
- Changelog. The entry says what the part is and which document it was written from.
Add a board#
A board is documentation and a program, not a type:
- A page under
docs/boards/with the board's pins for each bus, wiring for one shipped part, the settings or toolchain it needs, and every figure linked to the maker's own documentation. - A program under
examples/boards/, a standalone package with its own empty[workspace]table and a.cargo/config.tomlnaming its target and runner, which reads the part through the shipped driver. CI builds it from its directory on every change. - A card in
docs/hardware.tomlwhosepagefield names the page.
The ESP32 page is the shape to copy for a chip with its own Rust hardware layer, and the RP2040 page for one on a community layer.
Report and request#
| You found | Where it goes |
|---|---|
| Something that behaves differently from its documentation | bug |
| A part, protocol, or job pamoja cannot do yet | capability request |
| A page that is wrong, unclear, or missing | documentation problem |
| A vulnerability | the private channel in SECURITY.md, never a public issue |