Sourced from
docs/tools-and-commands.mdin the firmware repo.
Tools & Commands
The catalog of every script, build environment, console command, and remote owner command in the repository - what each one does and when you reach for it.
Two audiences, one page:
- User tools - what you need to install, recover, and manage a device you own. Setting one up needs only these.
- Contributor tools - everything for working on the firmware itself: golden-image review, vector generators, CI gates, build environments, and the serial test console.
All host scripts live in tools/ and run with python3 from the repository
root unless noted. Most need only the standard library. For a one-line-per-tool
index grouped by audience, including which scripts CI and the build depend on,
see tools/README.md.
These are workshop tools for people building or servicing boards. A device owner configures connectors, credentials, and everything else from the device's web page (Assistant, then Connectors), never from this repository.
User tools
Device setup & recovery
| Tool | What it does | When you need it |
|---|---|---|
bench_guard.py | The one forbidden-device guard: every tool that opens, resets, flashes or scans a USB port asks it first. It reads the USB serial number (which equals the MAC on a native USB port) from the operating system's listing, never opening the port, and refuses the off-limits boards, an anonymous Espressif port, and any port it cannot identify. Command line: list (every node, its serial, refused or not), check-port <port>, check-mac <mac>, port-for-mac <mac>. NIMBUS_BENCH_ALLOW_MAC=<mac> lifts the refusal for exactly one named board, on purpose, and every use is printed. | Before pointing any port-touching tool at an attached board: to see what is plugged in and that it is not an off-limits one. |
setup_device.py | Guarded firmware installer over USB. Discovers connected boards by USB descriptor, auto-detects the board family (Nimbus board or Freenove CYD) from USB plus the saved NVS, and confirms with an identify-and-confirm prompt before writing anything. On a new board it seeds the display, orientation, operating mode, and typed-OTA slug, then installs the production image for the board and display size (`--size 28 | 35 |
usb_reset.py | Programmatic unbrick for a wedged ESP32-S3 USB-serial port: a libusb bus-level reset, protocol-equivalent to unplugging and replugging the cable. Supports --skip, --serial, and --all to pick the right board when more than one is attached. Runs on macOS and Linux and needs libusb and pyusb; install steps are in Recovery. If something is missing it says what to install and exits 2. | Serial has gone silent and esptool cannot connect. Or simply unplug and replug the cable. |
tcal_wizard.py | Touch calibration wizard for the TFT variant: prompts you to press each of four corners, samples the raw ADC, derives the axis-swap and orientation flags, applies the result over the TCAL console command, and verifies it. Needs an [env:test]-family build. | A touch screen where taps land away from where you aimed, which otherwise looks like broken touch. |
connectors_setup.py | Pushes connector credentials from the repository-root .env (gitignored) to a board via the token-gated POST /api/connectors upsert. Idempotent; never prints a secret. Signs in with the X-Nimbus-Token header (never a token in the URL, which the device ignores); the board comes from NIMBUS_BOARD1_IP / NIMBUS_BOARD1_TOKEN in .env, or --ip / --token. --list shows the board's current connector state. | Configuring or re-configuring a board's external connectors after a flash or NVS change. |
Telegram owner commands
In Orchestrator mode the device answers a few fixed commands over Telegram
before the model sees the message, so the owner can manage a deployed board
without waiting on (or paying for) a turn. Every command below except /help
is owner-only - an allow-listed member can converse but cannot run them - and
each reply names the device and firmware so two boards sharing one bot are never
confused.
| Command | What it does |
|---|---|
/help (or /start) | Greet and list the owner commands. Available to anyone who can chat with the bot. |
/update | Install a pending firmware update. |
/ota candidate|stable | Choose the update channel: candidate also gets test releases before everyone else, stable gets regular releases only. /ota on its own shows the channel. See Switching the channel. |
/remind <when> <what> | Set a one-time reminder. <when> is a span (45s, 30m, 2h, 1d; a bare number is minutes) from 2 minutes to 7 days. At that time the assistant delivers the reminder in this chat. Cancel with /loop deny <id>. Example: /remind 30m take the cake out. |
/loops | List the device's routines (and any reminders you've set). |
/loop approve|deny|off|on <id> | Approve, remove, pause, or resume one routine. |
/compact | Summarize this conversation into memory now. Runs in the background and confirms once when done; a long backlog catches up in one request. The Memory page's Summarize Now does the same. |
/clear | Forget the current conversation and its active task and start fresh: the next reply sees none of this chat's earlier messages, summary, or working notes. Long-term memory, files, and the chat history are kept. A bare /clear explains what will happen and asks; /clear yes does it. The web page has the same action for the web chat (Memory, then "Clear conversation"). |
/skill approve|deny <id> | Approve a saved skill so it can be used, or remove it. |
/prefs | List your standing rules: short always/never rules the assistant follows in every reply. /prefs add <rule> saves one, /prefs rm <id> removes one, /prefs approve <id> turns on a rule that waits for your approval, /prefs restore <id> brings back a rule that was moved to memory because it read as a dated fact, /prefs clear yes removes them all. The list shows how old each rule is. The same list is on the web page under Memory, beside the directive. |
/fetch approve|deny <id> | Approve or deny a download the assistant queued (the same list as Downloads under Assistant, then Safety on the web page). |
/mcp approve|deny <name> | Approve a tool server (MCP) the assistant discovered, so its tools can be used, or remove that approval. The same action is on the web page. |
/play [track|stop|pause] | Play music from the SD card's /music folder on the speaker. /play plays every track, /play song.mp3 plays one, /play stop and /play pause control playback. |
/usage | This month's estimated spend per provider against its limit, the overall ceiling, today's spend, what is paused and why, and when the counts start again. /budget on its own does the same. |
/budget <provider|all> <USD> | Change a provider's monthly limit (all: the overall ceiling); /budget <provider> off removes one. Every change asks first and applies only on /budget confirm from the same chat within 2 minutes; a raise above 250 USD, or to more than 10 times the limit, needs the word force after the amount. Works while every provider is paused. Not in group chats. See Monthly spend ceiling. |
/model | Which provider and model the assistant uses, the provider and model the last reply ran on, and what is paused. |
A command always runs on its own, even inside a burst. When several messages arrive
together, the device answers them as one turn, but a command is never folded into
that turn: "one", "two", "/help", "four" sent quickly gets one reply to "one" and
"two", then the /help answer, then a reply to "four", in that order. Any message
that starts with / counts, including a command the device does not know (it gets
the "try /help" answer). A forwarded message never runs as a command, even when it
starts with /: the assistant reads it as a forwarded message. If the device
restarts in the middle of a burst that holds a command, it picks up where it
stopped: it repeats at most the message it was handling when it restarted, never a
command it had already finished.
Photos, files and voice notes take part in the same way. An album (up to 10 photos sent together) is answered as one turn once it has fully arrived: the device waits about 3 seconds after the last photo (never more than 15 seconds in all), then answers everything sent so far in one reply, every photo numbered and described in the order it was sent, with its caption. A text sent right after the album joins that reply; one sent while the device is already working on the album gets the next reply. A voice note joins the reply the same way (one voice note per reply). A photo that could not be fetched (too large, no memory card in the device) is named in the same reply; one sent on its own, with no caption, gets a short reply saying why.
A plain text waits too: the device holds it about 6 seconds for a photo, file or voice note sent next, showing "typing" meanwhile, and anything that arrives in that time is answered with the text in one reply (a photo read with the text as its caption). A command never waits. A photo that arrives after the reply to its text has started gets its own reply, and the assistant knows the earlier reply is already in the chat.
Repeats and floods are bounded. When Telegram delivers a message that was already answered, or the same message arrives twice within 2 minutes before the first one was answered, the repeat is skipped and the owner is told once. The device answers at most 60 messages an hour, and the owner's own chat always keeps 12 of them (other allowed chats stop at 48); past that it pauses replies, tells the owner once with the time they resume, and does not answer what was sent in between. Commands always run.
A routine or skill the assistant creates on its own stays inactive until the
owner approves it here (or from the web UI). The one exception is a one-time
wake-up the assistant sets for itself (a single follow-up turn, minutes to days
out): it fires once without approval, shows up in /loops like any routine, and
can be canceled the same way. Managing people, keys, and other settings is
web-only; the bot has no commands for them.
During quiet hours (from 22:00 until the quiet-hours-end setting, default 09:00 local) a background turn - the nightly upkeep, a routine, a sub-agent result - never messages you and never holds a note for your next message. It arms ONE self-wakeup instead: a one-time wake-up due at the end of quiet hours (within 24 h, at most one pending per kind, no approval needed), listed with the routines and cancellable like any of them, gone after it fires, and kept across a restart. At wake time the note is re-checked first: dropped when it is stale (its window passed, e.g. a brief about delays that ended) or already delivered by a routine; otherwise it is sent in plain words saying what it is and when it was noticed. The self-wakeup's turn is one short turn with no tools that change anything.
If you would rather approve even those one-time wake-ups, open Assistant →
Routines on the web page and, under Wake-ups, set "When the assistant schedules a
wake-up" to "Ask me first" (if the page does not keep the choice, set it with
POST /api/wakeups and action=mode&value=ask, below). With that set, a wake-up
the assistant arms lands pending and you get a single approval card (the same
approve/deny as a routine); it never re-asks while it waits. Only an admin can arm
or approve a wake-up. The web surface for this is GET /api/wakeups (the wake-up
list, arm state, approval mode, and quietEnd, the quiet-hours-end minute) and
POST /api/wakeups with action=mode&value=ask|auto,
action=quiet_end&value=HH:MM (when quiet hours end, local; self-wakeups fire
then), action=approve&id=<id>, or action=cancel&id=<id>. The quiet-hours-end
setting is also on the Wake-ups card as "Quiet hours end at".
Contributor tools
Everything below is for working on the firmware or driving a board over its serial console. Everyday use of a device needs none of it.
Rendering & golden-image review
| Tool | What it does | When you need it |
|---|---|---|
tftpreview.py | Converts the TFT golden suite (320×240 RGB565 buffers in test/golden_tft/*.bin, plus 480x320/ and 480x480/ for the larger displays) to PNGs for human review, and pixel-diffs two buffers (differences in magenta, exit 1 on mismatch). Append 480x320 or 480x480 to any command for a larger display. Adds contact (tile every .bin in a folder into one labeled sheet) and regions (overlay tap targets and fail on targets under the 44 px minimum or on overlaps). | Reviewing TFT screens after a layout change - render to look at a screen, diff to see what changed, contact shows the whole UI at a glance, and regions catches the two bugs a pixel diff cannot see. |
logo/gen_logo.py | Generates the Nimbus logo (the dotted teal ring) and every artifact derived from it: assets/logo*.svg, the website logo, favicon, social card, and the PROGMEM mark served at GET /logo.svg. | Any logo change. Edit the generator and re-run it - never hand-edit its outputs. |
Test-vector & artifact generators
| Tool | What it does | When you need it |
|---|---|---|
gen_nsn_vectors.py | Regenerates the nsn wire-protocol test vectors from the reference encoder in the nimbus-notify repository (expected checked out next to this one as ../nsnotify, or set NIMBUS_NOTIFY_HOST), writing tools/nsn_vectors.json and the embedded header for the native test suite. | Whenever the reference encoder in nimbus-notify changes - the device codec is byte-locked to it through these vectors. |
gen_qr_vectors.py | Regenerates the QR known-answer vectors from Project Nayuki's reference qrcodegen (the algorithm lib/core/src/qr.cpp reimplements), pinning the exact configuration the device uses. Needs pip install qrcodegen. | Whenever the QR vector list changes. |
make_manifest.py | Builds and signs the OTA release manifest (ECDSA P-256 over a canonical message that must stay byte-identical to nimbus::ota::buildSigMessage() - the pairing is golden-tested). Also prints the unsigned message for cross-checks. | Used by the release workflow with the real signing key, and by tests/hil/test_ota.py with the committed test key. Run by hand only when debugging a signature mismatch. |
git_version.py | PlatformIO extra script - injects git describe as the NIMBUS_FW_BUILD build id so /api/state pins the exact commit a running unit was flashed from. | Runs automatically on every build; nothing to invoke. |
gen_docs_pack.py | Regenerates the embedded docs pack (lib/core/include/nimbus/docs_pack_data.h) from the curated docs the Orchestrator model can read via docs.list / docs.search / docs.read. The pack ships inside the firmware image, so OTA updates it. | After editing any curated file under docs/ - the header is committed, so CI builds without python. |
CI gates & consistency checks
| Tool | What it does | When you need it |
|---|---|---|
check_param_consumers.py | Fails the build if any editable settings parameter has no functional consumer in the code - a knob that appears in the menu and web UI but changes nothing. | Runs in CI. Run locally after adding or removing a parameter. |
check_status_doc.py | Fails the build when the status→animation table in docs/notifier-status-language.md drifts from the code single-source (lib/core/src/status_style.cpp). | Runs in CI. Run locally after touching either side; edit the code first, then fix the doc. |
webui_concat_check.py | Asserts the web UI fragment set (include/web/ui_*.h) re-concatenates into a well-formed page, and optionally byte-compares against a blessed snapshot (--bless after an intentional page change). | After any web UI fragment edit. |
model_id_lint.py | Fails when a model id compiled into the firmware, the hosted daemon, or the lab is missing from the recorded provider model lists or has no built-in price, unless model_id_allowlist.json names the lane that removes it. --record-fixtures re-records the lists. | Runs in make -C tools/harness-lab check and the release gate. Run after adding or changing a model id. |
gen_turn_shape_fixtures.py | Turns episodic exports into test fixtures that keep only the conversation shape, with synthetic text in place of every message. --verify checks a fixture folder holds synthetic text only. | Regenerating the shared turn-shape fixtures. |
Hardware validation & QA
| Tool | What it does | When you need it |
|---|---|---|
nsn_send.py | End-to-end hardware validation: encodes nsn frames with the real broker encoder from nimbus-notify and sends them to a device over Bluetooth, optionally reading back the device's debug status echo over serial. Needs bleak with a working macOS Bluetooth entitlement. | Proving the full broker→Bluetooth→device pipeline against real hardware. |
ring_check.py | Quick LED-ring smoke test over serial: drives LEDTEST through the console and reports whether the ring data path acknowledges. Errors are console/port problems, not ring verdicts. Needs an [env:test]-family build. | A fast eyes-on check that the ring is being driven at all. |
backup_device.py | Pulls a board's user data - artifact-store files, the full vector DB (embeddings included), scratchpad, and state/usage snapshots - over the token-gated web API into a dated folder. Read-only (GETs only); provider keys and tokens are deliberately never exported. | Backing up a device whose SD card is a single point of failure, before a reflash or as routine insurance. |
restore_device.py | The write side of backup_device.py: pushes a dated backup folder back onto a device (vectors, episodic history, scratchpad, artifact files) over the token-gated web API, idempotently, with --dry-run and a MANIFEST check. Vectors restore by id (safe to re-run); episodic appends and refuses a non-empty store unless --force. Secrets are never imported. | Restoring a device after an erase or a failed SD card, or seeding a spare device from a known-good backup. |
build_all.sh | Compiles every build environment and flag path in one command - a compile-only gate that proves each target still links. Never uploads or opens a serial port. | Before a release, or after touching flag-gated code that only some environments compile. |
Board-specific test scripts (the live connector QA harness, the quality benchmark, panic capture, and the connector-shape grid) are not in the public repository: they reference specific boards and spend real provider credits.
Tool subprojects
Each of these is a self-contained project with its own README:
tools/sounds/- the sound-pack pipeline: synthesizes the wordless tone set (gen_tones.py, seeded + reproducible), curates pools (palette.py), buildsdist/+ the manifest (build_assets.py), regenerates the embedded tier (embed_basic.py→src/sfx/sfx_basic_data.h) and the action→audio map (gen_sfx_map.py→docs/sfx-map.md). Edit the generators, re-run, never hand-edit outputs.tools/harness-lab/- runs the real agent harness on the Mac instead of the device, for fast iteration on agent behavior. See itsREADME.mdfor the build and usage.
The Battery Lab - the local dashboard (FastAPI + React) for running
recorded, graphed, comparable battery drain experiments, with thermal protection
and a device simulator - is its own project at
ristllin/nimbus-battery-lab.
It drives the firmware's DRAIN/STORAGE console commands and the token-gated
drain endpoints, which remain in this firmware.
Build environments
Firmware variants are PlatformIO environments in platformio.ini. Build with
pio run -e <env>, install with pio run -e <env> -t upload. The comments in
platformio.ini are the authoritative source; this table summarizes them.
| Environment | What it is |
|---|---|
native | Host-side unit tests (Unity + golden images), no hardware needed: pio test -e native. Keep it at 100%. |
esp32s3 | Production firmware for the Nimbus board (Solide S3). Serial stays silent (power and flashing only); no test or debug code. |
esp32s3-cyd / esp32s3-cyd-35 / esp32s3-cyd-40 | Production firmware for the all-in-one (Freenove CYD) board with the 2.8", 3.5", and 4.0" display. setup_device.py --size 28|35|40 picks the matching one. The 3.5" and 4.0" images are verified by host tests only. |
notifierdbg | Production firmware plus a device→host status echo over serial, for end-to-end Notifier validation. |
test | Production firmware plus the serial test console (NIMBUS_TEST) - what the HIL harness drives. Never the flash target for a production unit. |
test-cyd | The test console build for the all-in-one (Freenove CYD) board. |
testuart | Same as test, but the console lives on the UART USB-C port instead of the native USB port (which drops bytes on the V0.1 board). |
bttest | Same as test, but advertises over Bluetooth as "Nimbus-BT", so a test board can be told apart from a production "Nimbus" on the same desk. |
beep | Minimal speaker diagnostic - isolates the amp and speaker from the full firmware. |
ledring | Minimal LED-ring data-path test, isolated from the full firmware. |
mictest | Minimal I²S microphone bring-up - verifies the mic read path and concurrent speaker+mic loopback. |
tftmin / tftmin-uart | The smallest program that puts anything on the TFT panel: init, one solid fill, nothing else. Exists to take every variable out of a blank-screen fault. |
tfttouch / tfttouch-uart | Five on-screen buttons that prove display, touch, and calibration together - a swapped or mirrored axis is obvious with five buttons and invisible with one. |
audio-cyd | All-in-one audio bring-up: codec beep plus microphone-to-speaker loopback, checked by ear. |
tfttouch-cyd | All-in-one touch bring-up: capacitive touch with on-screen quadrant feedback. |
tftbringup / tftbringup-uart | Full TFT + touch bring-up: panel init, color order, backlight PWM, and raw touch coordinates, decoupled from the full firmware. |
provision | Standalone serial network diagnostic (not first-time setup - it has no setup network or web UI). The Nimbus board on its native USB port uses this variant when setup_device.py seeds a new board. It also answers a PROBE command that scans the Freenove capacitive touch bus (I2C 0x38), so the installer can tell a Freenove from a Nimbus board and refuse the wrong image before flashing. |
provision-uart | UART-console variant setup_device.py uses to seed a Nimbus board that is on its UART bridge port; the Freenove uses provision-cyd. The installer picks the variant that matches the board and the port on its own, so its serial reply always reaches the same cable. |
provision-cyd | The provisioning diagnostic for the all-in-one (Freenove CYD) board, on its native USB port; setup_device.py uses it for that board. |
The test-console builds (test, test-cyd, testuart, bttest) use the test-only partition table
partitions_test_16MB.csv (7 MB app slots instead of the stock 6.5 MB), because their images are slightly over
the stock slot and the ROM refuses to boot an image larger than its partition. Production envs keep
default_16MB.csv. tools/release_gate/check_image_size.py checks every built env's firmware.bin against its
own table and fails the build on overflow.
The -uart variants exist because the DevKit has two USB-C ports: native USB
and UART. A factory-fresh board can only be flashed through the UART port, and
on some boards the native USB console drops bytes. The -uart environments put
the console on the UART port so one cable can both flash and report.
Console commands
Builds in the [env:test] family compile in a serial command console
(src/test_console.cpp). It lets the HIL harness, or a person at a serial terminal, drive
and observe the device without a camera or a finger. Production builds do not
include it.
Open the port carefully: opening a serial session resets the board, so hold one
session open rather than reconnecting per command (see tests/hil/device.py).
Commands grouped by purpose, one line each. Arguments in angle brackets.
Status & diagnostics
| Command | What it does |
|---|---|
PING | Liveness check. |
STATUS | One-line device summary (firmware, mode, network, battery, faults, SFX tier, NVS use in bytes: nvs=<used>/<total> nvsfree=<free> nvsfail=<writes that did not land>, and clk=1 once the clock is set). |
RENDER? | What the screen, posture, and ring are composed to show - the harness's camera substitute. |
MENU? | The current settings-menu view. |
LEDSTATE | What the LED driver is physically driving (raw frame layer vs a fallback pattern) - the physical counterpart of RENDER?. |
LEDTEST | Eyes-on LED data-path test: cycles red, green, blue through the real driver. |
RAWFRAME? | Whether the animator currently owns the ring via the raw frame path. |
RINGANIM <0-4> | Select the working-ring animation variant. |
SELFTEST [FULL] | Run the aggregated self-test (FULL adds the audible items). |
FAULT <cap> <on|off> / FAULT? / FAULT clear | Inject or clear a capability fault (sd, memory, mic, speaker, led, screen, sd_io, provider, relay_noslot, embed_fail) to prove graceful degradation; query the mask. FAULT clear (or none, off) ends every injected fault at once: the mask (embed_fail included, which also ends the embedding pause so the queue drains), the sram_ballast hold, the AUDIOINJECT speech mute and scratch_fail; it replies FAULT cleared mask=0x00. |
FAULT memory <on|off> | The memory store is unavailable: automatic recall returns nothing and memory tool calls fail, while memory.write and memory.update are refused as "memory engine unavailable" and counted as failed writes (from a tool call or a turn's mem_write); memories waiting for an embedding stay queued. |
FAULT sram_ballast <bytes> | Hold that much internal memory so the low-memory paths run on demand; 0 releases it. Held as up to 16 blocks, so it can go past the largest free block, and never below 4 KB free. Reports what it holds, internal free, largest block and block count. |
FAULT embed_fail <on|off> | Make only the embedding call fail (the reply model still answers) with a recorded out-of-credit refusal (HTTP 429 credit_balance_exhausted), to exercise the memory-write queue. Replies FAULT embed_fail=<0|1> pending=<n>; off also ends the embedding pause so the queue drains. |
FAULT scratch_fail <on|off> | Make the scratchpad's flash file write fail, so a change is kept until restart only and says so, whatever the settings storage holds. Replies FAULT scratch_fail=1, or on off FAULT scratch_fail=0 saved=<0|1> (off saves the notes again at once). FAULT clear ends it too, and ends embed_fail. |
PANIC <abort|nullptr|canary|twdt|oom> | Crash the device the chosen way so the crash summary at the next boot can be checked per kind. PANIC <nullptr|abort|canary> arm=turn [round=N] arms the crash inside the next turn instead: it fires as that turn sends its request in round N (0 to 50, default 0) and is dropped if the turn ends first. |
NVSFILL <entries> / NVSFILL 0 | Fill a scratch settings namespace to exercise the storage-full paths in seconds; 0 erases the scratch namespace. Reports free space before and after. |
CAPTEST <tokens> / CAPTEST 0 | Cap the first attempt of every provider request at that many output tokens, so a cut reply and its retry with more room run on demand. Replies CAPTEST <tokens>; CAPTEST 0 ends the cap and replies CAPTEST off. A restart also ends it. |
BUDGET <bytes> / BUDGET 0 | Pin every provider request's body budget at that many bytes (1000 to 4000000), whatever the model's own budget is, so a leg calibrated to a figure keeps it (BUDGET 85000 is the budget every model had before v5.1.2). Replies BUDGET <bytes>; BUDGET 0 gives each request its own budget back and replies BUDGET off. A restart also ends it. |
TOOLS? | The tool list an owner turn's model gets, under the names it sees them by: TOOLS BEGIN n=<count> bytes=<size>, one JSON line per tool (name, description, schema), then TOOLS END. |
PROVFAULT <host> <status> <json> / PROVFAULT off | Answer every request to one provider API host (for example api.anthropic.com) with a set HTTP status (100-599) and error body, such as a credit or overload error, without sending anything, until PROVFAULT off. Replies PROVFAULT <host> <status> armed (<n> B body). |
TOOLSTALL <ms> / TOOLSTALL 0 | Make the next tool call hold the card lock for that long (0 to 120000 ms) before it runs, the way a slow tool does, to show the main loop keeps running. Replies TOOLSTALL armed <ms> ms; the call logs TOOLSTALL: <tool> holds the card lock for <ms> ms. |
CUTARM append|part|swap <n> / CUTARM off | Make the next write of that kind stop the device the way a power cut would, for the file bench (tests/hil/test_files_bench.py): append after <n> bytes of a files.append reached the card, part after <n> bytes of a files.edit part file, swap before the <n>-th card operation (from 0) of the next whole-file swap. The bytes before the cut are closed on the card, then the device panics and restarts. Replies CUTARM armed <kind> <n>; the cut logs CUT <kind> at <n> - panic now. Test builds only. |
ALLOCREFUSE <n> [min] / ALLOCREFUSE heap [min] / ALLOCREFUSE off / ALLOCREFUSE ? | Refuse one memory request, for the file bench: <n> [min] refuses the <n>-th working-memory block of at least min bytes (default 1024) from now; heap [min] refuses the first block of at least min bytes (default 4096) inside the next files.append's plan. The call must end with no file change and say why. ? replies ALLOCREFUSE armed=<n> seen=<k> refused=<working> heap=<heap>. Test builds only. |
LOOPGUARD? | The main loop's card-lock counters: blocking= (times the loop waited for the lock; must stay 0), the caller= of the last one, busy= (passes that skipped card work while a tool held the lock), parked=/dropped= timeline events, longHolds=, longestHoldMs= and tool= (tool calls that held the lock 3 s or more), maxPassMs= and slowPasses= (loop passes of 2 s or more). |
WEBGUARD? | The web task's guard counters: blocking= (web requests that waited for the card lock; must stay 0) and the caller= of the last one, busy= (answers marked busy or sent as 503 because a tool held the card lock), netUnderLock= (network requests started while holding the card lock; must stay 0) and the netCaller= of the last one, releases= (memory embeddings that gave the card lock up for their request), webTask=1 watched=1 (the web task is known and the task watchdog watches it). |
HISTV2 [0|1] | Switch the turn-structured conversation history off (0, the previous 12-row window and capture byte for byte) or back on (1, the default at every boot); no argument reports the state. Replies HISTV2 <0|1>. RAM only. |
HISTADD <chat> <n> <text> | Capture n (at most 50 per line) owner messages of text in a chat with no turn and no provider call, the way a replay storm leaves them, to check the history collapses them into one row. Replies HISTADD chat=<chat> n=<n>, or HISTADD busy (nothing written) while a turn holds the card. |
UNSENT <host> / UNSENT off | Make every request to one provider API host (for example api.anthropic.com) fail as not sent, with nothing sent, so the "could not send" path runs on demand: at most one resend once memory recovers, no provider switch, one plain reply. Replies UNSENT <host> armed; UNSENT off (or PROVFAULT off) ends it. |
VISIONCHECK <path> | Describe one photo already on the card through the real photo step and report VISIONCHECK described=<bytes> why=<reason>: the description length, or why no provider was asked (out of credit, key refused, paused). |
IMGMODE native|caption|upload|inline / IMGMODE? | Photo path switches for this boot (RAM only): native sends photos to the head as images (the default), caption sends every photo through the photo reader instead; upload makes an Anthropic head upload each photo once and keep the file while the photo is in the recent history (the default), inline re-sends it every round and keeps nothing. Replies IMGMODE native= upload= head= records= deletes= lastErr=: the switches, whether the current head reads images, the photo records waiting to be written and the uploads waiting to be deleted. |
PARK? / PARK clear | List the per-provider park, one PARK <provider> kind= status= seams= recheckS= paused= line each, then PARK? providers=<n>; or end every park and its saved notices so no provider stays closed after a bench run (pauses stay). Replies PARK cleared. |
SPENDSET <cents> / SPENDSET limit <cents> / SPENDSET limit off / SPENDSET prov <provider> <cents> / SPENDSET day <cents> / SPENDSET? | The monthly spend limits' test seam: seed this month's overall estimate (a count at or over the ceiling opens a pause), set the ceiling as the owner would or turn it off, seed one provider's count (against its monthly limit), seed today's count (against the daily warning), or print the state. Replies SPENDSET {"limitCents":..,"spentCents":..,"frozen":..,...} and SPENDGATE <seam>=<consults>/<refusals> ... per paid seam. |
SDCHECK | Probe SD card health and report the current storage tier. |
TEST <name> | Pass a test name through to the board-support self-test. |
REBOOT | Software restart - the only sanctioned way to restart from the host. |
REBOOT cold | Restart with the clock cleared, so the boot starts unset like a power-on (a plain restart keeps the clock). |
FACTRESET | Trigger the deferred factory reset (preserves hardware identity, erases config, restarts) - the console path to the web /api/factory-reset. |
HANG | Deliberately hang the main loop to prove the watchdog recovers (~8 s). |
MEMFILL <epi|vec> <n> [bytes] | Fill episodic or vector memory with test rows to exercise caps and pruning. |
WEBTOK? | Print the device's web access token (for the HIL harness). |
Orchestrator & memory
| Command | What it does |
|---|---|
TURN <text> | Run one live Orchestrator turn; the reply echoes to serial. |
VOICE <text> | Inject a simulated voice transcript so the reply renders on-screen exactly like hold-to-talk - no microphone needed. |
VOICE? | Report the hold-to-talk state: phase, outcome, transition count, the ms from release to the first repaint and to the speech-to-text call (0 = never started), and the status line. |
STTKEY placeholder / STTKEY off | Test image only: a memory-only placeholder speech-to-text key so hold-to-talk can be exercised on a board with no key. Never saved; a provider answers it with HTTP 401. |
PROMPT? | Dump the last composed system prompt. |
CTX? [chat] / COMPACT <chat> | Inspect a conversation's context size and its summary's schedule (nextTry, firstFail, the active rung, paidToday of the daily cap, a queued manual request); force compaction now. |
FOLDRESET | Restart today's count of paid summary requests at 0 (bench rows reset it between rows). Shows in CTX? after the next pump pass. |
EPIQ [@<cursor>] [--full] <text> | Run a cold episodic-memory query over deep history and time it; page further back by passing @<cursor> from the previous result. Each row prints as a 48-byte preview, or whole (up to 1024 bytes) with --full. |
DREAM | Fire the reserved nightly memory upkeep now (decay, prune and dedup, at most once per local day; no model call). Replies DREAM queued (DREAM already queued while one is waiting); the night runs on the turn task and logs DREAM fired ok=<0|1> detail=<...> when it ends. |
EPIPRUNE [days] | Run the six-hourly history clean-up now (default 30 days). Replies EPIPRUNE days=<n> status=<ran|deferred-turn|deferred-busy|no-store|clock-unset>; a pass that ran adds dayfiles=<n> blobs=<n> kept=<n>, with blobs=deferred while the history index is still being rebuilt after a restart. A deferred pass removed nothing. |
CLOCK <epoch> | Set the wall clock to a chosen moment (seconds since 1970), to test routines and time zones without waiting. |
TZCHK <posix-tz> <epoch> | Show the local time, weekday, daylight-saving flag, and offset a POSIX time-zone string gives for a moment. |
TGINJECT <json> | Feed a raw Telegram update page through the receive path, so the inbound Telegram flow runs with no phone. Text, commands, photos, albums, voice and files all run (and land in the Telegram archive), through the duplicate breaker and the hourly limit; a file whose file_id is LOCAL_/mem/<path> is read from that file on the card. The offset never moves. A page runs at once, except one whose body starts {"ok":true,"settle":true,: it is held by the same wait as a polled page (6 s after a plain text, 3 s after a photo, file or voice note, none for a command), and the settle pages sent after it join it (up to 4), so a text and the photo sent seconds later replay in real time. The reply ends settle=1. The page rides one command line; a test-image line holds up to 4096 bytes. |
TGGUARD? | Print the Telegram storm guards since their record was last cleared (it survives restarts, not a power cycle): dups (repeats skipped), ceiling (turns skipped at the hourly limit), poison (pages skipped after crashing the device twice), tries (crash restarts counted against the page in flight), holding (a page is waiting for the rest of an album, or for the photo sent after a text) and booted (1 once the record has been read at boot; the counters are zero before that) and kept (1 when that boot found the record intact, 0 when it started a fresh one). |
AUDIOINJECT <path> / AUDIOINJECT off | Run the hold-to-talk path on a recorded 16 kHz mono 16-bit WAV already on the card (put it there with FSPUT): the clip replaces the microphone, then the real speech-to-text call and the voice turn run. Spoken replies stay off until AUDIOINJECT off. |
MODE <0|1> | Switch operating mode (0 = Notifier, 1 = Orchestrator); persists and restarts. |
Display & screen
| Command | What it does |
|---|---|
SCREEN <tft> / SCREEN? | Set the display preference and report both the stored value and the driver that actually bound. eink is a frozen legacy value that binds no supported display (it drives the unsupported-display notice). |
SAVER [min] | Force the screensaver now, or set and persist its idle threshold (0 = off). |
TFTHEALTH? | TFT panel configuration check, heal count, and live backlight state. |
TFTHZ [hz] | Sweep or set the panel SPI clock, measuring pixel-path errors at each step. |
TFTFILL? | Push whole frames through the real blit path and read back the far corners - proves the pixel path with nobody looking at the glass. |
TFTID? | Panel register readback over the shared MISO line. |
TFTPWR? | Read the panel's power/display-on register to tell "powered and displaying" from "merely storing pixels". |
TFTFLIP <0|1> | Which end of the landscape panel is up - decided by the mounting, so it is dialable live. |
TFTBREAK | Drill: reset the panel behind the driver to reproduce the white screen on demand and prove the watchdog heals it. |
PANELPROBE <0|1> | Enable or disable the panel health probe. |
Input - touch
| Command | What it does |
|---|---|
TAP <x> <y> [HOLD] / TAPUP | Inject a synthetic tap (or press-and-hold, released by TAPUP) so the touch UI is HIL-driveable with no finger. |
TOUCH? | Raw touch-controller state, for calibration. |
TCAL [minX,maxX,minY,maxY[,flags]] | Read or set the touch calibration (tcal_wizard.py derives it for you). |
TOUCHISO? | Read touch with the panel held in reset - isolates the two devices sharing the MISO line. |
Battery & power
| Command | What it does |
|---|---|
PROFILE <0|1|2> | Set the battery mode (Dark/Balanced/Full) through the same path the menu and web use. |
BATTCAL | Anchor 100% to the current reading - the owner asserts the pack is full right now. |
BATTRESET | Discard everything the battery model learned by observation (keeps the BATTCAL anchor). Needed after a drain campaign. |
SLEEPMV [mv] | Read or set the low-battery deep-sleep threshold (0 = off). A safety knob: 0 disarms the protection persistently - restore the default the moment a pack is connected. |
SLEEP | Enter low-battery deep sleep immediately to test the wake mechanics (the 5-minute timer wakes it; the USB console dies with it). |
DRAIN on|off [deep] | Battery drain campaign load: pin the ring to a heavy solid-white draw; deep runs past the clean shutdown to the real cutoff. |
STORAGE <pct|off> | Discharge to a storage charge level (~70%) and hold. |
Audio & media
| Command | What it does |
|---|---|
MICREC | Record 4 seconds, transcribe it, print the transcript. |
SPKSAY <text> | Synthesize the text and play it on the speaker. |
TTSTG <text> | Synthesize the text and send it to the owner as a Telegram audio message - audible even when the board's own speaker is not working. |
TGSEND | Telegram document-send smoke test. |
SFX <slug> / SFXVOL <0-100> | Play a sound effect by slug; set the master volume. |
PLAY [name|stop|pause] | Music player: PLAY plays all of SD /music, PLAY song.wav one track, PLAY stop/PLAY pause control it. |
MEDIATEST | End-to-end test of the durable media path on the real SD card (write, capture, verify over HTTP). |
Music playback
The device plays music from the SD card's /music folder over the speaker, on top
of the same volume control as sound effects (Settings, Sound). Reach it from the
media.play / media.pause / media.stop / media.list tools (the assistant), the
/play Telegram command, or the PLAY console command. Only the owner starts,
pauses or stops music (a member's or a guest's request is refused, and so is the LAN
/mcp endpoint); anyone may list the tracks. The web page has no music controls of
its own (no track list, play, or remove).
- Adding tracks. Upload an
.mp3under Memory → Files (Upload a file), or drop it into Chat: it goes straight to the card's/musicfolder, ready to play here, over Telegram with/play, or by asking the assistant. A.wavuploaded that way is stored as an ordinary file instead, so copy WAV tracks onto the card's/musicfolder by hand (that works for MP3 too). To remove a track, delete it from that folder. - Formats. 16-bit PCM WAV and MP3 both play (MP3 decode uses the bundled public-domain minimp3 decoder). A file whose format is not recognized is skipped, never played as noise.
- Queue behavior. Music is foreground audio, so a track is never dropped and
plays to completion (unlike the sound-effect cues, which drop when busy). The
player holds one now-playing track plus an ordered list:
media.play song.wav(or/play song.wav) replaces the queue and plays now;media.playwithqueue: trueappends instead; a bare/playqueues the whole folder in name order.media.pauseholds the position,media.playresumes, andmedia.stophalts and clears the queue.
Network & Bluetooth
| Command | What it does |
|---|---|
WIFI <ssid>|<pass> | Store Wi-Fi credentials and join. |
WIFISCAN | Scan and print what the radio can actually see. |
WIFIKNOWN? | The saved-network list - names only, never a password. |
WIFIRENAME <old>|<new> | Correct a mistyped network name while keeping its password. |
WIFIAP [on|off] | Force the setup network reachable now (stops the station), or resume joining. |
BLE? / BLEMAC? | Bluetooth advertising/connection state; the factory Bluetooth address (the ground truth for telling two boards apart). |
BONDS? / FORGETBONDS | Bonded-central count and pairing state; erase all bonds. |
NSNFEED <hex> | Feed a synthetic nsn frame through the same decoder path a real Bluetooth frame takes - drives the Notifier UI with no broker and no Bluetooth. |
OTA updates
| Command | What it does |
|---|---|
OTA? | Current OTA state and pending update, if any. |
OTACHECK | Poll the release feed now. |
OTAAPPLY [dry] [force] | Apply the pending update (dry verifies without installing). |
OTAURL <url> | Point the updater at a different manifest URL. |
OTACHAN candidate|stable | Set the update channel. |
OTASIM arm <ver> | Drill: simulate an available update to exercise the whole approval-and-install flow. |
For the full OTA story, see ota.md; the operations runbook is maintainer-internal.
Cloud access
| Command | What it does |
|---|---|
CLOUD? | Cloud-relay status as JSON (opt-in, pairing state, pairing code and claim URL when pairing). |
CLOUDPAIR | Opt in and start pairing; poll CLOUD? for the code (also shown on the screen), then claim it at app.cumulo-nimbus.ai. |
CLOUDOFF | Unpair and disable cloud access. |
CLOUDLOOP [path] | Loopback self-test of the tunnel replay path against a local route (default /api/state); no cloud dependency. |
For the pairing flow and security model, see cloud-relay.md.
The device also answers a few fixed owner commands over Telegram. See Telegram owner commands under User tools above.