ESP32 Simulator
v0.2.6Boot and test ESP32 firmware in a local emulator: UART asserts, buttons, virtual WiFi, screenshots.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
sim_run
Boots and simulates ESP32 firmware in a local emulator without hardware. Captures UART logs, FreeRTOS asserts, memory faults, and stop reason.
| Parameter | Type | Description |
|---|---|---|
appBin | string | Direct path to the application binary (.bin). |
board | string | Board model: S3 'atech14' (default), 'waveshare-lcd4b', 'waveshare-amoled18-v2', 'waveshare-cam'; C6 'waveshare-c6-lcd147'; ESP32 'ttgo-tdisplay', 'esp32dev-loopback'; 'none' for a bare module. Omit o… |
bootloaderBin | string | Direct path to bootloader.bin (needed with appBin for a real ROM boot). |
chip | string | Target chip family. Default is s3 (ESP32-S3). |
console | string | Console source to capture (default: both = UART0 + USB-Serial/JTAG). Lines ESP-IDF mirrors on both consoles are shown once. |
maxSeconds | number | Maximum emulated time in seconds (default: 10s). Emulation usually runs faster than real time. |
projectDir | string | Path to the ESP-IDF project root or build folder. If omitted, uses current working directory. |
ptableBin | string | Direct path to partition-table.bin (needed with appBin for a real ROM boot). |
stopAfterExceptions | number | Stop after N CPU exceptions (unset by default). Counts every exception, including the window overflow/underflow ones Xtensa firmware takes constantly, so it is a debugging aid, not a crash detector. P… |
wifi | string | Attach a virtual access point with DHCP/DNS/NAT. Spec like 'ssid=demo,psk=secret' (keys: ssid, psk, chan, bssid), or a bare SSID for an open network. Station gets 10.0.2.15. |
sim_script
Simulates hardware interactions (button presses, GPIO levels, rotary encoder turns, touch, UART/console input) at specific emulated timestamps, capturing interactive firmware behavior.
| Parameter | Type | Description |
|---|---|---|
appBin | string | Direct path to the application binary (.bin). |
board | string | Board model: S3 'atech14' (default), 'waveshare-lcd4b', 'waveshare-amoled18-v2', 'waveshare-cam'; C6 'waveshare-c6-lcd147'; ESP32 'ttgo-tdisplay', 'esp32dev-loopback'; 'none' for a bare module. Omit o… |
bootloaderBin | string | Direct path to bootloader.bin (needed with appBin for a real ROM boot). |
chip | string | Target chip family. Default is s3 (ESP32-S3). |
events | array | Host actions at emulated times. |
maxSeconds | number | Total simulation duration in seconds (default 15). |
projectDir | string | Path to the ESP-IDF project root or build folder. If omitted, uses current working directory. |
ptableBin | string | Direct path to partition-table.bin (needed with appBin for a real ROM boot). |
scriptContent | string | Raw esp32sim script text instead of events (e.g. "1.5 press btn1 150\n3.0 stop"). |
wifi | string | Attach a virtual access point with DHCP/DNS/NAT. Spec like 'ssid=demo,psk=secret' (keys: ssid, psk, chan, bssid), or a bare SSID for an open network. Station gets 10.0.2.15. |
sim_expect
Runs firmware in simulation and asserts that specific text or regex patterns appear on UART. Ideal for automated unit & integration testing in a Red-Green-Refactor agent loop.
| Parameter | Type | Description |
|---|---|---|
patterns * | array | Expected console output. Plain text matches as a substring of a line ("Counter: 5"); write a regular expression between slashes ("/Counter: \\d+/", "/wifi.*connected/i"). |
appBin | string | Direct path to the application binary (.bin). |
board | string | Board model: S3 'atech14' (default), 'waveshare-lcd4b', 'waveshare-amoled18-v2', 'waveshare-cam'; C6 'waveshare-c6-lcd147'; ESP32 'ttgo-tdisplay', 'esp32dev-loopback'; 'none' for a bare module. Omit o… |
bootloaderBin | string | Direct path to bootloader.bin (needed with appBin for a real ROM boot). |
chip | string | Target chip family. Default is s3 (ESP32-S3). |
events | array | Optional interaction events before checking patterns. |
maxSeconds | number | Max emulated seconds to wait for patterns (default 10). |
ordered | boolean | Whether patterns must appear in exact chronological sequence (default: true). |
projectDir | string | Path to the ESP-IDF project root or build folder. If omitted, uses current working directory. |
ptableBin | string | Direct path to partition-table.bin (needed with appBin for a real ROM boot). |
wifi | string | Attach a virtual access point with DHCP/DNS/NAT. Spec like 'ssid=demo,psk=secret' (keys: ssid, psk, chan, bssid), or a bare SSID for an open network. Station gets 10.0.2.15. |
sim_screenshot
Captures a snapshot image of the virtual LCD/TFT display buffer at a specified emulated time.
| Parameter | Type | Description |
|---|---|---|
appBin | string | Direct path to the application binary (.bin). |
board | string | Board with a display: 'atech14', 'waveshare-lcd4b', 'waveshare-amoled18-v2' (S3), 'waveshare-c6-lcd147' (C6), 'ttgo-tdisplay' (ESP32). |
bootloaderBin | string | Direct path to bootloader.bin (needed with appBin for a real ROM boot). |
chip | string | Target chip family. Default is s3 (ESP32-S3). |
projectDir | string | Path to the ESP-IDF project root or build folder. If omitted, uses current working directory. |
ptableBin | string | Direct path to partition-table.bin (needed with appBin for a real ROM boot). |
timeSeconds | number | Emulated second at which to take the screenshot. |
sim_list_boards
Returns the catalogue of all supported ESP32 chips, boards, displays, peripherals and capabilities.
| Parameter | Type | Description |
|---|---|---|
chip | string | Filter boards by chip family. |
sim_doctor
Validates local environment: checks if esp32sim binary is installed, checks Rust/Cargo, and provides setup instructions.