Skip to content

Emulated sensors from definitions (firmware 3.10.3 commands) - #1

Merged
wardviaene merged 3 commits into
mainfrom
sensor-definitions
Nov 13, 2026
Merged

wardviaene merged 3 commits into
mainfrom
sensor-definitions

Conversation

@wardviaene

Copy link
Copy Markdown
Member

The simulated pod now speaks the pod's new sensor API (benchpod-firmware docs/API.md, "Emulated sensors") instead of the removed single-sensor and GPS commands, so the website demo and the desktop app's demo work with embeddedci-mcp 2.13.11.

  • sensorengine: the pod's sensor definition engine (sensor_def.wasm, built from benchpod-firmware stm32h563/wasm, the same file the server vendors) run with wazero, with a sha256 record and scripts/update-sensor-engine.sh.
  • benchsim: sensor_define (chunked, dry_run), sensor_start, sensor_set, sensor_stop, sensor_status, sensor_regs (one base64 reply), sensor_la by instance, sensor_fault / sensor_fault_clear, sensor_stimulus / _start / _stop, with the firmware's reply shapes and error texts. Register images, UART messages and analog values come from the engine. Up to 4 I2C sensors share a bus by address, pins are owned by sensor:<instance>, the first digital sensor loads the emulation image (fpga_image 2), and analog sensors on the DAC lock out the DAC commands until sensor_stop or dac_stop.
  • The node's BMP280 is now the library's bmp280 definition; the node's compensation code reads the engine's image back exactly.
  • Removed: sensor_types, the old sensor_start/sensor_set forms, gps_*. Status reports firmware 3.10.3, gateware 54, caps sensors, sensors_format 1, sensors_digital.
  • Tests: new sensors_test.go (define/chunks/errors, start checks and shared buses, regs, faults reaching the node, stimulus values and scheduled faults, UART output, an NTC on the DAC, the emulation image), and TestMCPEndToEnd on the new MCP tools, green against embeddedci-mcp 2.13.11.

Not modeled: the sensor FIFO, data-ready pins, on_write rules beyond storing the byte, UART requests, the SPI bus on the wire, the 4-20 mA output (README).

Note: the MCP's sensor_capture sends no sample rate, so a pod captures at its highest rate (4096 bytes = 0.68 ms at 24 MHz), shorter than one BMP280 read; it decodes no transaction here, and likely on a real pod too (the old i2c_sensor_capture defaulted to 500 kHz).

🤖 Generated with Claude Code

wardviaene and others added 3 commits November 13, 2026 11:07
Vendored sensor_def.wasm from benchpod-firmware 3d015497062c (the same file the server
vendors), its sha256 record, and scripts/update-sensor-engine.sh to refresh it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sensor_define (chunked), sensor_start, sensor_set, sensor_stop, sensor_status, sensor_regs
(one base64 reply), sensor_la by instance, sensor_fault/_clear and the sensor_stimulus
commands, with the reply shapes and errors of the firmware's API.md. Definitions compile and
run in the pod's own engine (sensorengine): I2C/SPI register images, UART messages on the
sensor's TX pin, analog values on the DAC. Up to 4 I2C sensors share a bus by address; pins
are owned by sensor:<instance>. The first digital sensor loads the emulation image (2), which
fpga_image now knows, and the closed loop and deep replay name the way back.

The node's BMP280 now reads the library's bmp280 definition. The single-sensor
sensor_start/sensor_set/sensor_types and the gps_* commands are gone, and status reports
firmware 3.10.3, gateware 54, caps sensors and sensors_format 1. The MCP end-to-end test
uses the new tools (embeddedci-mcp 2.13.11).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wardviaene
wardviaene merged commit e51f3d2 into main Nov 13, 2026
1 check 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