← All guides

ESP32 prototype to production: the lessons I learned turning Frame into real units

Getting an ESP32 prototype to work on your desk is the fun part. You flash it over USB, watch the serial monitor, and when something breaks you press reset. Once the same board is in someone else's living room, all of that is gone. You can't see the serial monitor, you can't press reset, and the person who owns it doesn't care why it crashed.

I build Frame on my own: a frame with a 64x64 LED panel that shows photos sent from a phone. It runs on an ESP32-S3 on a board I designed, driving a HUB75 panel, and it talks to my backend over MQTT. This guide is what I learned moving it from a prototype to units that live in other people's homes. None of it is theory. Each lesson comes from something that went wrong or almost did.

Some of these topics have their own deep dive, so here I summarize and link: wiring a 64x64 HUB75 panel to an ESP32, ESP32 brownout with WiFi on a LED matrix and why a HUB75 panel flickers on camera.

The short version

1. Build OTA with rollback before you ship anything

The first thing a product needs that a prototype doesn't is a way to update it without touching it. The second is a way to survive a bad update, because sooner or later you'll publish one.

Frame uses the two app partitions of the min_spiffs.csv layout (app0 and app1), so the new firmware is written to the slot that isn't running and the previous one stays intact. On top of that, the firmware does its own rollback:

  1. After an OTA, it marks the new version as "on trial" in NVS and restarts.
  2. On every boot, while the version is on trial, it adds one to a boot counter in NVS. It saves the counter first thing, before anything that could crash.
  3. If it boots more than three times without the version being confirmed, it switches the boot partition back to the other slot with esp_ota_set_boot_partition() and restarts into the last good version.
  4. If it stays up for 60 seconds, the version is good: it becomes the "last good version", the counter is cleared and it calls esp_ota_mark_app_valid_cancel_rollback().

I tested the rollback on a real ESP32-S3 with a small sketch that copied its own image to the second slot, forced a boot loop and checked that it went back to the good one. It did.

Two things I didn't see coming:

2. Know what every device is running

For a long time I had no way to answer a simple question: which firmware is that frame running, and is it the old board or the new one? With a handful of units you can remember. With more, you can't.

Now every time a frame asks for updates it sends its hardware version and its current firmware version, and the backend saves both on that device's row. It costs two columns and one line in the request, and it's the first thing I look at when someone writes to me with a problem.

3. Make every boot report itself

A device in someone's home that crashes and restarts looks, from the outside, like a device that works. The person might notice the screen going dark for a second. You won't notice anything.

So on every boot Frame publishes a small message with the reset reason (esp_reset_reason()), a total boot counter, the firmware and hardware versions, the free heap and, if the previous boot ended in a panic, a summary of the core dump: the task, the program counter, the exception cause and the backtrace. The backend stores it and classifies it.

What I learned building it:

The telemetry paid for itself quickly. A release that moved the network code to the other core had a multicore bug: a LoadProhibited panic about eight minutes after boot. The boot report caught it, the archived .elf pointed to the line, and the fix went out in the next release that same day. Then the telemetry caught a second panic in the heap's spinlock: Arduino String objects were being changed from both cores at once. Every assignment to a String touches the heap, so a "simple" shared string is shared heap. The lesson: when you split work across two cores, audit every piece of shared state, not just the obvious ones like the MQTT client and the buffers.

4. Power is the first thing to fail in the field

On my desk, Frame's v2 board ran for hours without a problem. In a home with weak WiFi and heavy animation downloads, it chained kernel crashes of different kinds: an assert in the WiFi interrupt handler while the CPU was idle, LoadProhibited, a debug exception with a corrupted stack and watchdogs without a trace. I decoded the traces and none of them went through my code.

That pattern looks like memory corruption from voltage dips, and it fits with the fact that the v2 supply is so tight that the firmware disables the brownout detector on purpose. It's a strong suspicion, not a proven cause yet: the test that would close it is running the same load on a much stronger supply.

What I'll change on the next board: a 3.3 V regulator just for the ESP32, separate from the panel, more bulk capacitance next to the panel, thicker 5 V paths, the antenna away from the HUB75 ribbon, the brownout detector back on, and a voltage divider so the firmware can report the 5 V rail in its telemetry. The full story, and the fixes for any build, are in my brownout guide.

The lesson for production: test your prototype in bad conditions on purpose. Weak WiFi, a bright image, a long download, all at once. Your desk is the best case your product will ever see.

5. What the panel does before your code runs

At boot, Frame used to light a couple of white lines on the panel for a few seconds. A HUB75 panel has no memory: it shows whatever its pins say at each moment, and between reset and the moment the display driver takes over, the pins float. OE (output enable) is active low, so noise can turn the panel on.

Setting OE high and the rest of the pins low as the very first thing in setup() cut the flash from about 3.3 seconds to about 0.3 seconds, measured on the hardware. The 300 ms left are the bootloader, before any of my code runs, so software can't fix them. That's a hardware fix for the next board: a pull-up resistor on OE, so the panel starts off from the moment of reset. More on the pins in the wiring guide.

A prototype can blink at boot. A product that flashes white lines every time it's plugged in looks broken.

6. Keep the network off the display's core

Frame plays short videos at 15 frames per second and downloads the next one while the current one plays. In the first version the download stuttered the video: the MQTT client is synchronous, and while it was busy the main loop wasn't drawing. Measured, I was losing about 13 frames per second during a burst that lasted 3.4 seconds.

The fix was a network task pinned to core 0 that owns the MQTT client, while core 1 only draws and queues what it wants to send. After that, the burst went down to 38 ms and no frames were skipped during the download. The same move fixed another stutter: the NTP update ran in the main loop and blocked for a second on every attempt when the time server didn't answer.

The lesson: anything that can block (network, NTP, a slow HTTP call) doesn't belong on the core that drives the display. And as the previous section showed, moving it to the other core is where the multicore bugs start, so do it with the telemetry already in place.

7. People will film it with their phone

On a product with a screen, people take photos and videos of it. A HUB75 panel that looks perfect to the eye can show dark bands on a phone camera. On my bench, the setting that worked at every brightness was 7 bits of color with a faster clock, for about 343 Hz, and the library had a trap: its color table is chosen at compile time, so changing the color depth at runtime without the matching build flag broke the colors and made a good setting look bad.

All the numbers, and what I ruled out, are in the guide on HUB75 flicker on camera. For production the lesson is short: test with a phone, not only with your eyes.

8. Some bugs live in the hardware you test with

While I was building the update screen, a few faint white pixels kept appearing in the last columns of the panel, only when pixels in that area were lit. I ruled out brightness, total current, latch blanking, clock phase and clock speed. It was physical crosstalk in that one panel's column driver, not the firmware and not the board.

Two habits came out of it:

9. The screen is your only interface, so design it

A product without a serial monitor speaks through its screen. Two small things I changed:

10. Dev builds must never leave your house

This one is very recent. Frame's firmware has a development build with a DEV_MODE flag. It's useful on the desk: it skips the update check at boot and ignores the remote "update now" command, so a release never overwrites the firmware I'm testing. It also draws a small "Dev" in the top left corner of the screen.

In late November one of the beta units I shipped went out with that build. Everything worked, except the one thing that would have fixed it: a dev build never updates itself. The "Dev" marker was there, visible on the screen, and nothing in my shipping process checked for it.

The lessons:

11. Have a recovery path that a customer can use

The way out of that dev build, and the safety net for anything else, is flashing over USB. On my desk that's PlatformIO. For a customer, it's a page: I built an install page on the Frame website with ESP Web Tools, so anyone with Chrome or Edge on a computer and a USB cable can reinstall the latest v2 firmware from the browser.

The details that mattered:

12. Cut hardware versions

Frame has had two boards. The first one (v1) used a classic ESP32 without PSRAM; the second one (v2) uses an ESP32-S3. The only v1 unit I had data from couldn't finish a single animation download without resending frames: 65.6 % of frames resent and 15.3 seconds per download, over 23 downloads, while v2 units on decent WiFi resent none. That's a sample of one unit, so it doesn't prove the design is at fault, but it was another sign.

Every release meant two builds, two binaries and two sets of tests, and every feature needed a fallback for the board without PSRAM. In November I decided v1 is discontinued: it doesn't get updates anymore, and releases are only for v2. For a small product, each hardware variant you keep alive is a second product.

13. Ask for enclosure quotes early

A 3D printed case is fine for a prototype. For production you're looking at injection molding, and the quoting process is slower than any firmware bug. I asked several injection molders in Spain and one overseas rapid manufacturing service. One of the references I got was about $3,720 for the mold and $1.26 per part at 500 units. Many didn't answer at all, and the ones that did often took a long time.

The mold is a fixed cost you pay before selling a single unit, and the per part price drops with volume, so the quotes shape how many units you need to sell for the numbers to work. Start asking long before you need the parts.

A checklist before the first unit leaves your desk

Frame

A Frame on a TV stand showing a photo as pixel art

If you'd rather have a 64x64 panel at home that lights up with photos from the people you love, without wiring anything or debugging a power rail, that's what I'm building. Frame is a small frame with a 64x64 LED grid. Your partner, your parents or your friends open the free Frame app on their phone (iPhone and Android), take or choose a photo, and it shows up on your Frame as pixel art, wherever they are. There's no subscription. I'm building it on my own, and you can read the whole story here.

You can't buy it yet. Frame launches on Kickstarter on February 1, 2027, so it's not a gift for this Christmas. Reserving a Founders spot costs 1 € and gets it for 75 € ($85 in the US and Canada).

If that sounds like you, leave your email below. People on the list get the link on launch day, and whoever reserves gets it for 75 € ($85). And if you're building your own, my guides on wiring a 64x64 HUB75 panel, ESP32 brownout with WiFi and HUB75 flicker on camera go deeper into the hardware.

Best,
Álvaro M.

Kickstarter in February 2027
Waitlist