<!-- The Markdown twin of https://api.kleidos.dev/meter/, converted from that page at build time. The page is the original; these are the same words, with the markup taken off. -->
Canonical: https://api.kleidos.dev/meter/

**In development.** It changes without notice.

# The bench meter's documentation

The bench meter measures what each Kleidos board draws: an ESP32-S3 reading a TI INA228 across a 0.1 Ω shunt in the board's battery lead, with a relay pair that takes the offset null without hands. It speaks SCPI over its serial line and nothing else, and a host package on the PC (`kleidos-meter`) gives it a command line, a Python interface and a panel in the browser. These pages are its documentation, the usage and the firmware's reference together, in English. Each is a Markdown file of the repository, and reads the same there.

## Reading order

1. **Start**: what the instrument is and the quick start on the simulated instrument, in [the repository's README](https://api.kleidos.dev/meter/readme_page#quick-start); then a measuring session in order, in [the usage guide](https://api.kleidos.dev/meter/usage_page).
2. **The panel**: [the panel](https://api.kleidos.dev/meter/panel_page), `kleidos-meter serve`, every view with its image.
3. **The command line**: [every command of `kleidos-meter`](https://api.kleidos.dev/meter/cli_page), what it takes and exits with.
4. **The HTTP API**: [the panel's routes](https://api.kleidos.dev/meter/http_api_page), for a script that drives the panel.
5. **SCPI**: [the protocol](https://api.kleidos.dev/meter/scpi_page), every command, report key, error number and stream record.
6. **The rig and its wiring**: [the schematic](https://api.kleidos.dev/meter/hardware_page), normative for the wiring, then [the wiring guide](https://api.kleidos.dev/meter/rig_wiring_page), [the carrier board](https://api.kleidos.dev/meter/carrier_board_page), [the Relay 2 Click](https://api.kleidos.dev/meter/relay2_click_wiring_page) and [the parts](https://api.kleidos.dev/meter/bom_page).
7. **Calibration**: [what the calibration is](https://api.kleidos.dev/meter/calibration_page), the null and the shunt's two points.
8. **Troubleshooting**: [what a wrong answer, a refusal or an error number usually means](https://api.kleidos.dev/meter/troubleshooting_page).
9. **Testing**: [every test, the report and its gates](https://api.kleidos.dev/meter/testing_page), and the bench suite.
10. **The firmware's reference**: [the firmware](https://api.kleidos.dev/meter/firmware_page), its boot, its two tasks and every symbol by topic, with [its design](https://api.kleidos.dev/meter/architecture_page).
11. **The Python host package**: [its public interface](https://api.kleidos.dev/meter/python_api_page), class by class, and [how the package is made](https://api.kleidos.dev/meter/host_page).

The rest, by what you are doing:

## Use the meter

| Document | What it answers |
| --- | --- |
| [The usage guide](https://api.kleidos.dev/meter/usage_page) | How a measuring session goes: the port, the line, the calibration, the null, a measurement, a capture, its export, the relays, the end state |
| [The panel's guide](https://api.kleidos.dev/meter/panel_page) | The panel (`kleidos-meter serve`): starting it, every view with its image, the chart (the mean line, the band, smoothing, the readout, the view's exports), the pin view (what each mark means, how a change is applied, proved and undone from the console), the INA228's noise reduction, what each sequence moves, exports, the passthrough, and what happens when something dies |
| [The command line's reference](https://api.kleidos.dev/meter/cli_page) | Every command of `kleidos-meter`: what it takes, what it exits with, an example. Generated |
| [The Python API's reference](https://api.kleidos.dev/meter/python_api_page) | The host package from Python: every public class, method and function. Generated |
| [The HTTP API's reference](https://api.kleidos.dev/meter/http_api_page) | The panel's HTTP API, route by route: what each takes, answers and sends. Generated |
| [The troubleshooting guide](https://api.kleidos.dev/meter/troubleshooting_page) | What a wrong answer, a refusal or an error number usually means, the panel's chart, its noise reduction and a reverted pin map included: the query that checks it, the fix, and where it is defined |
| [The SCPI command set](https://api.kleidos.dev/meter/scpi_page) | What each command, report key, error number and stream record is, and a quick reference of the ones a session sends. The protocol, normative |
| [The calibration guide](https://api.kleidos.dev/meter/calibration_page) | What the calibration is, what each verdict asks of you, the normative null, the two-point shunt calibration, its uncertainty, and how the QA harness's pin follows it |
| [The host package's README](https://api.kleidos.dev/meter/host_page) | The host package and how it is made: the Python client, the panel's process, its recordings, the simulated instrument |
| [The changelog](https://api.kleidos.dev/meter/changelog_page) | What each version changed on the wire, and what the Kleidos QA harness must know of it |

The panel's images, every view dark and light at a desktop's width and dark at a phone's, are in [images/panel/](https://github.com/kleidos-dev/meter/tree/main/docs/images/panel), taken from `kleidos-meter serve --sim` by `scripts/take_panel_shots.py`; `tests/firmware/test_panel_images.py` names the one to take again when its view changes. Under [images/panel/bench/](https://github.com/kleidos-dev/meter/tree/main/docs/images/panel/bench), the panel over the cable to the meter, each image with its date and the image's `elf=` ([“On the bench” in the panel's guide](https://api.kleidos.dev/meter/panel_page#on-the-bench)), filed by `scripts/file_bench_shots.py`.

## Build the rig

| Document | What it answers |
| --- | --- |
| [The wiring guide](https://api.kleidos.dev/meter/rig_wiring_page) | What to measure before wiring, every wire as a row, the checks before power, the first test |
| [The carrier board's guide](https://api.kleidos.dev/meter/carrier_board_page) | Which terminal of the ESP32-S3 carrier is which pin, which to use, and which USB port is which |
| [The Relay 2 Click guide](https://api.kleidos.dev/meter/relay2_click_wiring_page) | How the Relay 2 Click is fitted as the shunt bypass |
| [The schematic's page](https://api.kleidos.dev/meter/hardware_page) | The schematic, normative for the wiring, and how it is generated |
| [The bill of materials](https://api.kleidos.dev/meter/bom_page) | The parts, and which are on hand |
| [The repository's README](https://api.kleidos.dev/meter/readme_page) | What the instrument is, and how it is built and flashed |

## Develop the firmware

| Document | What it answers |
| --- | --- |
| [The firmware's architecture](https://api.kleidos.dev/meter/architecture_page) | The design as it is: the sensor, what is measured and how, the tasks, the hot path, the relays |
| [The INA228 reference](https://api.kleidos.dev/meter/ina228_reference_page) | The INA228's registers and scaling, as this instrument uses them |
| [The testing guide](https://api.kleidos.dev/meter/testing_page) | Every test, the report and its gates, and the bench suite |
| [The MISRA record](https://api.kleidos.dev/meter/misra_page) | What the firmware holds of MISRA C++:2023, where it departs, and what allocates before [`app_main()`](https://api.kleidos.dev/meter/group__app__entry#ga630544a7f0a2cc40d8a7fefab7e2fe70) |
| [The relay timings](https://api.kleidos.dev/meter/relay_timing_page) | How long the relays' contacts take, as measured, against the settle waits |
| [The repository's rules](https://api.kleidos.dev/meter/agents_page) | The rules of this repository, for a person or an agent changing it |

This site (`mkdir -p build && doxygen Doxyfile`, into `build/doxygen/html`) is these pages and the firmware's reference, which documents every symbol of `firmware/src`; the reference opens on [its front page](https://api.kleidos.dev/meter/firmware_page) (`docs/firmware.dox`) and lists [its topics](https://api.kleidos.dev/meter/topics) (`docs/groups.dox`). As it is published, in the Kleidos design, it is built by `python3 scripts/build_reference.py --out <dir>` ([“The documentation site” in the testing guide](https://api.kleidos.dev/meter/testing_page#the-documentation-site)).

## History

Records of their date, kept as they were written: nothing here describes the instrument as it is now.

| Document | What it records |
| --- | --- |
| [The first design](https://api.kleidos.dev/meter/firmware_design_page) | The design of firmware 0.1.0, frozen on 2026-11-22 |
| [The record of 2026-11-19](https://api.kleidos.dev/meter/calibration_record_2026_11_19_page), [the record of 2026-11-20](https://api.kleidos.dev/meter/calibration_record_2026_11_20_page) | The calibrations before the registry |
| [The radio A/B's record](https://api.kleidos.dev/meter/calibration_record_radio_ab_2026_11_21_page), [the radio A/B's addendum](https://api.kleidos.dev/meter/calibration_record_radio_tx_sweep_2026_11_21_page) | The radio test that failed and made the meter serial-only, and its addendum |
