Profiles#
A profile is a node written down as data: what it reads, when it switches its output,
where it reports, how often it samples as its battery drains, and how a dashboard draws
it. These are the profiles that ship: the four presets the library builds in and four
written for the catalog. Each is a JSON file under profiles/, loaded in CI by the
parser a device uses and kept in the form the library writes, so a change to one is a
change of meaning and nothing else.
Using one#
The numbers are a starting point, meant to be edited to the bed, the fridge, or the river in front of you.
| To | Do this |
|---|---|
| Run it with no program | Write a wiring file naming the site's part, output line, and broker, and run pamoja-node. |
| Run it in a program | Load it with Profile::, fromJson, from_json, or FromJson, and hand it to a Node with your own parts, as the guide shows. |
| Tune it | Edit the file. Its $schema line lets an editor check each field as you type, and the field tables say what each one does. |
| Share yours | One file and one pull request, no Rust: the community page has the steps and what CI checks. |
profiles/brooder-heater.jsonKeeps a poultry brooder at 32 C by switching a heat lamp on below 31.5 C and off above 32.5 C, and alerts when the chicks are more than 4 C from target. Samples every two minutes on a healthy battery and eases off as it drains.
- Reads temperature in celsius, and publishes on
poultry/brooder/temperature. - Holds 32 by switching the output on below 31.5 and off above 32.5, and alerts outside 28 to 36.
- Samples every 2 min, every 10 min below 50 % charge, and every 30 min below 20 %.
- Draws Brooder temperature as a thermometer in celsius with a safe band of 28 to 36; Heat lamp as a switch in state.
curl -O https://raw.githubusercontent.com/molexxxx/pamoja/main/profiles/brooder-heater.jsonprofiles/flood-sensor.jsonWatches a river gauge and warns when the level rises more than 0.3 m in one sample, the signature of a flash flood. Samples every minute, since a flood gives little warning.
- Reads water level in meter, and publishes on
water/river/level. - Warns when the reading rises by more than 0.3 in one sample.
- Samples every 1 min, every 5 min below 50 % charge, and every 15 min below 20 %.
- Draws River level as a wave in meter with a safe band of 0.2 to 2.5; Rainfall as a bar in millimeter with a safe band of 0 to 25.
curl -O https://raw.githubusercontent.com/molexxxx/pamoja/main/profiles/flood-sensor.jsonprofiles/grain-store-humidity.jsonReports the relative humidity in a grain store without driving anything, drawn as a droplet with a safe band up to 65 %, above which stored cereal takes on the moisture that mold grows in. Samples every 10 minutes, since a store changes slowly.
- Reads relative humidity in percent, and publishes on
storage/grain/humidity. - Reports readings and drives nothing.
- Samples every 10 min, every 1 hour below 50 % charge, and every 2 hours below 20 %.
- Draws Store humidity as a droplet in percent with a safe band of 30 to 65; Store temperature as a thermometer in celsius with a safe band of 5 to 30.
curl -O https://raw.githubusercontent.com/molexxxx/pamoja/main/profiles/grain-store-humidity.jsonprofiles/irrigation-node.jsonOpens an irrigation valve when soil moisture falls below 30 % and closes it again above 40 %, and alerts when the soil dries below 10 % or is waterlogged above 60 %. Samples slowly, since soil changes over hours and the battery has to last.
- Reads soil moisture in percent, and publishes on
farm/irrigation/soil-moisture. - Holds 35 by switching the output on below 30 and off above 40, and alerts outside 10 to 60.
- Samples every 5 min, every 30 min below 50 % charge, and every 1 hour below 20 %.
- Draws Soil moisture as a droplet in percent with a safe band of 10 to 60; Drip valve as a valve in state.
curl -O https://raw.githubusercontent.com/molexxxx/pamoja/main/profiles/irrigation-node.jsonprofiles/pipeline-pressure-drop.jsonWatches the pressure in a water main and warns when it falls by more than 0.5 bar between samples, the signature of a burst or a valve left open downstream. Samples every 30 s, since a burst empties a tank in minutes.
- Reads pressure in bar, and publishes on
water/main/pressure. - Warns when the reading falls by more than 0.5 in one sample.
- Samples every 30 s, every 2 min below 40 % charge, and every 10 min below 15 %.
- Draws Main pressure as a dial in bar with a safe band of 2 to 6.
curl -O https://raw.githubusercontent.com/molexxxx/pamoja/main/profiles/pipeline-pressure-drop.jsonprofiles/soil-moisture-valve.jsonWaters a raised bed through a solenoid valve, opening it when the volumetric water content falls below 25 % and closing it above 35 %, and alerts when the bed is drier than 15 % or wetter than 45 %. The dashboard draws the bed as a droplet and the valve as a valve, with French and Swahili labels.
- Reads soil moisture in percent, and publishes on
garden/bed/moisture. - Holds 30 by switching the output on below 25 and off above 35, and alerts outside 15 to 45.
- Samples every 5 min, every 30 min below 50 % charge, and every 1 hour below 20 %.
- Draws Soil moisture as a droplet in percent with a safe band of 25 to 45; Bed valve as a valve in state.
curl -O https://raw.githubusercontent.com/molexxxx/pamoja/main/profiles/soil-moisture-valve.jsonprofiles/vaccine-fridge-monitor.jsonHolds a vaccine fridge at 5 C by switching its cooler, and raises an alert the moment the temperature leaves the 2 to 8 C safe range. Keeps sampling often as the battery drains, since an unnoticed excursion costs more than a flat battery.
- Reads temperature in celsius, and publishes on
cold-chain/fridge/temperature. - Holds 5 by switching the output on above 5.5 and off below 4.5, and alerts outside 2 to 8.
- Samples every 1 min, every 5 min below 50 % charge, and every 15 min below 20 %.
- Draws Fridge temperature as a thermometer in celsius with a safe band of 2 to 8; Cooler as a switch in state; Compressor duty as a bar in percent with a safe band of 0 to 60, a node stat.
curl -O https://raw.githubusercontent.com/molexxxx/pamoja/main/profiles/vaccine-fridge-monitor.jsonprofiles/well-level.jsonReports a well's water level and warns once the level is on course to reach the dry mark within six more samples, so a pump is stopped before it runs dry.
- Reads water level in meter, and publishes on
water/well/level. - Watches a falling level and warns once it is on course to reach 0.5 within 6 more samples.
- Samples every 10 min, every 30 min below 50 % charge, and every 1 hour below 20 %.
- Draws Well level as a bar in meter with a safe band of 1 to 6; Battery as a battery in volt with a safe band of 3.5 to 4.3, a node stat.
curl -O https://raw.githubusercontent.com/molexxxx/pamoja/main/profiles/well-level.json