Writing · Checklist
ESP32 e-paper brownouts and resets: a field debugging checklist
When a battery ESP32 e-paper sign fails in the field, the only symptom is that the picture stops changing. To find out why, the device has to record its own story: the reset reason at every boot, the stage the previous boot reached, the supply voltage during the panel refresh, and a short log that rides home with the next successful sync. Below is the black-box log we built into our ESP32-S3 + Spectra 6 firmware, field by field, and the failures it caught.
Published 2026-11-17. Written for firmware engineers and hardware founders with battery e-paper devices in the field. Everything below is from our own firmware and cloud code; the ESP-IDF behavior is linked to Espressif’s documentation.
Why e-paper failures are invisible
E-paper keeps its last image with no power. That is the point of it, and it is also why failures hide. A sign that panics, browns out mid-refresh or never rejoins Wi-Fi still shows yesterday’s content, and there is no serial cable on a wall. Unless the device writes down what happened and sends it somewhere, all you learn is that the content is stale.
Brownout: A supply dip below the level the chip needs to run reliably. The ESP32’s brownout detector resets the chip when it sees one, and esp_reset_reason() reports the next boot as ESP_RST_BROWNOUT.
A panel refresh is the heaviest load in an e-paper device’s cycle, and a Spectra 6 color refresh lasts tens of seconds. Add a radio transmitting at the same time, a part-charged cell and a small regulator, and brownouts during refresh are the first thing to suspect.
The checklist: what to log on every boot
Our firmware writes one line per boot to a file on the device’s flash. The line describes the previous boot, because a boot that browns out cannot write its own obituary. These are the fields and what each one answers:
| Field | What it records | Why it matters |
|---|---|---|
| Sequence number | Which lines the cloud already has | Upload only unacknowledged lines and recover from gaps |
| Reset reason (rr) | Why this boot happened: DEEPSLEEP, BROWNOUT, PANIC, watchdog, power-on | A healthy sign shows DEEPSLEEP every time |
| Wake cause (wk) | Timer, button or none | Separates scheduled wakes from user presses and cold starts |
| Previous stage + ms (prev) | Where the last boot died, and how long after it started | PAINT_START+31000ms means it died 31 s into a refresh |
| Supply at boot / minimum (vb) | Voltage at the start and the lowest reading during the refresh | A deep minimum next to a BROWNOUT is your power problem |
| Busy timeouts (bto) | How often the panel's busy line never released | Points at the panel, its power or its cable rather than the radio |
| Charger state (ip, ips, ipc) | Power-management chip registers, where the board has one | Catches a charger stuck in a low-output state |
| Repeat count (rep) | Identical brownout boots collapsed into one line | Keeps a brownout loop from filling the log |
A line reads like this: rr=PANIC wk=timer prev=PAINT_START+31000ms. That is: the last boot was woken by its timer, started painting, and died with a panic 31 seconds in.
How to build it
1. Track the boot stage in memory that survives a reset
Keep a small struct in RTC slow memory marked RTC_NOINIT_ATTR. Espressif’s memory types guide documents that these values keep their value through deep sleep; on our ESP32-S3 boards they also survive software resets, panics and brownouts, but not a full power loss. Guard the struct with a magic number so a cold start reads as “unknown” rather than garbage. Update a stage field at each step: boot, panel power on, Wi-Fi up, sync OK or failed, paint start, paint done, sleep. Store the time each stage began.
2. Record the reset reason and the wake cause
At boot, call esp_reset_reason() and esp_sleep_get_wakeup_cause(). The Arduino-ESP32 reset reason docs show the same calls. Write both to the log with the previous stage. A healthy timer-driven sign should show a deep-sleep reset and a timer wake on almost every line.
3. Sample the supply during the refresh
A voltage reading at boot misses the dip. We sample the supply from inside the loop that waits for the panel’s busy line, throttled to one reading every 50 ms, and keep the minimum. That is where the refresh surge happens. One honest caveat: this needs a sense pin. Our 13.3-inch board has one; our 7.3-inch board has no known battery sense pin, so it logs zero and we rely on the reset reason alone there.
4. Collapse repeats and cap the file
A device in a brownout loop reboots constantly. Early on, one night produced about 35,000 identical lines and pushed every useful line out of the upload window. Now an identical brownout boot only increments a repeat counter in RTC memory, the file is capped at 12 KB, and it is trimmed to its newest half when it overflows.
5. Upload with the normal sync, then acknowledge
The device already calls home to ask whether its image changed, so the log rides along in that request: up to 32 lines the cloud has not acknowledged yet, oldest first. The device records the highest sequence number only after the server returns 200, so a long offline stretch drains over a few syncs instead of losing its middle. On the server each line is stored per device, deduplicated on device and line text, and pruned after 14 days. A diagnostics write is never allowed to fail the sync itself.
What the log caught for us
- Brownout loops that died about 180 ms after boot, around the moment the panel's power rail was switched on. We added a separate panel-power stage to the tracker so the log could tell that step apart from Wi-Fi.
- Supply dips right at boot and about two seconds after Wi-Fi came up. The firmware now checks the supply before each heavy step, gives a sagging rail up to 10 seconds with the radio off to recover, and otherwise logs it and sleeps for two minutes instead of brownout-looping.
- A panic on the way to sleep: stopping mDNS after Wi-Fi was already torn down walked a dead network interface. The panic rebooted the frame instead of letting it sleep. The fix was ordering the shutdown correctly.
- A charger chip stuck in a low-output state on the 13.3-inch board. The firmware now detects that state, tries to kick the charger, and logs whether it recovered.
The pattern we use around every refresh: turn the radio off before painting, then paint. The heaviest radio and panel loads never overlap, and the battery sees one surge at a time.
Don’t just disable the brownout detector
Forum threads often suggest turning the detector off. Rob Miles hit the same pattern on a battery ESP32, where a sensor’s startup current tripped a brownout instead of a clean wake, and described his workaround of briefly disabling the detector as “masking a hardware problem with a bit of software”. That is the right way to think about it. Find the load step that causes the dip, then sequence the loads, wait for the supply to recover, or fix the regulator and capacitance.
Related reading
Battery life math is in how long battery e-paper signs last. The gaps between a demo and a field unit are in the dev kit to product checklist, and the board itself is in the ESP32-S3 + Spectra 6 guide. If you are hiring someone to build the device, add “what does the device log when it fails?” to the hardware partner checklist.
FAQ
Why does my ESP32 e-paper display brown out during refresh?
A refresh is the heaviest load in the cycle, and on a battery or a weak regulator the supply can sag far enough to trip the brownout detector. It is worse if Wi-Fi is still on while the panel refreshes. Log the reset reason and the minimum supply voltage during the refresh; if the voltage dips and the reason is BROWNOUT, fix the power path or turn the radio off before painting.
How do I find out why an ESP32 reset in the field?
Call esp_reset_reason() at every boot and store the result, together with the wake cause and the stage the previous boot reached, in flash. Then upload those lines with the device's next normal sync so you can read them without a cable.
Should I disable the ESP32 brownout detector?
Not as a fix. It hides the symptom: the supply is still sagging, and the chip may misbehave instead of resetting cleanly. Find the load step that causes the dip and fix the power path, sequence the load, or wait for the supply to recover before the heavy step.
What memory survives a reset on the ESP32?
Variables marked RTC_NOINIT_ATTR live in RTC slow memory; Espressif documents that they keep their value through deep sleep. On our ESP32-S3 boards we also rely on them surviving software resets, panics and brownouts, but not a full power loss, so we check a magic number before trusting the contents.
How many log lines should a battery device keep?
Enough to cover a long offline stretch, capped so the file cannot grow without limit. We cap the log at 12 KB on flash, trim to the newest half when it overflows, and collapse identical brownout boots into a repeat count so one bad night cannot flush out the useful history.