The ESP32-S3 PhotoPainter is a battery-powered electronic picture frame built around Waveshare's 7.3-inch six-color electronic-paper display and an Espressif ESP32-S3 system-on-chip. Because the panel can physically render only six colors and refreshes slowly, displaying an ordinary photograph requires a specific offline conversion pipeline. The same ESP32-S3 hardware — particularly units that ship with the open-source xiaozhi voice-assistant firmware — is also capable of acting as a realtime voice client to cloud language models. This article documents the panel's color model, the image-conversion pipeline, the methods for transferring images onto the device, and the feasibility of repurposing the board as a speech-to-speech assistant using OpenAI's gpt-realtime-2.
The ESP32-S3 PhotoPainter combines a slow-refresh color e-paper panel with a microcontroller capable of Wi-Fi networking, audio, and SD-card storage. The core components observed on the device's serial boot log are:
303A, product ID 1001), exposing a CDC serial console and a JTAG debug unit — but not USB Mass Storage.A notable property of many units in circulation (including those resold by SpotPear) is that they ship running xiaozhi, an MCP-based open-source AI chatbot firmware (observed version 2.0.1, built on ESP-IDF v5.5.1), rather than Waveshare's stock photo-frame firmware. xiaozhi drives the same e-paper panel through Waveshare's GUI_Paint library but adds voice-assistant and network-configuration behavior.
E Ink Spectra 6 ("E6") is a six-color electrophoretic display technology. The six colors are black, white, red, yellow, blue, and green. It is the successor to the earlier seven-color ACeP ("Advanced Color ePaper"), which added orange.
A crucial subtlety governs all image conversion for these panels: the file format stores idealized monitor primaries — pure #000000, #FFFFFF, #FF0000, #FFFF00, #0000FF, #00FF00 — but the physical pigments are muted and shifted. Real Spectra red renders closer to a dark brick, blue toward navy, and green toward olive. The firmware maps the six stored index colors to the panel's actual pigments at display time.
This distinction defines the difference between a correct converter and a good one:
The device's image loader accepts a strict format. Empirically, every image stored on a working unit's SD card conforms to it:
BI_RGB).A conformant 800 × 480 file is exactly 1,152,054 bytes: a 14-byte file header, a 40-byte BITMAPINFOHEADER, and 800 × 480 × 3 bytes of bottom-up, BGR-ordered pixel data (rows happen to be 4-byte-aligned at this width, so no padding is added). Waveshare's own files declare 96 DPI (a pixels-per-metre value of 3780 on both axes); matching this byte-for-byte is harmless and avoids any risk with a strict parser.
Because the palette is only six colors, dithering is what makes a photograph legible — it trades spatial resolution for apparent color depth by scattering palette colors so the eye blends them.
convert.py is, in essence, resize + Floyd–Steinberg quantize to the six-color palette — with no brightness, contrast, or saturation adjustment. Its sample images look vivid simply because they were pre-selected to be punchy.The minimal palette and nearest-color core, in TypeScript:
// The six indices stored in the BMP (the firmware maps these to real pigments).
const PALETTE = [
[0, 0, 0], // black
[255, 255, 255], // white
[255, 0, 0], // red
[255, 255, 0], // yellow
[0, 0, 255], // blue
[0, 255, 0], // green
];
// Nearest palette color by squared RGB distance (a calibrated converter would
// instead measure distance against the panel's real pigment colors).
function nearest(r, g, b) {
let best = PALETTE[0], bestD = Infinity;
for (const [pr, pg, pb] of PALETTE) {
const d = (r-pr)**2 + (g-pg)**2 + (b-pb)**2;
if (d < bestD) { bestD = d; best = [pr, pg, pb]; }
}
return best;
}
The panel is physically landscape (800 × 480), and the xiaozhi firmware is landscape-only. A true 480 × 800 portrait BMP is center-cropped to the landscape frame on upload. To display a vertical photograph full-frame, the standard technique is to rotate the image 90° into the 800 × 480 canvas and physically turn the frame on its side. The conversion is lossless for content (the portrait fills the rotated frame); only the viewing orientation of the device changes.
| Tool | Dithering | Color model | Notes |
|---|---|---|---|
Waveshare convert.py |
Floyd–Steinberg | idealized primaries | Official; resize + quantize only, no enhancement |
| Toon-nooT converter | Atkinson | calibrated/measured | Brightness/contrast/saturation controls |
| epdoptimize | configurable | calibrated | JavaScript library; tone-maps then maps back to device colors |
dcm31/epaper-photo |
Floyd–Steinberg (+ optional enhancement) | idealized primaries | Browser + email converter; see §7 |
The dcm31/epaper-photo converter is embedded live below — it outputs spec-correct 800 × 480 / 480 × 800 24-bit BMPs, offers a "rotate-to-fill" portrait mode, and serves the genuine Waveshare sample images for upload testing:
The firmware exposes three modes, selected by holding the KEY button (the device announces each by voice):
06_user_Foundation_img, with scheduled wake-ups.http://192.168.4.1). The uploaded image must already be a dithered 24-bit BMP.A natural assumption is that, since the device is connected by USB, a host could copy a file to it. On this firmware it cannot. The USB peripheral presents only CDC serial and a JTAG debug unit; there is no USB Mass Storage function, and the SD card is owned by the firmware over SPI. The only host-to-device channel over USB is the ESP32 ROM bootloader (via esptool), which reads and writes flash — i.e. firmware — not the SD filesystem. Exposing the SD card as a USB drive would require firmware that implements TinyUSB MSC (as the RP2040-based "PhotoPainter (B)" does).
06_user_Foundation_img with a card reader. Most reliable; firmware-agnostic.The xiaozhi AI conversation mode is not self-contained; it binds the device to a cloud account. After Wi-Fi configuration, the device displays or speaks a six-digit verification code. The owner creates an account at the xiaozhi console, chooses Add Device, and enters that code to bind the unit, after which speech-to-speech conversation works (the free tier uses a Qwen realtime model). The code is generated by the device for the user to enter on the website, not something the user must already possess. If no code ever appears, the unit may be pre-bound by the reseller or pointed at a non-default server, which requires reconfiguring the over-the-air/server URL. A config.txt on the SD card holds third-party keys (e.g. Volcano Engine text-to-image).
A frequent question is whether the PhotoPainter could run a model such as OpenAI's gpt-realtime-2. The answer separates cleanly into two cases.
gpt-realtime-2 is a large cloud model; no microcontroller can perform that inference locally.openai-realtime-embedded, built and tested on the ESP32-S3, and Espressif maintains an openai_demo in its esp-webrtc solution. Critically, xiaozhi is already this architecture — microphone audio is streamed to a cloud backend and the response is played back; pointing it at OpenAI is a change of backend, not a new capability.gpt-realtime-2 and the bidirectionality questiongpt-realtime-2, released 7 May 2026, is OpenAI's first realtime voice model with GPT-5-class reasoning, a 128K-token context window, and improved tool use, alongside companion models gpt-realtime-translate and gpt-realtime-whisper. From an embedded client's perspective the model is entirely server-side — upgrading to it is one parameter (model: "gpt-realtime-2"); the on-chip code is unchanged.
The interaction is not a one-way pipeline but a single full-duplex session. Over one WebRTC peer connection, microphone audio flows up while the model's voice flows down simultaneously, with server-side voice-activity detection providing barge-in (the model stops speaking when the user starts). The ESP32-S3 supports full-duplex I²S audio (capture and playback at once), so the bidirectionality is provided by the transport itself rather than something built on top.
WebRTC on the ESP32 requires DTLS-SRTP, an Opus codec, and audio buffers — comfortable with PSRAM, infeasible without it. This makes the SoC variant and memory decisive:
| Board | SoC | PSRAM | Audio | Realtime client? |
|---|---|---|---|---|
| ESP32-S3 PhotoPainter | ESP32-S3 | 8 MB | mic + speaker (frame-grade) | Yes — right chip; audio quality is the open question |
| M5Stack AtomS3R AI Kit / CoreS3 / Atomic Echo Base | ESP32-S3 | 8 MB | dedicated mic + speaker | Yes — M5 ships OpenAI/xiaozhi firmware via M5Burner |
| M5StickC PLUS | ESP32 (LX6) | none | PDM mic; SpeakerHat | No — lacks PSRAM |
| M5StickC PLUS2 | ESP32 (LX6) | 2 MB | PDM mic; SpeakerHat | Marginal — non-S3, low PSRAM, and the built-in mic and SpeakerHat contend for I²S/GPIO, making clean full-duplex difficult; practical only via a server-proxied WebSocket pattern |
The lighter alternative for memory-constrained boards is to offload WebRTC to a server: the device speaks a simple WebSocket (PCM) to a personal edge function that holds the OpenAI connection — the pattern used by projects such as ElatoAI.
To convert the PhotoPainter itself into a gpt-realtime-2 client (overwriting xiaozhi):
esp-webrtc-solution/openai_demo (or a xiaozhi fork that proxies to the OpenAI Realtime API), built for the ESP32-S3 target.gpt-realtime-2) and supply an OpenAI API key.Open questions before committing a reflash: whether the PhotoPainter's frame-grade microphone and speaker are adequate for conversation, and whether the demo's audio codec configuration supports this specific board without bring-up work. The e-paper panel is irrelevant to the voice use case — its refresh rate is far too slow for live visuals.
The conversion logic described above is implemented as a standalone Val Town val, dcm31/epaper-photo (source). Keeping it in its own val (rather than inline in this article) lets the live converter be embedded here while the code remains independently runnable. Its routes:
GET / — mobile-friendly converter page (embedded in §3.4).GET /test.bmp, GET /test-portrait.bmp — generated six-color test patterns (a color-bar image proving all six colors render).GET /canonical/2, GET /canonical/4 — the genuine Waveshare sample images, extracted from the official device demo and cached in blob storage (byte-identical to the originals; useful for isolating upload problems from conversion problems).POST /convert — accepts an uploaded image plus orientation (landscape / portrait_rot / portrait), fit (cover / contain), and enhance (none / punchy / max); returns a spec-correct 24-bit BMP.portrait in the subject selects portrait).Internally it uses a dependency-free TypeScript BMP encoder and Floyd–Steinberg ditherer (so the generated test images work regardless of any image library), with Jimp for decoding and resizing user uploads. Because these routes are public HTTP endpoints, they double as a small API that any automated client can call — a POST of an image to /convert returns a panel-ready BMP with no human in the loop, and GET /canonical/2 yields a known-good reference file for validation. A natural future enhancement is to add Atkinson dithering and a calibrated Spectra-6 palette behind a toggle, matching the third-party converters in §3.4.
As of June 2026, the state of the work and its unresolved frontier:
gpt-realtime-2 client (§6.4) is concrete, but two variables remain unconfirmed on this specific board: the frame-grade microphone/speaker quality, and whether the esp-webrtc-solution/openai_demo audio-codec configuration supports the PhotoPainter without board bring-up.