32esp32-emu
WASM dual-core Xtensa

documentation

What the chip supports, in one table.

Every peripheral below runs against the same native Rust model whether you use the ESP32 dev module or the ESP32-CAM — the modules differ only in memory, pins, and the camera. Status reflects the verified worker test-suite, not aspirations.

Peripheral support matrix

ESP32 silicon vs ESP32-CAM module. “Demo” jumps back to the console with that firmware selected.

esp32-emu peripheral support matrix: UART, GPIO, SPI, I2C, WiFi, camera and more marked native on ESP32 and ESP32-CAM
The support matrix — every peripheral below runs on the same native Rust model.
PeripheralESP32ESP32-CAMWhat was addedWhat is leftDemo

native cycle-counted Rust model, test passing partial works with documented limits not emulated out of scope for this engine

Module comparison

ItemESP32 dev moduleESP32-CAM (AI-Thinker)
SiliconESP32, dual LX6 @ 240 MHz modelSame ESP32 silicon
Flash4 MB4 MB
PSRAMOptional4 MB quad, on by preset (psramFound() true)
Camera—OV2640 via SCCB + I2S-camera DMA, 160×120 test frame (38400 B)
PinsFree GPIOFixed camera pinout (PWDN 32, XCLK 0, SIOD 26, SIOC 27, D0–D7, VSYNC 25, HREF 23, PCLK 22), LED 33, flash LED 4
Demo toggleDefault boardUse the ESP32-CAM button above the console; any demo runs on either

WiFi station + AP

Station scan/associate and Soft-AP init run fully offline in the emulator. The data path (DHCP, DNS, TCP/UDP, port-forward to the board) flows through the local gateway over a WebSocket — the same path the Node test-suite uses.

Station (STA)

Scan finds the virtual AP, auth + assoc complete, DHCP assigns an address. Try the WiFi scan demo, then pick STA only vs STA + AP in the console WiFi panel.

Access point (AP)

Soft-AP init, softAPIP() = 192.168.4.1, derived MAC, station count. Try the Soft-AP demo. Association counting needs a second station — untested, count stays 0.

Full data needs the gateway. Start it next to the page: cd openhw-studio-gateway && ./start-gateway.sh (serves ws://127.0.0.1:5085/api/network-gateway, forwards 127.0.0.1:8080 → board :80). The console WiFi stats (state / IP / forward / tx-rx) go live once the gateway answers. Verified live: STA connect + DHCP 192.168.4.2 + ICMP echo to the gateway (WIFI=OK / RECV=84).
Why no webserver / CoAP / ESP-NOW demos on this page? Those suites need more than the gateway socket: a live second peer or host responder in the same gateway room (ESP-NOW two-node RXCB, CoAP host ACKs), chunkSize 20000 delivery quantization tuning, and poll loops that busy-spin instead of delay(). They all pass in Node (test-worker-webserver / -web / -net-protocols / -coap-server / -espnow / -ipv6, see docs/networking.md) and stay Node-only by design — porting their harnesses would bloat the page without proving any new engine path.

OTA + partition presets

The console OTA preset selector rewrites the partition table before boot — the same CSV path the worker tests use.

PresetTableUsed by
OTAnvs + otadata + ota_0/1 + spiffsOTA update
OTA minimalnvs + otadata + ota_0/1OTA slots
Factory defaultFirmware-baked tableDefault part.

Per-demo speed (true MIPS)

Retired instructions / wall-clock to the pass mark, measured host-side on the same engine the page runs (Rust inst_count summed over both cores — instructions the WASM cores really executed, not the JS step budget). Real firmware, all 53 PASS. The console prints the live figure after every run; expect ~9–26 MIPS depending on workload.

DemoMIPSRetired instrWallDemo

References

Prior art this project learns from — JS-first chip simulation with real firmware images.

wokwi / esp8266js

ESP8266 simulator in JavaScript (MIT, Uri Shaked). Boots real bootloader + partition + app binaries from an RTOS-SDK build — the same “real image in, UART out” contract our console follows. github.com/wokwi/esp8266js

wokwi / esp32js

Wokwi’s ESP32 simulator core. Useful as a second opinion on peripheral semantics (timers, SPI flash cache, WiFi frame flow) when our native Rust models disagree with observed firmware behavior. github.com/wokwi/esp32js

Demo catalogue

All 53 images are prebuilt Arduino firmware (bootloader + partitions + app), verified PASS on the host suite before shipping. Seven need a host action while they run — the console performs it for you; UART echo is fully interactive (you type, the chip echoes).

DemoExercisesPass markHost assist

Build, test, reproduce

Rebuild the engine

npm run build:wasm   # Rust → WASM
npm run build        # esbuild dist/ bundle
npm test             # no-server battery

Run the peripheral suite

node tests/compile-server.mjs  # :5525
node tests/test-worker-gpio.mjs
./tests/run-worker-tests.sh --skip-bt --skip-wifi
Reading the console verdict. Each demo ends with the chip’s own verdict line (RESULT=PASS or the peripheral mark such as CAM_DATA=PASS). The host never prints a pass mark — if the mark is missing, the demo genuinely did not finish.