Skip to content

CLI 0.10: firmware 4.0 (code-only errors, client API 2, TLS, JSON over USB), cleanup - #80

Merged
wardviaene merged 21 commits into
mainfrom
cli-0.10
Nov 20, 2026
Merged

wardviaene merged 21 commits into
mainfrom
cli-0.10

Conversation

@wardviaene

Copy link
Copy Markdown
Member

CLI 0.10 drives BenchPod firmware 4.0 (client API 2). Pairs with embeddedci-com/benchpod-firmware#192 (fw-3.11-cutover, at c5107d3: catalog up to BP0080, features table revision 11). Not tagged or released; tested against fakes only (no hardware).

Breaking changes

  • Firmware 4.0 only. The CLI reads the pod's status once before its first command (LAN, USB network, cloud). Firmware 3.x (no api, level 1) gets exit code 7 and this pod needs firmware 4.0: benchpod flash-self; a newer pod still gets 6. status, flash-self, install-blobs, dfu, bootsel, discover and identity keep running against any level. discover reads mDNS TXT api and shows "needs firmware update" / "needs a newer CLI".
  • Code-only errors. All text matching is gone (ClassifyRefusal, translateRefusal, explainRefusal, lease/SPI/reply-too-large/LAN-gate texts, ci_lease TrimPrefix); internal/fwrefusals is deleted. Every catalog code (BP0001 to BP0080) has a kind and so an exit code; a coded reply without a message renders from the catalog (message + fix.cli).
  • TLS on the LAN (already the default: 8443, pin on first use; USB network 10.237.x stays plain 8080). New benchpod lan-tls scpi on|off; the lan-tls switches work only over USB or the cloud (BP0042).
  • JSON over USB. set-wifi, show-network, scan-wifi, clear-wifi, identity wipe, sig-policy, cloud ca/proxy, install-blobs, usb-reattach, la voltage and flash over USB use the USB network adapter; the console keeps status, dfu, identity, lan-policy, usb-network, log and the new benchpod net-reset. Errors say how to turn USB networking on. Console blob upload (firmware before 3.9.0) removed; serialconsole pruned accordingly.
  • Signatures: sig-policy set removed (always required, BP0074).
  • Renames followed: freq_hz, sample_rate_hz, clock_hz, power_profile sample_rate_hz, la_step/la_pull, target_power/usb_network enabled, boolean target_status and status.usb (status still reads 3.x forms), base64 captures by default, generate volts/mA only.
  • Removed: stream, la pullup, set-bench-pod, --connection serial, generate --amplitude/--offset, --sample-rate-mhz, --duration-ms, --delay-us, bare-mV la voltage 3300, caps-list/LegacyCaps, la_pins subset filtering, embeddedci.com wiring-profile fallback, unknown-command mappings in cloud ca/proxy.
  • Renamed flags: --output-filename -> --out (BENCHPOD_OUT), --output (format) -> --format, sensor export --output -> --out, --address -> --addr.
  • Exit codes: usage mistakes exit 2; benchpod ci results move to 10/11/12; ci uses 2/5/6/7 like every command.
  • --json output unchanged.

Exit codes

Code Meaning
0 success
1 any other error
2 usage
3 refused (every other code, and uncoded refusals)
4 busy (BP0003-0005, 0016, 0025, 0047-0052, 0066)
5 unreachable
6 update the CLI (newer pod, BP0030)
7 update the pod (firmware before 4.0, BP0002, BP0017, BP0060)

benchpod ci: 0 passed, 1 setup, 2 usage, 5/6/7 as above, 10 failed, 11 drift regression, 12 invalid.

Docs the website needs (embeddedci-server webapp/src/docs)

  • CLI exit-code table: add 7; benchpod ci codes 10/11/12 (were 2/3/4).
  • CLI 0.10 needs firmware 4.0; 3.x pods: only status/flash-self/install-blobs/dfu/bootsel/discover/identity.
  • USB: JSON over the USB network adapter; console only for recovery (net-reset, usb-network on).
  • Removed/renamed commands and flags above (stream, la pullup, --output-filename -> --out, --format, --addr, generate volts only, unit-suffixed flags).
  • sig-policy show only; lan-tls scpi; LAN TLS by default.
  • Error pages: BP0031 to BP0080 (CLI fix texts from errors.json), exit code per code.

Not done here: setup still saves la_mv to the embeddedci.com profile; --allow-unsigned (the CLI's own check of downloaded DFU images) kept; ci's --out stays the run folder (shadows the global --out).

🤖 Generated with Claude Code

wardviaene and others added 21 commits November 19, 2026 21:35
Sync the error catalog (BP0001-BP0079) and the features table (rev 10,
api 2) from the fw-3.11-cutover branch. ClientAPI is 2.

Refusals are classified by their code only: every catalog code has a kind
(refused, locked, busy, forbidden, update the pod, update the CLI), a coded
reply without a message renders from the catalog, and a refusal without a
code is shown as the pod wrote it. The text matching is gone
(ClassifyRefusal, translateRefusal, explainRefusal, the lease, SPI busy,
reply too large and LAN gate texts), and with it internal/fwrefusals.

A pod below API level 2 (firmware 3.x) stops a command with exit code 7
and "this pod needs firmware 4.0: benchpod flash-self"; the CLI reads the
pod's status once before its first command (LAN, USB network and the
cloud). status, flash-self, install-blobs, dfu, bootsel, discover and
identity still run against a pod of any level. README: exit codes and
error codes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Firmware 4.0 advertises api=2 in its _benchpod._tcp TXT record. A pod
below level 2 (none: firmware 3.x) shows "needs firmware update", one
above it "needs a newer CLI".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
benchpod lan-tls scpi on|off sends lan_tls scpi; show prints it. The
switches (https-only, scpi, regenerate, set-cert) only work over USB or
through embeddedci.com: the pod refuses them from Ethernet and Wi-Fi with
BP0042, which the catalog words. README and help: the LAN is TLS only from
firmware 4.0 and the CLI pins on first use, with nothing to set up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ore 3.9.0)

Blobs go over the pod's USB network adapter or its network address only.
A pod older than 3.9.0 (no USB network adapter) gets an error that names
flash-self, which installs its blobs over USB DFU. A pod with USB
networking off is told how to turn it back on (usb-network on, or
net-reset when Wi-Fi keeps it off).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Over USB both go to the pod's USB network adapter (cloud_ca, cloud_proxy,
ota_* target ca), which may change them; the console commands are gone in
firmware 4.0. Without the adapter the error says how to turn it on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Firmware 4.0 has no Wi-Fi commands on its console. The four commands send
wifi_set, wifi_status, wifi_scan and wifi_clear over the pod's USB network
adapter (or the --connection given). set-wifi follows the join on the
address the console reports once USB networking turns off.

benchpod net-reset runs the console's net-reset: the way back to a pod no
network reaches (forgets Wi-Fi, resets Ethernet).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Firmware 4.0 has no console identity-wipe. The CLI still reads the
identity on the console, then sends identity_wipe with the confirm token
over the pod's USB link; without the link it says how to turn USB
networking on. BP0043 (not over the USB link) is worded from the catalog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Firmware 4.0 always requires signatures (BP0074 for loosening), so
sig-policy has no set any more and its values are just required. Over USB
it reads sig_policy over the pod's USB network adapter (no console
sig-policy in 4.0); lan-policy set stays on the console. The root help
describes the 0.10 transports.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
usb-reattach sends usb_reattach (over the USB link when it is up, else the
pod's network address). la voltage and flash (dap_start, target power)
over USB use the pod's USB network adapter; the console paths for
firmware before 3.9.0 are gone, and without the adapter the error says
how to turn it on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drop the console Wi-Fi, CA, proxy, upload, blobs, la-voltage, power,
dap-start, identity-wipe and usb-reattach code and their tests: the CLI
sends JSON over the USB network adapter for all of them. Add net-reset.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- generate: freq_hz, sample_rate_hz, and volts (path, amplitude_v,
  offset_v) or mA (amplitude_ua, offset_ua) only; the 8-bit --amplitude
  and --offset and the generate16 check are gone.
- measure, capture: freq_hz, sample_rate_hz (Hz). stream is gone (the
  firmware removed the verb).
- la step and la pull send la_step and la_pull; la pullup and its
  pullup fallback for older firmware are gone.
- i2c, expansion, spi-flash: clock_hz. power profile: sample_rate_hz.
- target_power enabled true/false; target_status, status.usb and
  usb_network read booleans (status still reads the 3.x forms).
- Captures come as base64 by default: no enc in the request.
- One flag per unit: --sample-rate-mhz, --duration-ms and --delay-us are
  gone. An unknown subcommand of a command group is a usage error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BP0080 (dac_pinout_mismatch) is a refusal (exit code 3) with the
catalog's fix. status shows "DAC off: board/module pinout mismatch"
when status.module.dac_pinout_ok is false.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A run's results move to 10 (failed), 11 (drift regression) and 12
(invalid). Codes 0 to 7 mean what they mean for every command: usage
errors are 2 (were 1), an unreachable pod 5, update the CLI 6, update the
pod 7 (all were 1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The flag and argument checks the commands make themselves (required
flags, ranges, flags that go together or exclude each other, a bad
format) return a usage error, so they exit 2 like cobra's own, not 1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The global --output-filename is --out (BENCHPOD_OUT); capture, measure
and test take --format for json/csv/ndjson; sensor export writes to
--out/-o; flash-self and sensor start take --addr like spi-flash and
expansion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
--connection serial is a usage error that names usb; set-bench-pod is
gone (set-connection); la voltage 3300 is no longer millivolts (a bare
number is volts: 3.3, or 3300mV).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- features.Has decides from features_rev only (no caps list); benchpod ci
  reads the lease feature the same way.
- la pins: the pod sends the pins asked for; no client-side filtering.
  The two-part read for BP0053 stays.
- Wiring profiles come from the pod only: no embeddedci.com profile for
  firmware before 3.10.8, and la voltage saves nothing there.
- cloud ca, cloud proxy: no "this firmware has no ..." mapping of an
  unknown command; BP0002 is worded from the catalog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wardviaene
wardviaene merged commit 2a67cfb into main Nov 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant