A simulated ESP32 you can reach from anywhere
Wokwi runs an ESP32 in your browser, WiFi included. With one library the simulated board also gets an HTTPS address, its log and metrics in a dashboard, and crash reports decoded to the line, without a board on your desk.
Why Wokwi, and where it stops
Wokwi simulates the ESP32 well enough to run real Arduino and ESP-IDF firmware, and its virtual access point Wokwi-GUEST gives the simulated board a way out to the internet. That covers a lot: HTTP requests, MQTT, NTP.
The way in is another matter. A WebServer running in the simulation listens on an address inside Wokwi that your browser cannot reach. Wokwi's own answer is the Private IoT Gateway, which forwards a port to your computer and is part of the paid plans. And whatever the board prints goes only to the serial monitor in that one browser tab.
The other way round
Pinscope works from the device outward: the firmware opens one connection to the service and keeps it, and everything else travels over that connection. The board's own web server gets an HTTPS address, its log lines and metrics go to a dashboard, and a crash is sent once the board restarts. Outgoing connections are exactly what the free Wokwi gateway allows, so the same library that runs on a real ESP32 runs in the simulator, unchanged.
Try it in two minutes
- Create a Pinscope account (three devices are free, no card), open Connect a device and copy the project key.
- Open the ready-made Wokwi project: an ESP32 with a web page, an LED and a red crash button.
- Paste the key into
PINSCOPE_KEYand press the green Run button.
After the build (Wokwi's free build queue can take a minute) the board joins Wokwi-GUEST, which can take another half minute, connects, and appears in the dashboard as wokwi-esp32. Keep the Wokwi window visible next to the dashboard while you try it: a simulation in a background tab is slowed down by the browser. From there:
- Its web page. Open the device in the dashboard: the page the simulated ESP32 serves opens at its own HTTPS address. The LED button on it switches the LED in the simulation. Share gives a link anyone can open for up to a week.
- Its log. Every line the sketch passes to
pinscope_log()appears in the dashboard as it happens, next to the serial monitor. - Metrics. The sketch sends a pretend temperature every ten seconds with
pinscope_metric(); the dashboard graphs it, along with free heap and uptime. - A crash. Press the red button: the firmware writes through a null pointer, restarts, and sends the crash. In Wokwi press F1, choose Download ELF with Debugging Symbols, and upload that file under Firmware: the backtrace is then shown as functions and line numbers.
What the code adds
The library is Pinscope in the Arduino Library Manager, and in Wokwi's Library Manager too. Starting it takes four lines in setup(), after WiFi.begin():
pinscope_config_t config = {};
config.project_key = PINSCOPE_KEY;
config.firmware_version = "1.0.0";
pinscope_start(&config);
It runs in its own task, waits for WiFi and reconnects by itself. The connection uses the Noise protocol rather than TLS, so it needs about 9.4 KB of RAM (why).
From the simulator to a real board
Nothing in the sketch is specific to Wokwi except the WiFi name. Put your own network in WiFi.begin(), flash the same sketch to any ESP32 with Arduino-ESP32 3.x, and it shows up in the same project, with firmware updates over the internet added (the dashboard sends a new .bin, and a build that cannot reach Pinscope rolls back by itself). The free plan keeps three devices, so a simulated board and two real ones fit.
Limits worth knowing
- Wokwi's free gateway is shared, and Wokwi says it may limit heavy use. It is meant for trying things, as is this example.
- A simulation runs only while its browser tab is open, and the browser slows a tab down once it is in the background. Keep Wokwi in a window of its own, next to the dashboard: if the device's page opens in a new tab over the simulation, the simulated board stops answering and the page cannot load. Close the tab and the device goes offline, as a real one would when unplugged.
Try it
Three devices are free, and no card is needed. Create an account, or read the five-minute guide first.
More
- Remote access to an ESP32 without TLS: what it measured and what it costs
- Reaching an ESP32 web server from outside its network
- Updating ESP32 firmware over the internet, with rollback
- Guru Meditation Error: decoding the backtrace, and crashes from the field
- Remote logging: ESP_LOG without a serial cable
- Heap and stack monitoring in the field
- An ESP32 behind CGNAT, 4G or Starlink
- TLS memory usage on the ESP32, and how to reduce it
- Sharing an ESP32 sensor page with anyone, without port forwarding
- ArduinoOTA over the internet, with a rollback
- ESP32 remote access compared: port forwarding, ngrok, Cloudflare Tunnel, Tailscale
- esp_http_server slow? The 250 ms delay and the fix
- Before the first ESP32 ships: a field support checklist
- ESP32 exception decoder: a Guru Meditation backtrace to lines, in the browser