Show HN: Esp32sim – Run ESP32 firmware in the browser
Posted by joakimeriksson 5 days ago
Hi HN,
I’ve been working on esp32sim, an open-source ESP32 emulator that runs in the browser.
The fun part of the demo is that there is no ESP32 involved — the firmware is executing in the emulator.
The goal is to make ESP32 software easier to experiment with, test and simulate without always needing physical hardware connected.
Source: https://github.com/mikroverk/esp32sim
I made a short video showing it in action: https://youtu.be/waoWFilTWEc
I’m particularly interested in feedback from embedded developers: what would an emulator like this need to support before you’d actually use it for development, testing or CI?
Comments
Comment by mrtksn 4 days ago
I vibe coded a drone simulator that flys drones by simulating ESP32 in the browser where the actual flight controller C code that runs on real ESP32 is running as WebAssembly: https://mrtksn.github.io/liftlab/
So the drones are flying with the actual ESP32 flight controller and you can flash the real ESP32 board directly.
Comment by joakimeriksson 4 days ago
Comment by mrtksn 4 days ago
The Pi board is intended for navigation and more complex tasks and is able to update the ESP32 flight controller even mid-flight.
Comment by raminf 4 days ago
On a lot of IoT projects, it's easier to create a "functional" software simulator for the hardware part so the mobile and cloud people can get going without having to wait for test hardware. Those simulators work at the level of emulating BLE or WiFi/API commands. Once you have hardware, the simulators are only used in CI/CD testing.
Where I can see this coming handy is instead of a "functional simulator" to actually have real firmware running for each mobile or back-end dev and CI/CD runner.
Comment by crote 4 days ago
But if it's just an approximation anyways, why not save yourself an awful lot of time and emulate the HAL a few layers up for the 95% of logic which doesn't require the actual hardware?
Just like in software, your cloud web app doesn't need a cycle-accurate emulation of the entire Amazon cloud. Mocking a few REST calls is often more than enough, and in practice mocking the SDK API has basically the same result.
Comment by topelinux 3 days ago
Comment by joakimeriksson 4 days ago
Comment by beachy 4 days ago
Esp32 emulation in the browser is an incredible superpower for hardware manufacturers.
You can put your hardware product, with a pixel perfect display and sound, directly into users (virtual) hands so they can try before they buy.
There's no real cost to you, since their web browser and computer provide all the horse power, you just serve it up as a static web page.
In the age of AI, a moat for hardware companies can be network effects through providing an AI friendly base that your users/players can build on.
For us that takes the form of an open source app store where players can extend their device using AI ("Hey Claude, make me a game like this one, except that a giant bowling ball with our company logo embossed on it should drop and roll down an Indiana Jones styled marble run").
It's hard to overstate how powerful it is to have users trying your device, navigating the menus, extending it's functionality themselves with AI, all on their own computer, creating games for others, all without even buying your device.
Comment by westurner 3 days ago
The SPI display driver that records screencasts to MAV (Mu Animation Video) format - just like a fax - might be useful.
In another project, teact.sim, I've developed another similarly limited simulator for eZ80 and Python but we don't need to emulate the ARM processor because Python works on x86. So we emulate the ez80 in plain Python; and someday that might compile to WASM with Pyodide.
IIRC there's Qemu in WASM. Would ESP32 work in Qemu in WASM? Is this faster?
"Babe32 – Barely Adequate Browser ESP32" https://news.ycombinator.com/item?id=49104559
Comment by noahnathan25 3 days ago
Comment by 0xmaxallen 3 days ago
But source code is not yet available :-( Would be interesting to compare the implementations.
Comment by Klovy 4 days ago
Comment by bratlas 1 day ago
Comment by ThePinion 4 days ago
Comment by joakimeriksson 3 days ago
Comment by jefichc 2 days ago
Comment by eduardsik 1 day ago
Comment by BHSPitMonkey 3 days ago
Comment by aforwardslash 3 days ago
Vaguely related, I recently designed a ws28x emulator (a physical device with support upto 1024*4 led stripes) to test firmware of our own devices. Ill probably make it oss when we release our system.
Comment by snakeman 4 days ago
Comment by joakimeriksson 4 days ago
Comment by noah_buddy 4 days ago
This is awesome, I will certainly use it for some of my recent embedded work. Will try and contribute back as well.
Comment by dofm 4 days ago
https://github.com/mikroverk/esp32sim#boards-esp32-s3
… are just too much with their dense mix of formatting, brackets, semantic punctuation, command line arguments and part numbers etc. (This one is particularly absurd but it's not the only one).
I may be middle-aged now and a non-expert but I am pretty sure these things are generally exhausting to even expert young readers. I would urge you to reconsider how this page is presented.
Comment by rvz 4 days ago
1) As long as a novel.
2) Poorly formatted.
3) Has several claudisms in each sentence.
It is one that I am not going to read and not even the author read it themselves either.It’s also a predictor of the level of slop in a project since it is getting worse with the people talking about “code quality” have now vanished and are no where to be found.
Comment by joakimeriksson 4 days ago
Comment by joakimeriksson 4 days ago
Comment by exe34 4 days ago
Comment by matthewfcarlson 4 days ago
Comment by joakimeriksson 4 days ago
Comment by djmips 4 days ago
Comment by joakimeriksson 4 days ago
Comment by djmips 4 days ago
Comment by turbine401 5 days ago
Comment by the__alchemist 4 days ago
For a relevant example, look at Show HN: You could make this same post with a slight variation on every one of them.
Comment by calmingsolitude 4 days ago
Comment by qup 4 days ago
In 2027, I can assure you I won't be shopping around for existing projects very often.
For starters, I don't need them. Second, it might take me longer to learn theirs than to build my own. And last, the amount of slop getting pushed out is going through the roof, making discoverability a difficult problem already.
Comment by thisismyanon2 4 days ago
Comment by crazysim 4 days ago
Comment by joakimeriksson 4 days ago
Comment by joakimeriksson 4 days ago
Comment by tyromaniac 4 days ago
Comment by joakimeriksson 4 days ago
Comment by matthewfcarlson 4 days ago
Comment by joakimeriksson 4 days ago
Comment by WalterGR 4 days ago
Comment by djndndeb 3 days ago
Comment by joakimeriksson 3 days ago
Comment by cincaalex 6 hours ago
Comment by CGTRocketX 23 hours ago
Comment by carplaybits 4 days ago
Comment by GaronG 3 days ago
Comment by stramanu 2 days ago
Comment by hnisjafx40 4 days ago
Comment by reactor3dxyz 4 days ago
Comment by paultnylund 4 days ago
Comment by Li9htning 2 days ago