ESP32 Simulator

v0.2.6
io.github.stramanu/esp32sim-mcp Checked 18 hours ago Published 1 month ago

Boot 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.

ParameterTypeDescription
appBinstringDirect path to the application binary (.bin).
boardstringBoard 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…
bootloaderBinstringDirect path to bootloader.bin (needed with appBin for a real ROM boot).
chipstringTarget chip family. Default is s3 (ESP32-S3).
consolestringConsole source to capture (default: both = UART0 + USB-Serial/JTAG). Lines ESP-IDF mirrors on both consoles are shown once.
maxSecondsnumberMaximum emulated time in seconds (default: 10s). Emulation usually runs faster than real time.
projectDirstringPath to the ESP-IDF project root or build folder. If omitted, uses current working directory.
ptableBinstringDirect path to partition-table.bin (needed with appBin for a real ROM boot).
stopAfterExceptionsnumberStop 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…
wifistringAttach 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.

ParameterTypeDescription
appBinstringDirect path to the application binary (.bin).
boardstringBoard 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…
bootloaderBinstringDirect path to bootloader.bin (needed with appBin for a real ROM boot).
chipstringTarget chip family. Default is s3 (ESP32-S3).
eventsarrayHost actions at emulated times.
maxSecondsnumberTotal simulation duration in seconds (default 15).
projectDirstringPath to the ESP-IDF project root or build folder. If omitted, uses current working directory.
ptableBinstringDirect path to partition-table.bin (needed with appBin for a real ROM boot).
scriptContentstringRaw esp32sim script text instead of events (e.g. "1.5 press btn1 150\n3.0 stop").
wifistringAttach 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.

ParameterTypeDescription
patterns *arrayExpected console output. Plain text matches as a substring of a line ("Counter: 5"); write a regular expression between slashes ("/Counter: \\d+/", "/wifi.*connected/i").
appBinstringDirect path to the application binary (.bin).
boardstringBoard 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…
bootloaderBinstringDirect path to bootloader.bin (needed with appBin for a real ROM boot).
chipstringTarget chip family. Default is s3 (ESP32-S3).
eventsarrayOptional interaction events before checking patterns.
maxSecondsnumberMax emulated seconds to wait for patterns (default 10).
orderedbooleanWhether patterns must appear in exact chronological sequence (default: true).
projectDirstringPath to the ESP-IDF project root or build folder. If omitted, uses current working directory.
ptableBinstringDirect path to partition-table.bin (needed with appBin for a real ROM boot).
wifistringAttach 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.

ParameterTypeDescription
appBinstringDirect path to the application binary (.bin).
boardstringBoard with a display: 'atech14', 'waveshare-lcd4b', 'waveshare-amoled18-v2' (S3), 'waveshare-c6-lcd147' (C6), 'ttgo-tdisplay' (ESP32).
bootloaderBinstringDirect path to bootloader.bin (needed with appBin for a real ROM boot).
chipstringTarget chip family. Default is s3 (ESP32-S3).
projectDirstringPath to the ESP-IDF project root or build folder. If omitted, uses current working directory.
ptableBinstringDirect path to partition-table.bin (needed with appBin for a real ROM boot).
timeSecondsnumberEmulated second at which to take the screenshot.

sim_list_boards

Returns the catalogue of all supported ESP32 chips, boards, displays, peripherals and capabilities.

ParameterTypeDescription
chipstringFilter boards by chip family.

sim_doctor

Validates local environment: checks if esp32sim binary is installed, checks Rust/Cargo, and provides setup instructions.