Skip to content
KenesisXPublic

About

An esp32 app simulator within the Rasp PI OS environment that runs inside of a raspberry pi so you can combine devices. Runs alot of .BIN and other files.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

E2: Ceci n'est pas un ESP32.

E2: ESP32 / M5Stack / CYD emulator, firmware hub, code studio and wiring lab for the Raspberry Pi 5

Ceci n'est pas un ESP32. Like Magritte's pipe, it isn't the real thing: it's an emulator.

[I JUST GOT SO TIRED OF CARRYING AROUND EVERYTHING...]

Description of the image



Description of the image

Run ESP32 .bin firmware inside Raspberry Pi OS. It uses Espressif's official QEMU fork, the same emulator that runs behind idf.py qemu. You get a touch-friendly desktop app, a CLI, a firmware library, and real-hardware tools (dump, flash and monitor over USB).

Install (Pi 5, 64-bit Raspberry Pi OS)

unzip espemu.zip && cd espemu
chmod +x install.sh
./install.sh

The installer:

  • installs apt dependencies
  • creates a venv with esptool and pyserial
  • downloads the prebuilt aarch64 Espressif QEMU (about 40 MB)
  • adds a menu and desktop launcher plus the espemu command
  • adds you to the dialout group (log out and back in once)

Other options:

  • ./install.sh --build-qemu compiles QEMU from source. Use this on 32-bit Pi OS.
  • ./install.sh --no-qemu skips QEMU.
  • ./install.sh --sdr also installs HackRF, RTL-SDR, GQRX and gpsd tools.
  • ./install.sh --dev also installs the Code Studio toolchains: arduino-cli with the ESP32 core, MicroPython firmware, g++/clang/gdb, OpenJDK and xorriso. You can do this later from Code Studio → Toolchains.
  • ./install.sh --uninstall removes the app but keeps your library.

Then run espemu, or open Programming → E2. e2 doctor checks everything.

What it runs

Chip Emulated Typical boards
ESP32 ✅ CYD (ESP32-2432S028R, 3248S035...), M5Stack Core/Fire/Core2, M5StickC Plus/Plus2, Atom, DevKits
ESP32-S3 ✅ M5 CoreS3, Cardputer, AtomS3, T-Deck, T-Display-S3, N16R8 DevKits
ESP32-C3 ✅ M5Stamp C3, C3 SuperMini, XIAO C3
ESP32-C6 / C5 / C61 / H2 / H4 / P4 ⚠️ experimental newer QEMU support, basic peripherals
ESP32-S2 / C2 / ESP8266 ❌ flash to real hardware from the app instead

File types it accepts:

  • full flash dumps (esptool read_flash)
  • merged "factory" web-flasher bins (Bruce, Marauder, NerdMiner...)
  • app-only Arduino or PlatformIO firmware.bin. E2 adds the bootloader and a partition table sized to fit the app.
  • multi-part sets (bootloader + partitions + app at offsets)
  • ESP Web Tools manifest.json
  • build folders
  • .zip

Emulated vs not (be realistic)

Emulated:

  • CPU and RAM
  • SPI flash: NVS, SPIFFS, LittleFS and OTA all persist between runs
  • PSRAM
  • UART console (UART1/2 can be exposed over TCP)
  • timers, RTC, watchdogs
  • RNG, AES/SHA/RSA/HMAC, eFuses
  • SDMMC SD card (ESP32/S3)
  • OpenCores Ethernet: real networking and port forwarding, so firmware web UIs open in your Pi's browser
  • the virtual RGB framebuffer (esp_lcd_qemu_rgb), which gives a real on-screen display
  • GDB

Not emulated:

  • Wi-Fi and Bluetooth radios
  • SPI/I2C peripherals: CYD/M5 LCD panels, touch, IMU, AXP192 PMIC, CC1101, NRF24, IR
  • buttons/ADC, I2S, native USB

Firmware that uses these still boots and runs its logic and serial CLI, but those features fail or show nothing. The app's compatibility scan reads each .bin and tells you exactly which of these it found before you run it.

Works best for: serial-CLI tools, testing that a dump boots before you flash a board, reverse engineering (GDB + strings), Ethernet/web-UI builds, and crypto/NVS/OTA logic.

GUI tour

  • Library: drag and drop .bin files, folders or manifests. You can search, favourite, duplicate, and export/import portable .espemu.zip packages to share with your team.
  • Overview: detected chip, image type, project/version/IDF build info from esp_app_desc, SHA-256, colour-coded compatibility report and notes. Use the board profile picker to set flash/PSRAM.
  • Emulation:
    • Hardware: PSRAM (auto-enabled when the firmware uses it), octal PSRAM, watchdog off, eFuse mode
    • Display: headless, or an SDL/GTK window
    • Storage: snapshot mode (pristine every boot); create an SD image and add files to it
    • Network: Ethernet with port forwards (auto or 8080:80,2323:23), LAN exposure for your phone
    • Debug: GDB (optionally halt at reset), UART1 over TCP, download-mode boot (talk to the emulated chip with esptool --port socket://localhost:5555), extra QEMU args
    • A live command preview shows the exact QEMU command
  • Running dock: one tab per emulator, and you can run several at once (the Pi 5's 4 GB handles many). Each tab has:
    • a coloured ESP log console with input history and control keys
    • Reset, Pause/Resume and Stop
    • Save log (every session is also auto-logged)
    • a virtual-display screenshot
    • a raw QEMU monitor
    • Export flash with NVS state
    • clickable forwarded-port links
  • Partitions: table view, plus extracting any partition (NVS, SPIFFS, app) to a file.
  • Strings / Recon: regex filter, plus an "interesting only" mode that flags URLs, IPs, emails, API keys, AWS/GCP keys, certs, SSIDs and MQTT. Handy for firmware assessments.
  • Real hardware:
    • auto-detects CH340, CH9102, CP210x and native USB ports
    • chip info and a serial monitor
    • flash the selected firmware, or flash the emulator's flash (with its saved settings) to a board
    • dump a board into the library with one click (clone your CYD/M5 and run it here)
    • erase
  • View → Large UI for touchscreens, and F11 for fullscreen.

Firmware Hub

One tab browses every major source. Each item can go straight to Add to library, Run in emulator or Flash to board. Raspberry Pi images get Download + burn SD/USB instead.

Source What you get
LauncherHub / M5Burner The catalog behind bmorcelli's Launcher and web flasher (api.launcherhub.net), browsable by device: CYD variants, M5 Core/Core2/CoreS3/StickC/Cardputer, T-Deck, T-Embed CC1101, Marauder boards... You can search, sort by downloads/date/name, and page through results.
GitHub projects The latest release assets of Bruce, ESP32 Marauder, Marauder-for-CYD, Launcher, M5Stick NEMO, GhostESP, ESP32-DIV, NerdMiner v2, Meshtastic, MeshCore, WLED, and PortaPack Mayhem (flashed to a HackRF with hackrf_spiflash). You can add any repo with .bin assets. The board is guessed from asset names. An optional GitHub token avoids rate limits.
Community hubs Firmware people uploaded. Upload my firmware publishes from your library or from files.
Raspberry Pi Imager The official OS list (Imager v4 JSON), Armbian, or any Imager repository URL. It has a Pi 5 filter, opens nested sub-lists, burns to SD/USB, or sets an image as Code Studio's base image.
Random Nerd Tutorials ESP32 / Raspberry Pi / ESP8266 / MicroPython project indexes (titles and links only), with tags. You can open a tutorial or start a Code Studio project that links back to it.
Web-flasher manifest Paste any ESP Web Tools manifest.json URL. All parts are downloaded at their offsets.

Host a hub on this Pi starts the E2 community server (standard library only) on port 8765:

  • There's a browsable black-and-red web page with search and browser uploads, so it works from any phone.
  • It also has a JSON API for E2 clients.
  • Optional upload keys.
  • Every .bin is validated as a real ESP image, and its SHA-256 is stored.
  • It counts downloads and stars.

You can also run it standalone on a VPS: e2 hub-server --port 8765 --token SECRET --public. CLI: e2 hub launcher CYD -q bruce --get bruce, e2 hub github, e2 hub imager, e2 hub rnt "Raspberry Pi".

Coding help: autocomplete, hints and examples

  • Autocomplete as you type, or press Ctrl+Space. It knows:
    • Arduino/ESP32 APIs: Serial, WiFi, ESP, Wire, SPI, Preferences, LittleFS/SD, FreeRTOS, ESP-NOW
    • Module libraries: SmartRC CC1101, RF24, RCSwitch, TinyGPSPlus (gps.location.lat()), MFRC522, Adafruit PN532, NeoPixel, TFT_eSPI, XPT2046, M5Unified (M5.BtnA.wasPressed()), IRremote, ESP32 BLE
    • MicroPython machine/network, and Pi Python: gpiozero, pyserial, spidev, smbus2
    • Java basics and jSerialComm
    • #include and import names, snippets (setup, millis_timer, task, isr, wifi_connect, main, sout...) and identifiers already in your file
    • Member completion follows the declared type, e.g. RF24 radio → radio.setChannel.
    • For Pi Python, jedi adds full introspection when it's installed.
  • Signature hints show under the editor while you type arguments, including which argument you're on.
  • Inline tips catch common mistakes:
    • a long delay() blocking loop()
    • ADC2 pins with Wi-Fi on
    • GPIO 6-11 (flash pins) or input-only pins driven as outputs
    • a missing Serial.begin
    • RPi.GPIO or pigpio on the Pi 5
    • /dev/ttyS0 instead of ttyAMA0
    • time.sleep inside async code
  • 📚 Examples, a gallery inside Code Studio. There are 40+ examples you can search and filter by target:
    • ESP32: FreeRTOS on two cores, LittleFS logger, Wi-Fi scanner, BLE scanner, CYD touch-paint (TFT_eSPI configured through build defines), M5Unified buttons, RC522/PN532 readers, IR decoder, NeoPixel, access-point web panel, ESP-NOW chat
    • MicroPython: Wi-Fi scan, I2C scan, asyncio, NeoPixel
    • Pi Python: I2C scan, Flask GPIO panel, HackRF peak logger, BLE scan, MQTT sensor
    • Pi C++: termios serial, I2C ioctl
    • Java: HTTP status server
    • Each example has a preview. Open project applies its board and flags, or you can Insert at cursor. Examples marked ▶emu run in the emulator.

Look and feel

Black and red throughout, with the Magritte logo "Ceci n'est pas un ESP32."

The background is procedurally generated art in an aggressive shard style. It has extruded 3D red and grey slabs with bevels, black grunge, paint splatter and halftone fields, and a blurred back layer for depth of field. It's blended at 20% under see-through panels.

View → Background art lets you choose Off / 10 / 20 / 35 / 50%. It also has Parallax depth (the layers follow your mouse), Shuffle artwork, and Export as wallpaper for your Pi desktop.

Code Studio (write, build, debug, flash, burn)

Target Language Build Run Debug Exports
ESP32 / CYD / M5 C++ (Arduino) arduino-cli + ESP32 core in the emulator, or flash over USB GDB attached to QEMU .bin / .img full flash image, .elf
ESP32 / CYD / M5 MicroPython pyflakes lint REPL paste in the emulator, or mpremote to a board REPL .bin / .img with your code baked into the filesystem
Raspberry Pi Python py_compile + pyflakes Studio venv pdb bootable Pi .img, .iso, .zip
Raspberry Pi C++ g++ / clang++ native gdb binary, Pi .img, .iso
Raspberry Pi Java javac java jdb runnable .jar, Pi .img, .iso
  • Editor: syntax highlighting, line numbers, auto-indent, find (Ctrl+F), and multiple files per project. Templates cover the CC1101 receiver, nRF24 scanner, GPS readers, the serial CLI, spidev ID checks, and a kernel GPIO blink that needs no libraries and works on both Bookworm and Trixie.
  • Flags: a per-target form.
    • ESP32: board ID (CYD, M5 Core/Core2/StickC/Cardputer/CoreS3, S3, C3...), board options such as PartitionScheme=huge_app,PSRAM=enabled, warnings, defines, extra flags, debug build.
    • C++: compiler, -std, -O, warnings, -g, link libraries.
    • Java: --release, javac flags, JVM args.
  • Build errors show in Problems and are marked in the gutter. Click one to jump to its line.
  • Debugger tab: Continue, Next, Step in/out, Backtrace, Locals and Break @ cursor (F9), plus a raw command line. The editor follows the current line.
  • Suggested libraries come from your #includes and imports, compiler "missing header/module" errors, and your Wiring Lab modules. One click installs Arduino libraries (arduino-cli lib install), pip packages (Studio venv) or Maven jars (downloaded into libs/). It also warns about Pi 5 pitfalls, such as RPi.GPIO and pigpio not working on it.
  • Insert Wiring Lab pins writes pins.h, pins.py or Pins.java from your current wiring.
  • Export / Burn:
    • ESP32: flash images. MicroPython images are "baked" by booting MicroPython in the emulator and writing your files into its flash.
    • Pi: a bootable Raspberry Pi OS .img, built by scripts/build-pi-image.sh. It downloads the latest Lite 64-bit (or uses an image you pick), grows the filesystem, installs your app to /opt/<name>, adds a systemd autostart service, applies your Wiring Lab config.txt overlays, and sets the hostname, SSH and first user. On a Pi 5 it installs apt/pip packages inside the image.
    • .iso data discs, .jar and .zip.
    • Burn to an SD card or USB drive. Only removable drives are offered, and you confirm before anything is erased.
  • Install on Pi sets the app up as an autostart service on the Pi you're using.

Wiring Lab (modules ↔ ESP32 boards ↔ Pi)

Pick a board, tick modules, and you get a colour-coded wiring diagram plus a pin table.

Boards: Raspberry Pi 5 (physical header pins), ESP32 DevKit, CYD 2432S028R, M5Stack Core/Fire, Core2, StickC Plus/Plus2, Cardputer/Cardputer-Adv, CoreS3, ESP32-S3 DevKitC, ESP32-C3 SuperMini.

Modules: CC1101, nRF24L01+ (and PA+LNA), NEO-6M/M8N GPS, PN532, RC522, LoRa SX127x/SX1262, W5500, microSD, SSD1306, BME280, IR TX/RX, 433 MHz pair, WS2812, HackRF One, RTL-SDR, and USB ESP32 boards. Quick kits cover common combos (Sub-GHz + 2.4 GHz + GPS, badge cloning, wardriving, LoRa, SDR station).

How pins get assigned:

  • Shared SPI and I2C buses, with a separate chip-select for each device.
  • On the Pi: SPI0 CE0/CE1 first, then SPI1 is enabled automatically.
  • Bruce-compatible presets where they exist (CYD CC1101 = CS G27 / GDO0 G22; Cardputer-Adv CC1101 = CS G5 / GDO0 G15).
  • Avoids input-only, flash and strapping pins, and flags onboard parts you'd be repurposing (CYD RGB LED pads, speaker, backlight).

Changing pins: pick any pin from the table. Conflicts, input-only pins and I2C address clashes are re-checked immediately.

Exports:

  • Arduino pins.h, with init snippets for each library
  • pi_setup.sh: config.txt overlays, apt packages, serial console off, user groups
  • a Markdown wiring sheet
  • a PNG of the diagram

Apply Pi setup runs the script in a visible terminal, so you see every sudo step. It backs up config.txt first.

Pi Hardware (live tests)

  • Run all tests reads real ID registers over spidev:
    • CC1101 VERSION (0x14)
    • nRF24 SETUP_AW (0x03)
    • RC522 VersionReg (0x91/0x92)
    • SX127x RegVersion (0x12)
    • W5500 VERSIONR (0x04)
  • It also reads NMEA from the GPS (sentence count, fix and satellites), scans I2C (PN532 at 0x24, OLED at 0x3C), and detects the HackRF (hackrf_info), RTL-SDR and USB ESP32 boards.
  • Quick spectrum runs hackrf_sweep / rtl_power with presets for 315/433/868/915 MHz, FM, ADS-B, 2.4 GHz and 5.8 GHz. It draws a live red trace with peak hold and has a Live mode.
  • Setup buttons: install SDR tools, and enable SPI + I2C + the GPIO UART.

Real modules → emulated ESP32 (UART bridges)

Emulation → UART bridges can attach the emulated chip's UART1/UART2 to:

  • a real Pi serial device, for example a NEO-6M wired to the Pi's GPIO UART: UART2 = /dev/ttyAMA0 @ 9600
  • a TCP port, so your own tools can talk to it

The Wiring Lab's Feed UART module into emulator button sets this up in one click. The emulated firmware then reads live GPS over Serial2.

SPI radios (CC1101, nRF24) can't be bridged into QEMU, because it has no SPI device models. Test them on the real Pi, or on a real ESP32 you flash from the app.

CLI

e2 import Bruce-CYD.bin --board cyd-2432s028r
e2 list
e2 info bruce                 # partitions + compatibility
e2 run bruce                  # interactive console (Ctrl-A X quits, Ctrl-A C = monitor)
e2 run app.bin --psram 4 --fwd 8080:80 --display sdl
e2 run bruce --gdb --gdb-wait # then: xtensa-esp32-elf-gdb -ex 'target remote :3333' app.elf
e2 set bruce psram_mb=4 display=sdl snapshot=true
e2 strings bruce -i           # interesting strings only
e2 build bruce -o flash.bin   # QEMU-ready 4/8/16MB image
e2 hw ports
e2 hw dump /dev/ttyUSB0 --name my-cyd
e2 hw flash /dev/ttyUSB0 bruce
e2 boards | e2 chips | e2 doctor

Getting a screen in the emulator

Real CYD/M5 panels are SPI devices QEMU doesn't model. For your own projects, add Espressif's esp_lcd_qemu_rgb component (idf.py add-dependency espressif/esp_lcd_qemu_rgb) behind an #ifdef for QEMU builds. E2 detects it and turns on the display window automatically. LVGL works on top of it. For networking, enable CONFIG_ETH_USE_OPENETH in QEMU builds.

Files

  • App: ~/.local/opt/espemu
  • Library, flash images, logs, QEMU: ~/.local/share/espemu. Override with ESPEMU_HOME.
  • Use your own QEMU build with ESPEMU_QEMU_DIR=/path/to/qemu/bin.

Troubleshooting

  • QEMU exits immediately: run e2 doctor. If libraries are missing: sudo apt install libsdl2-2.0-0 libslirp0 libpixman-1-0 libgcrypt20 libglib2.0-0
  • Boot loops with flash read err or invalid header: the image needs a different flash size. Change Flash on the Overview tab and press Rebuild flash.
  • App crashes in esp_wifi_init: this is expected, because there is no radio. Use an Ethernet (openeth) build if you need networking.
  • USB permission denied: log out and back in after install (dialout group).

Credits

  • Emulator: espressif/qemu (GPL-2.0), downloaded at install time.
  • Bundled 2nd-stage bootloaders (espemu/assets/bootloaders) are built from arduino-esp32 2.0.17 (Apache-2.0). Default eFuse values match ESP-IDF's idf.py qemu.

About

An esp32 app simulator within the Rasp PI OS environment that runs inside of a raspberry pi so you can combine devices. Runs alot of .BIN and other files.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages