r/esp32 • • Mar 18 '25 Bravo

Please read before posting, especially if you are on a mobile device or using an app.

257 Upvotes

Welcome to /r/esp32, a technical electronic and software engineering subreddit covering the design and use of Espressif ESP32 chips, modules, and the hardware and software ecosystems immediately surrounding them.

Please ensure your post is about ESP32 development and not just a retail product that happens to be using an ESP32, like a light bulb. Similarly, if your question is about some project you found on an internet web site, you will find more concentrated expertise in that product's support channels.

Your questions should be specific, as this group is used by actual volunteer humans. Posting a fragment of a failed AI chat query or vague questions about some code you read about is not productive and will be removed. You're trying to capture the attention of developers; don't make them fish for the question.

If you read a response that is helpful, please upvote it to help surface that answer for the next poster.

We are serious about requiring a question to be self-contained with links, correctly formatted source code or error messages, schematics, and so on.

Show and tell posts should emphasize the tell. Don't just post a link to some project you found. If you've built something, take a paragraph to boast about the details, how ESP32 is involved, link to source code and schematics of the project, etc.

Please search this group and the web before asking for help. Our volunteers don't enjoy copy-pasting personalized search results for you.

Some mobile browsers and apps don't show the sidebar, so here are our posting rules; please read before posting:

https://www.reddit.com/mod/esp32/rules

Take a moment to refresh yourself regularly with the community rules in case they have changed.

Once you have done that, submit your acknowledgement by clicking the "Read The Rules" option in the main menu of the subreddit or the menu of any comment or post in the sub.

https://www.reddit.com/r/ReadTheRulesApp/comments/1ie7fmv/tutorial_read_this_if_your_post_was_removed/


r/esp32 • • 7h ago

I made a thing! I built a custom ESP32-S3 portable DAP / MP3 player

108 Upvotes

I wanted an offline MP3 Player and I decided it would be a great project for my very own first PCB, so I designed and assembled one designed around an ESP32-S3.

The Hardware

MCU: ESP32-S3-WROOM-1-N16R8

Audio: A PCM5102A paired with a MAX97220A

Display: 2.0" SPI TFT

Power: AP2112K for regulating down to 3.3v and an ETA6002 for the charging paired with a 1500mAh battery.

PCB: A 2 layer board that's the size of a credit card

The reason of this MCU

The main reason I went with an S3 was the memory, price and GPIO, having PSRAM allows me to load full songs (or big chunks of them) into memory, decreasing the power draw. Native USB is also a benefit as it can be used for Mass Storage mode and simplifies the PCB.

Runtime

Currently it draws around 85mA during playback without the screen, giving roughly 16 hours of playback on a single charge.

Current Issues

While I did try to seperate analog components from the digital ones I do still get a faint hiss on sensitive IEMs like mine that is at 108dB. Since I also used a resistor divider for reading the battery voltage, as expected it is not quite accurate.

Things to be improved

For the next version I would probably go with an IC that handles both DAC and the amplification alone along with a lower power MCU to improve the power draw even more, proper fuel gauge would also be a big benefit.


r/esp32 • • 9h ago

I made a thing! I Ran My 30M Parameter Model locally on an ESP32 at 1.12 Tokens/s (8 MB Flash, 8 MB PSRAM)

Post image
110 Upvotes

I’ve been building this project for a few months. It started because I kept hearing that running a language model on an ESP32 was impossible (like literally impossible???)

I didn’t like the sound of that, so this is what I decided to do with several months of my life 😂

I ended up with a 30M parameter model that runs offline on a XIAO ESP32-S3. It generates 1.12 tokens/s using the board’s flash and PSRAM.

Dataset: I used FineWeb-Edu and TinyStories for general text, and SODA, OASST1, UltraChat, and smol-smoltalk for dialogue.

Tokenizer: SentencePiece BPE with a vocabulary of 6,144 tokens.

Architecture: I wanted to try different architectures just out of curiosity. I also wanted to understand why people use GQA in language models in the first place so I chose Transformer GQA, Shared Transformer, GRU, GRU with Local Attention, Mamba-1, RWKV-7, Gated DeltaNet, and Causal TCN. I gave all 8 the same small amount of training data (10M tokens) to see which one would do best.

I tried tests like these:

  1. Predicting the next token in text the model hadn’t seen before
  2. Picking which sentence sounds right or which answer makes sense in context
  3. Answering everyday reasoning questions
  4. Looking up a number or remembering two facts
  5. Seeing how well each model did with 20 seconds to train

Transformer GQA did best overall, so I ended up sticking with it. I checked how my model was doing at 50M, 100M, 200M, and 300M tokens. (By my estimate, getting to 300M tokens took about seven and a half hours on my computer). At that point, I went with that checkpoint and focused on making the replies better.

After I shared the project online for the first time , I got a lot of useful comments. So I decided to improve replies and get the model to run faster.

What helped to improve quality of my model's replies:

  1. I gave it more examples of the kinds of replies I wanted it to give.
  2. I gave it good and bad answers to the same question and trained it to prefer the better one.
  3. I went through the mistakes it kept making and gave it more practice on those, using the same chat format it sees on the device.

What helped to improve speed:

  1. I processed several input tokens together so the board could reuse the weights it had just read.
  2. I used INT8 SIMD so the chip could do several calculations at once when scoring the next token.
  3. The biggest change was compressing some weights to 3 bits so they’d fit in PSRAM. That let the board generate the whole reply using flash and PSRAM, with the microSD card used at startup.

With the same prompts on the same board, generation went from 0.76 to 1.12 tokens/s.

For a 30M model I thought the replies were pretty good! It could get what I was talking about, give a relevant answer and stop on its own. Here are some examples:

Me: - i baked a cake!

AI: - That sounds delicious.

Me: - my paper kite finally stayed in the air!

AI: - That sounds amazing.

Me: - my paper kite tore before it got off the ground.

AI: That sounds hard.

I don’t work in this field, so I’m not sure how companies approach projects like this. This was just a personal project I did out of curiosity and for fun! For some reason, I learn best by trying things myself and I’m sure I’ve made a few mistakes along the way 😅

GitHub code, model files, and setup guide
Training, speed improvements, and the live touchscreen demo
My first PocketGPT build


r/esp32 • • 7h ago

I made a thing! LoRa sensor in my mailbox for notifications with two Heltec V3 boards

Thumbnail
gallery
24 Upvotes

I live on the fifth floor and my mailbox is downstairs.

Too far for Wi-Fi or Bluetooth, so I used LoRa.

Now I get a notification on my phone when mail arrives.

WHAT I BOUGHT (ABOUT €70)

- A 2-pack of Heltec V3 compatible LoRa boards with antennas and 3000 mAh batteries

- A pack of reed switches with magnets (I only needed one)- Two wiresWHAT I 3D-PRINTED

- A case for each board (Johnneil's "Case for Heltec V3/V4 with 3000mAh Battery" on Printables)

- A flap for the mail slot, because mine didn't have one: flap, hinge bar and a small spacer for the reed switch. A short piece of thin iron wire is the hinge pin. The magnet sits on the flap.

HOW IT WORKS

- The board in the mailbox runs on battery and sleeps almost all the time.

- When mail lifts the flap, the magnet closes the reed switch. The board wakes up, sends a LoRa message and goes back to sleep.

- Once a day it also wakes up to send its battery level, so I know it's still alive.

- The second board stays at home, receives the message and passes it to Home Assistant as a normal ESPHome device.

WIRING

Two wires, nothing else: the reed switch goes between 3V3 and GPIO6. No resistor.

The firmware uses the chip's internal pull-down and keeps it active during deep sleep.

FIRMWARE

Two ESPHome configs, written with Claude's help. I flashed both boards from the browser with web.esphome.io, with nothing installed on my computer.

IN HOME ASSISTANT

- Phone notification and a voice announcement in the kitchen when mail arrives

- A "Mail waiting" switch that turns on by itself. I turn it off when I collect the mail.

- Battery level with a low-battery alertIt's been running for a couple of weeks. With the 3000 mAh battery I expect somewhere between 14 months and 2 years per charge.

Photos, a short video, the wiring diagram and the STL files for the flap are in the write-up: https://www.sec-ttl.com/lora-mailbox-sensor-esp32-home-assistant/If you want the two ESPHome configs and the Home Assistant package, message me and I'll share them.


r/esp32 • • 1h ago

I made a thing! I built an automatic water dispenser using Home Assistant and a $10 water jug pump

Thumbnail
gallery
5 Upvotes

A few weeks ago I had to leave town for 4 days and couldn't find a water dispenser practical enough for my dogs. Every option I saw had low capacity and could overflow or stop working.

So against the clock I decided to build one. The goal was to keep it simple and quick to put together, so I used a standard 20L water jug as the reservoir and hooked up one of those cheap water dispenser pumps you can find anywhere.

To control it I used an ESP32, and for sensing I used a small float switch to tell if the bowl/tank is at level or not. As the actuator, I wired straight into the pump's button and used a standard relay module to switch it.

Once I had everything working, I got a bit carried away with AI and added a full Home Assistant integration so I can check fill history and spot if something stops working for any reason.

It worked great during the trip, though it broke a couple of times over the next few weeks. One time the pump somehow got stuck on, so I tweaked the run times a bit and haven't had issues since.

I know it's pretty basic and has plenty of failure points and room for improvement, but I liked putting together something quick, simple, and functional. Attaching the code in case it helps as a starting point for anyone here.

https://github.com/Opentronika/ESP32-Water-Feeder

  1. I chose an ESP32-DevKit 1 so that anyone can replicate it.
  2. There is no major reason for choosing specific libraries; just go with the most standard and simple options: ESP-IDF with MQTT for integration.
  3. Nothing too complicated; I ran into a few issues with how the relay works (I have to set the GPIO as an input to turn it off) and with hacking the pump to adjust the toggle duration.

r/esp32 • • 15h ago

I made a thing! Update: I made a wrist-synth! (get the firmware and mod it)

57 Upvotes

Hallo r/esp32, I went to Synthfarm, a residency program for people who are interested in, or play/build music synthesizers, and I built this using the Waveshare ESP32S3 AMOLED (I posted this two days ago, but the firmware wasn't on github yet)

Firmware (GPL3): https://github.com/layogtima/spacecrud

Demo it in your browser: https://spacecrud.layogtima.com

What it does: record up to 60 seconds with the watch’s mics, and it splits into four screens to play around with sounds/audio recorded

Why this board: has two mics (ES7210), a DAC, amp and speaker (ES8311 + NS4150B), accelerometer, touch AMOLED, and 8 MB of PSRAM for the tape

How it’s built

  • PlatformIO + Arduino-ESP32, Arduino_GFX for the panel (art is from a WIP space game)
  • 32 kHz audio, one 64-sample block every 2 ms
  • Core 1 only makes sound; core 0 does touch, tilt and the screen rendering
  • The engine is plain C++, so the same code runs on the watch, in tests and in the browser (as an 80 KB WebAssembly file; used Claude Code for these bits)

What didn't/doesn't work well

  • speaker sometimes rattles below about 170 Hz
  • it's still tricky to use unless you get used to it
  • repetitive sounds work poorly compared to a varied sound sample

Built with lots of help from friends at Synthfarm.

If you have this board, and flash it - I would love to know how it works out for you!


r/esp32 • • 24m ago

Hardware help needed Designed a modular RFID keycard armory for my airsoft pistols: ESP32-S3 + RC522 + 2.8" TFT, one servo lock per door (renders, printing next)

3 Upvotes

Hey r/esp32, here's a project I've been designing: a stackable, keycard-locked storage/display locker for airsoft pistols. Video is the assembly animation with some sound effect :) . Not printed yet, these are renders. First vault goes on the printer this week.

**How it works**

- One "terminal" module on top: ESP32-S3 DevKitC-1 (N16R8), 2.8" ILI9341 SPI screen, RC522 reader behind the faceplate

- Each vault module below has its own SG90/MG90S servo. The horn swings into a hook on the back of the door to lock it

- Tap a card → screen shows ACCESS GRANTED → that door's servo unlocks

- Modules stack and join with printed dovetail keys, from 1 vault up to a whole wall, all run by one ESP32

- Cable holes line up through every module so the servo leads run up to the terminal

- 100% printable enclosure, zero supports, fits a 256 mm bed

**Planned pinout**

| Signal | GPIO |

|---|---|

| SPI SCK/MOSI/MISO (shared TFT + RC522) | 12 / 11 / 13 |

| TFT CS / DC / RST / LED | 10 / 9 / 14 / 21 |

| RC522 CS / RST | 15 / 16 |

| Servos 1–8 | 4, 5, 6, 7, 17, 18, 38, 39 |

Avoiding 26–37 since the N16R8's octal PSRAM uses them.

**Where I'd love input before I write the firmware:**

  1. Anyone run an RC522 and an ILI9341 on the same SPI bus without issues? Any gotchas?
  2. Servos straight off the S3's GPIOs, or should I go PCA9685 once there are 4+ vaults?
  3. Power: running everything off a 5 V 2 A USB-C, moving one servo at a time, plus a 470 µF cap at the servo rail. Enough, or am I asking for brownouts?
  4. Would you add anything? I was thinking door-closed sensing so it auto-relocks.

Will post the real print and the first unlock when it's done. Files will go on MakerWorld once I've printed and tested one.


r/esp32 • • 19h ago

I made a thing! Halo — A Modern, Open-Source Desk Lamp for Your Cozy Moments

Thumbnail
gallery
72 Upvotes

A little light can make a workspace feel different.

Halo is a compact, rechargeable RGB desk lamp designed to bring ambient lighting and a touch of colour to your everyday spaces.

Built around the Waveshare ESP32-C3 Mini, Halo combines custom 3D-printed mechanical components, an ultra-slim RGB LED strip and a rechargeable power system in a minimal, circular design.

Inside the Design

Mechanical & 3D Printing

  • Custom enclosure designed from scratch in Autodesk Fusion 360
  • Four-part enclosure assembly
  • 3D-printed housing and structural components
  • Circular diffuser designed for smooth, uniform illumination

Embedded & Lighting

  • Waveshare ESP32-C3 Mini as the central controller
  • Ultra-slim 2.7 mm Waveshare RGB LED strip
  • Custom Arduino firmware using FastLED
  • Automatic ROYGBIV colour cycling with five-second intervals

Power & Portability

  • Rechargeable 18650 Li-ion battery
  • USB Type-C charging
  • Compact, cable-free design

Designed to Be Built

Halo is a complete, documented maker project. The repository includes the firmware, Fusion 360 CAD files, STL models, circuit diagrams and build resources.

The idea is simple: create a thoughtfully designed desk lamp that anyone can build, customize and make their own.

Whether it's on your desk, bedside table or shelf, Halo adds a little colour to your everyday moments.

Explore the Project

I'd love to hear your thoughts on the design, enclosure, lighting and possible improvements.


r/esp32 • • 2h ago

Board Review LEDs on cheap Amazon ESP32S3 board (FORIOT ESP32-S3 Supermini)

2 Upvotes

I bought this supercheap 4-pack of ESP boards: https://www.amazon.com/dp/B0H8MV4RGZ and while I haven't played with them much, so far so good. The only issue so far is that while I can get the RGB LED working, the red LED in the corner of the board is always on and I'd like to turn it off.

The fourth picture in the product page shows the pinout, with the WS2812 LED on "GP1048 RGB Light" [sic] and I have in fact been able to get that light to light using GPIO48 in code.

However, the pic also says the red LED to the left of the USB connector is "GP1048 LED light"

Clearly, both LEDs aren't going to be on GPIO48, righ....

....oh. Oh no. Oh no no no no....

<edit... compile... flash... test...>

Yes. Yes they are.

Sigh.

Well. That's certainly a design choice.


r/esp32 • • 16h ago

I made a thing! a tiny webserver on an ESP-01

Post image
22 Upvotes

https://github.com/codewitch-honey-crisis/clubhouse_www

I wanted to make the smallest little webserver I could so I chose an ESP-01, which is ESP8266, not ESP32 based. It has 80KB of RAM, and 1MB of flash running at 80MHz, wifi only in terms of radio.

I utilized the arduino framework due to issues with the native RTOS support on the ESP8266 under PlatformIO

I have several bits of tooling involved in making the project work.

ClASP is used to embed a React site into a C header for delivery over a waiting socket.

htcw_buffers is used to generate serdes code for the struct sent over the websocket.

I used my gfx_web to create the headers for the font and icons.

In terms of libraries, I am using my htcw_gfx library for the display.

The main hassle was fitting everything into flash, and figuring out a way to deliver ClASP content without the ESP-IDF. I had never done it from Arduino before.

The thing is ClASP expects a waiting socket to send data out on, and it handles the HTTP headers, encoding, etc.

With the ESP-IDF you can get a socket handle off of a web request and take over the handling yourself.

With Arduino I had to write a remedial webserver and websocket mechanism by hand. Fortunately it wasn't too bad, but figuring out I had to do it in the first place took more time than I care to admit.


r/esp32 • • 13h ago

Board Review ESP32S3-Plus arrived today

11 Upvotes

The ESP32-S3-Plus has just arrived and I’m looking forward to trying it out. The Plus means I have lots of PSRAM to use for audio announcements, at least I hope so. It’s going to be the uC element of my e-paper Lantern status monitor, all battery powered of course and BLE communications between the lanterns and monitor.


r/esp32 • • 5h ago

I made a thing! ESP32-S3 handheld: 31.5 full-screen redraws/s and a microSD slot on the same SPI wires

2 Upvotes

I’m building Kodeck, a small ESP32-S3 handheld for learning to program. I wanted to share two bench results and the design trade-off behind them.

Hardware: ESP32-S3 N16R8, 320×240 ILI9341V SPI panel at 40 MHz, 8 MB PSRAM, FT6336U touch over I²C. The microSD slot is on the display module. SCK, MOSI and MISO are shared; LCD_CS and SD_CS are separate. A 320×240 RGB565 framebuffer is 153,600 bytes.

Bench results: 31.5 full-screen redraws/s. A 64 GB FAT32 card read at 1,532 KB/s and wrote at 737 KB/s in a separate bench test. These are separate workloads. A full framebuffer at 40 MHz takes about 30.7 ms on the wire before overhead, which is why I distinguish full redraw rate from what a game actually renders.

On the bench I used two ESP32 SPI controllers on the same wires and switched ownership in software. Before a card operation I wait for display DMA to complete and release the display bus. After opening and reading the file I end the SD session, put its chip select high and reinitialize the display bus. I load assets outside the frame loop so SD I/O doesn’t interrupt drawing. The approach is working on the wired prototype.

For anyone who has shared a display and SD this way: have you seen a display module keep driving MISO with its CS high? What would you check first on the scope if handoffs were intermittent?


r/esp32 • • 13h ago

I made a thing! php-esp32-sdk 2.0: the upstream PHP interpreter on ESP32-S3/P4, now on ESP-IDF v6.1.1

Thumbnail
php-baremetal.com
6 Upvotes

php-baremetal runs the real Zend engine (PHP 8.3 to 8.6) cross-compiled on top of ESP-IDF. PHP's memory lives in PSRAM, so the targets are the ESP32-S3 and ESP32-P4 with PSRAM (2 to 32 MB). Chips without PSRAM aren't supported.

2.0 is a rewrite. What might interest this sub:

  • ESP-IDF v6.1.1 (was v5.5.5), installed by the CLI.
  • ESP32-S3 tuning, set in the SDK: CPU at 240 MHz instead of the 160 MHz default, a 32 KB instruction cache instead of 16 KB, and an 8 KB main-task stack instead of 32 KB (it uses about 1 KB, and the 24 KB go back to internal RAM for Wi-Fi). Boards can also move Wi-Fi/lwIP/mbedTLS buffers to PSRAM and tune the static buffer count, which is what lets Wi-Fi start next to a double-buffered 1024x600 RGB panel. QIO flash where the board supports it.
  • Boards are JSON files (chip, PSRAM, flash, and peripheral blocks for display, I2C, touch, LED, microSD…). Drivers read the blocks, so Ws2812::onboard() already knows the LED pin. A project can override a block or add one, for example an SPI microSD slot on a generic S3 module, and every pin is checked before anything compiles.
  • Pin names: the new Arduino Nano ESP32 and Seeed Studio XIAO ESP32-S3 board files expose D13, A3, LED_BUILTIN to PHP as Pin::LED_BUILTIN. Waveshare, Freenove and Espressif DevKitC boards are supported too.
  • Slate: a retained-mode scene graph that composes only the bands that changed. A still screen costs zero frames.
  • Fixes measured on hardware:

    • Uninitialised PSRAM chunk headers caused zend_mm_heap corrupted on up to 20 of 20 cold starts of a large app. Now 0 of 20.
    • On the P4, core 1 polled the scheduler with no pause and could stall core 0 before app_main. One image faulted on all 102 starts; with the fix, none.
    • A closure-cache patch leaked about 49 B per bind(). Now 9M rounds run with flat memory.

bash

composer global require php-baremetal/phpbm php-baremetal/conductor
phpbm sdk:install esp32 && phpbm init blink
phpbm toolchain:install && phpbm flash && phpbm monitor

Write-up with diagrams: https://www.php-baremetal.com/blog/php-esp32-sdk-2-composer-firmware

Custom composer Registry : https://repository.php-baremetal.com/ with all available package

web simulator, built on Velxio: https://sim.php-baremetal.com/

Github: https://github.com/php-baremetal/php-esp32-sdk

It's an independent, MIT-licensed project, not affiliated with Espressif. If you have an S3 or P4 board that isn't covered, a board file is a small JSON. Which boards should we add next?


r/esp32 • • 14h ago

I made a thing! Cheap Echo clone repurposed into ESP32 Music Assistant Audiobook reader..

6 Upvotes

Cannibalised a cheap Aliexpress Echo clone, ripped out the insides, retaining the speaker and the button board which I was able to re-purpose.. Now a nice little bedside ESP32 for reading audiobooks from Music assistant with led effects..

Teardown, schematic and yaml on github https://github.com/dm2912/esp32_media_speaker/

(note the schematic has an 18 led ring, but i went with 8, for the sole reason, the 8 led arrived in the post first.. as it turns out, it was more than adequate)

needs more hotglue :D (everything is soldered, the glue was just to avoid breaks when cramming it in the case)


r/esp32 • • 1d ago

I made a thing! New to ESP32s and already amazed by what they can do.

Post image
269 Upvotes

Hey Reddit! I’m 15, and since my summer break, I’ve been developing an experimental blockchain for innovation and learning purposes. The blockchain itself isn't really the main topic here, so I’ll try to keep things simple. A blockchain can be an open network that anyone can join (what we call a P2P network—though a blockchain isn't necessarily a P2P network, and a P2P network isn't necessarily a blockchain, you get the idea...). The issue is that when a P2P network is just starting out, you usually need to find peers to connect to, so I decided to make this easier by building a bootstrap node. It's basically a participant in the network that acts as a meeting point.

Sorry for the pretty long post that doesn't necessarily fit this sub, I just wanted to share this because I’m amazed that a tiny circuit board costing under 10 euros can become the central point of a network and act as a sort of server.

Thanks for reading, and feel free to ask if you have any questions or recommendations!


r/esp32 • • 15h ago

I made a thing! ESP-NOW long-range mode as a bike-to-bike voice relay for a motorcycle group intercom (open source, ESP-IDF)

6 Upvotes

I'm building Vroo, an open-source group intercom for motorcycle riders. The phones do the audio work (Opus, encryption), and an optional ESP32 box on each bike carries voice where there's no mobile signal.

How the box is designed:

  • it runs a Wi-Fi access point for its rider's phone, and talks to the other bikes' boxes with ESP-NOW in long-range mode
  • it's a deliberately simple relay: it never has the group key, so it can't decrypt anything. It reads a small plain routing header, filters by group, drops duplicates and passes packets on
  • firmware in C on ESP-IDF 5.x, with the packet logic in a component that has host-run tests, sharing test vectors with the app

Where it is: phone to box works on my desk (an iPhone and an Android phone talking through one box, 10–30 ms round trip). Box to box is the next step, and I'd love advice from anyone who has used ESP-NOW long range outdoors:

  • realistic range between two moving bikes, and antenna placement (I'm planning on ESP32-WROOM-32U boards with external antennas)
  • how many 20 ms voice streams fit at the long-range rate once packets are relayed over a few hops
  • running the soft AP and ESP-NOW together on one radio

Repo (GPL-3.0): https://github.com/shubhanjanmedhi/vroo


r/esp32 • • 20h ago

I made a thing! Streaming 5 GHz camera video with an ESP32-P4 screen and ESP32-C5

16 Upvotes

With 55 neighbor routers crowding 2.4 GHz around my desk (~76% channel load), I wanted my DIY Home Assistant hallway camera off 2.4 GHz instead of building around another ESP32-S3 camera board. Espressif's ESP32-C5 brings 5 GHz Wi-Fi 6, though it has no camera interface or display bus of its own. Meanwhile, the 8-inch ESP32-P4 camera touchscreen I bought had the MIPI-CSI camera pipeline, MIPI-DSI display, and hardware JPEG encoder I needed, except its internal companion radio was a 2.4 GHz-only ESP32-C6. Holding that onboard C6 in reset at boot let me wire a small ESP32-C5 onto its three-wire UART so the P4 handles video and UI while the C5 handles 5 GHz Wi-Fi.

Both chips run ESP-IDF 5.5. I looked at esp-hosted and PPP network tunneling first, then dropped both because Wi-Fi retries over a three-wire UART with no RTS/CTS flow control can stall the pipe; sending framed JPEGs into a custom ESPHome component on the C5 kept failure modes simple and gave me native Home Assistant discovery without maintaining a separate MQTT or RTSP stack. On the P4 side, Espressif's esp_video V4L2 stack and hardware jpeg_encode driver made more sense than porting older DVP-focused esp32-camera code or burning CPU on software JPEG, squeezing 320x240 frames into ~6 KB in about 3 ms while LVGL 9.3 drives the 8-inch UI and live charts at 15 fps.

My first fresh P4 build went straight into a boot loop, which is how I learned ESP32-P4 boards in the wild span early silicon and newer v3.0 steppings that need separate sdkconfig targets. Once it booted and I spent a few late nights going back and forth with AI on the glue code, two link quirks showed up at 2 Mbaud. Without hardware flow control, a sharp, text-heavy scene could swell past the C5's 16 KB UART buffer or block the UI thread, so the P4 drops frames non-blockingly when the wire is busy and re-compresses oversized frames harder on the fly. A normal dual-band Wi-Fi scan on the single-radio C5 also parked the radio off-channel long enough to freeze the live feed, so I interleaved 130 ms passive listens on one channel with 140 ms windows back on Channel 153 to flush queued frames. That scanner picked up 68 physical radios on 5 GHz vs 55 on 2.4 GHz around my desk, which looked like a bug in my math until the per-channel view showed only 8 of them sharing Channel 153 with me.

Plotting P4 serial output right above C5 Wi-Fi output on the screen also made wireless retries easy to spot, while keeping Wi-Fi video traffic at zero whenever nobody has Home Assistant open. The camera is still aimed at my office ceiling while I put off designing a rear mount for the C5, with source code, prebuilt images for both P4 revisions, and build notes on GitHub:

https://github.com/limengdu/xiao-esp32c5-labs/tree/main/D2-HA-5GHz-Sensor


r/esp32 • • 12h ago

Software help needed no serial data received error

3 Upvotes

for context i have been working on a couple projects over the last couple weeks using some esp32s3 i ordered, so far i have had no issues with them up until last night, when i suddenly started getting this error of "no serial data received"

so far among the things i have tried:

-pressing and holding the boot button during uploads

-holding boot and pressing rst during uploads

-different cable for upload

-updated drivers for my boards

-uploading with no wiring attached

-using a different device to attempt an upload

-using those websites that check for activity on the board (same error appears)

-restarting PC

What's most confusing to me is that this just happened randomly, I had literally uploaded something 2 mins earlier and all of a sudden this error appeared, even on boards that i know work because their projects are still functioning, another thing is i opened some of my sealed esp boards and they uploaded just fine, both the fake and real ones so i am utterly confused as to what to do because i don't wanna throw away perfectly good esp boards so as a last effort I'm asking if u guys could please help me out!


r/esp32 • • 1d ago

I made a thing! I built my own AI Desktop Assistant using ESP32-S3 and Gemini

Post image
69 Upvotes

The project combines an ESP32-S3 N16R8, an ST7735 TFT display, an INMP441 microphone, and a MAX98357A audio amplifier with a speaker.

The system communicates with a Python server running on my PC, which connects to Google’s Gemini API to handle AI interactions.

Current features:

• Voice interaction

• AI-powered responses using Gemini

• TFT display interface

• Wi-Fi connectivity

• PC-hosted Python backend

My goal was to build a compact desktop assistant that combines embedded electronics with cloud-based AI.

This is still a work in progress, and I’m planning to improve its capabilities further.


r/esp32 • • 23h ago

Software help needed ESP32-P4 Native USB (OTG/TinyUSB) Not Enumerating on Windows

6 Upvotes

Hi everyone,

I'm working on a computer vision project using an ESP32-P4-Pico-M board and a Raspberry Pi Camera Module v2 (OV5647). I need to transfer captured image data from the ESP32-P4 to a Windows PC over the board's native USB port.

I'm currently trying to get native USB device communication working in Arduino IDE, but the USB device does not enumerate on Windows.

Hardware

  • Board: Waveshare / Spotpear ESP32-P4-Pico-M
  • MCU: ESP32-P4, silicon revision v1.3
  • PSRAM: 32 MB
  • Flash: 32 MB
  • Native USB: P1 4-pin connector (USBD_N, USBD_P, GND, VCC_5V)
  • Programming/debug: Separate onboard CH343 USB-UART bridge, connected to COM6
  • Host: Windows PC

The P1 native USB connector is separate from the CH343 programming/debug port. I am using COM6 to upload firmware and monitor logs, while P1 is intended for native USB communication with the PC.

Software

  • Arduino IDE
  • ESP32 board package by Espressif Systems: 3.3.11
  • Board selected: ESP32P4 Dev Module
  • Upload mode: UART0 / Hardware CDC
  • USB mode: USB-OTG (TinyUSB)
  • USB CDC On Boot: Disabled
  • Chip Variant: Before v3.00
  • Flash size: 32 MB
  • PSRAM: Enabled

What I have already verified

Previously, I used ESP-IDF 6.1 on this same board and successfully:

  • Booted the ESP32-P4.
  • Initialized and tested the 32 MB PSRAM.
  • Detected the OV5647 camera.
  • Initialized the camera through esp_video.
  • Captured an 800 × 800 RGB565 image.
  • Verified that the captured image data changes between frames.

I also confirmed from the board schematic that P1 is the native USB connector and is separate from the CH343 USB-UART interface.

I previously attempted native USB using ESP-IDF/TinyUSB, but P1 did not enumerate on Windows. I switched to Arduino IDE to try a simpler USB device test.

Current problem

I located the Espressif USB library's USBSerial example directly in the installed Arduino package and compiled/uploaded it through COM6.

The upload completed successfully. However, the native USB connection on P1 still does not appear to enumerate as a USB CDC device on Windows.

I also tried the Arduino IDE's USB Keyboard example, but it failed to compile because it uses the generic Arduino Keyboard library and cannot find HID.h:

C:\Users\parth\AppData\Local\Arduino15\libraries\Keyboard\src/Keyboard.h:25:10:
fatal error: HID.h: No such file or directory

This appears to be the generic Arduino Keyboard example rather than an ESP32-P4-specific native USB example.

After flashing the USBSerial sketch, the programming UART showed the following boot output:

ESP-ROM:esp32p4-eco2-20240710
Build:Jul 10 2024
rst:0x1 (POWERON),boot:0x20f (SPI_FAST_FLASH_BOOT)
SPI mode:DIO, clock div:1
load:0x4ff33ce0,len:0x1174
load:0x4ff29ed0,len:0xd08
load:0x4ff2cbd0,len:0x3518
entry 0x4ff29ed0
E (113) esp_core_dump_flash: Incorrect size of core dump image: -2061056978

The output stops there. I am not currently trying to debug the core-dump warning; my immediate goal is to get native USB device enumeration working.

What I need help with

  1. Has anyone successfully used the ESP32-P4-Pico-M native USB P1 connector as a USB device with Arduino-ESP32?
  2. Is USB-OTG (TinyUSB) the correct Arduino Tools setting for native USB device mode on the ESP32-P4?
  3. Are there known issues with native USB CDC enumeration on Arduino-ESP32 3.3.11, especially on ESP32-P4 revision v1.3?
  4. Is there a minimal, known-working Arduino sketch for the ESP32-P4 that enumerates as USB CDC or another USB device class through the native USB connector?
  5. Are there any specific board-level requirements for enabling the native USB peripheral on this board that are not covered by the Arduino ESP32P4 Dev Module configuration?

I would appreciate advice from anyone who has successfully used native USB on this board or a similar ESP32-P4 board.

Thanks!


r/esp32 • • 1d ago

I made a thing! I made a STICKMAN DECATHLON on esp32 s31 mosacio

23 Upvotes

A decathlon-style game where the board is the controller: shake to sprint, tilt in rhythm to swim/cycle/paddle, punch to throw. Ten events, hot-seat multiplayer, replays, ghosts, OTA updates and an optional online leaderboard. Video above, source at the bottom.

## Why the ESP32-S31 / ESP-Mosaico

Honestly, I picked the board before the chip: the Mosaico has everything a handheld game needs in one package: a 480×480 AMOLED, an IMU, audio, a vibration motor, a battery with a fuel gauge, and USB. But the S31 turned out to matter:

- **32 MB of PSRAM** is what makes replays and ghosts possible. Every event records per-frame state snapshots and replays them through its own renderer.
- **Enough CPU to software-render the whole screen at 40 fps** (everything is drawn in code, no sprite sheets apart from a few kayak sprites), with time left for audio synthesis.
- **16 MB of flash** fits two 3 MB OTA slots plus a separate NVS partition for the leaderboard cache.
- **Wi-Fi** for the leaderboard sync and OTA, but it's only switched on during a sync to save the 65 mAh battery.

## Libraries, and why

- **ESP-IDF 6.1 (plain C), not Arduino.** I needed direct control over DMA, the partition table, OTA with bootloader rollback and the USB stack. Most of the hard problems below would have been hidden (or unfixable) behind Arduino's abstractions.
- **No LVGL, my own strip renderer.** LVGL is great for widget UIs, but a game redraws the whole screen every frame. I render 48-row strips into two DMA buffers (one being drawn while the other goes out to the panel), so I never need a full framebuffer in the hot path.
- **TinyUSB CDC (through the board's USB console component)** for the serial port, plus a small protocol of my own to stream screenshots to a Python script. That's why the screenshots are pixel-perfect.
- **No MIDI player on the device.** A Python script converts national anthem MIDI files into melody + bass tables at build time, and a tiny software synth plays them. Much smaller and more predictable than parsing MIDI at runtime.
- **ESP Web Tools + esptool-js** so people can install it from the browser without installing ESP-IDF.
- **Cloudflare Workers + D1** for the leaderboard: no server to maintain, and the free tier covers a hobby project. Syncs are signed per board and sanity-checked server-side.

## Hurdles and edge cases

- **The serial port wasn't what I thought it was.** I assumed the game's COM port was the S31's built-in USB-Serial/JTAG. It's actually a TinyUSB CDC device on the USB-OTG HS controller. The USJ driver installed fine and received... nothing. On top of that, writing binary data through stdout got corrupted, because the console VFS translates line endings. The fix was talking to the TinyUSB CDC API directly, and muting logs while a screenshot is streaming.
- **Two COM ports.** The running game and download mode enumerate as different ports, and toggling RTS resets the chip. My flash script has to reset into download mode, wait for the other port to appear, then flash.
- **The fuel gauge lies for this battery.** The BQ27220's state of charge is way off for a 65 mAh cell, so the battery percentage comes from voltage instead.
- **Gestures you can't actually do.** My first discus had you physically spin the board. It was impossible and a bit dangerous. Flicking the board while steering a ball was too hard as well. The controls that work best turned out to be rhythm tilting and rolling a ball around the screen with tilt.
- **You can't watch the screen while shaking it.** Every action needed an eyes-free cue (a sound plus a vibration pattern), otherwise the 100 m was just guessing.
- **Keeping saves across updates.** NVS stays fixed at 0x9000 so OTA updates never touch records or athletes. Boards flashed before I changed the partition layout needed one web flash to move over.
- **Real-world Wi-Fi.** Testing on a phone/PC hotspot that gave no usable DNS, so the board falls back to public DNS servers.

## Known limitations

- It only runs on the Mosaico. Porting means swapping the board layer (display, IMU, audio).
- Gesture thresholds are tuned mostly on me, so I'd like to hear how they feel in other hands.
- The leaderboard has sanity checks but isn't cheat-proof.

Feedback welcome, especially on the gesture detection and the renderer.

Source: https://github.com/1verysimple-lab/stickman-decathlon
Flash from the browser: https://1verysimple-lab.github.io/stickman-decathlon/


r/esp32 • • 1d ago

I made a thing! I Built an Offline Dictation Device with ESP32-S3 (for my AI and second brain) | PocketOS

Thumbnail
youtube.com
19 Upvotes

My first post here, I am building a little device that will act as my main entry point for AI and second brain with voice dictaction by default - there are many challenges but recently a paper on oido really surprised me so I had to try it

Code not included for the moment as this is still in totally more than beta - I will post updates on the YT channel as the thing goes

But for the more curious I suggest this Oído: Open-Vocabulary Speech Recognition on a $5 ESP32-S3


r/esp32 • • 1d ago

I made a thing! Custom wake word & Keyword spotting on esp32-s3

43 Upvotes

- New custom keywords can be added without any training. Just retrieve the encoding from the web console and paste it in your code. Up to 15 keywords can be used in parallel.

- CPU: It uses 45% of one of the cores at 240 MHz and 63% at 160 MHz. During silence, CPU consumption will be close to zero.

- Memory: Very low RAM usage (15 KB) without any heap allocation. 300 kB of Flash, which can be optionally moved to PSRAM for slightly better performance.

- 8 languages are supported (English, Spanish, German, French, Italian, Chinese, Japanese, Portuguese). Each has its own library build.

- License is MIT for the demo and Apache 2.0 for the engine (TinyKW).

the demo: https://github.com/alexpg05/esp32-s3-keyword-spotting
the library: https://github.com/alexpg05/tinykw

Happy to provide support for other chips or listen to specific requests.


r/esp32 • • 1d ago

Advertisement I built LaunchGuard, an ESP32 weather display for RC flying and model rocketry

69 Upvotes

I kept checking Windy and my phone's weather app before going flying, then mentally putting the wind, gusts and cloud conditions together to decide whether it was worth heading out. I wanted a dedicated device that made those checks easier to read, so I built LaunchGuard.

The video shows the side button stepping through +2, +4, +6 and +8-hour forecasts, then switching between RC aircraft and model rocketry modes with a longer press.

The hardware is an ESP32, a 3.5-inch ST7796 SPI TFT, three separate status LEDs and one physical button in a 3D-printed enclosure, powered over USB. The firmware uses the Arduino framework and TFT_eSPI. Weather comes over Wi-Fi from a backend using Open-Meteo for a selected US ZIP code; the enclosure doesn't contain local weather sensors.

A couple of firmware details: hourly forecasts are cached on the ESP32, so stepping through them doesn't trigger a new HTTP request. Button input is sampled in a separate FreeRTOS task and passed through a queue so quick taps can still be captured during blocking network requests. Tap, mode-switch and setup actions are separated by press duration.

The display shows wind, gusts, rain chance and cloud cover, with GO / CAUTION / NO-GO indicators based on adjustable limits for the selected mode. It's a planning aid; local conditions still need checking before flying or launching.

I'd be interested in feedback on the single-button interface, and I'm happy to answer questions about the build.

Disclosure: I make and sell these. My Etsy listing is https://www.etsy.com/listing/4623677466/launchguard-wi-fi-weather-display-for-rc

AI assisted with the wording of this post; the device and demo footage are mine.