← home

2026-06-04

The ESP32-S3 PhotoPainter: Six-Color E-Paper Imaging and Voice-AI Conversion

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.

Contents

  1. Hardware overview
  2. The Spectra 6 color model
  3. The image-conversion pipeline
  4. Operating modes and image transfer
  5. Cloud activation (xiaozhi Mode 3)
  6. Conversion to a realtime voice assistant
  7. Reference implementation: the epaper-photo converter
  8. Status and open problems
  9. See also

1. Hardware overview

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:

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.


2. The Spectra 6 color model

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:


3. The image-conversion pipeline

3.1 The file-format requirement

The device's image loader accepts a strict format. Empirically, every image stored on a working unit's SD card conforms to it:

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.

3.2 Dithering

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.

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;
}

3.3 Orientation

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.

3.4 Available tools

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:


4. Operating modes and image transfer

The firmware exposes three modes, selected by holding the KEY button (the device announces each by voice):

4.1 Why files cannot be pushed over USB

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).

4.2 Practical transfer methods

  1. Remove the microSD card and copy the BMP into 06_user_Foundation_img with a card reader. Most reliable; firmware-agnostic.
  2. Mode 2 Wi-Fi upload of a pre-dithered BMP. No card removal.
  3. Email-to-frame (architectural). Because a cloud service cannot push to a device behind home NAT, the device must pull: a cloud endpoint receives an emailed image, converts it, and serves "the latest image" at a stable URL that firmware then polls. This requires firmware with URL-polling support (the stock xiaozhi build does not include it out of the box).

5. Cloud activation (xiaozhi Mode 3)

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).


6. Conversion to a realtime voice assistant

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.

6.1 Running vs. clienting

6.2 gpt-realtime-2 and the bidirectionality question

gpt-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.

6.3 Hardware suitability

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.

6.4 Concrete reflash path

To convert the PhotoPainter itself into a gpt-realtime-2 client (overwriting xiaozhi):

  1. Flash the Espressif esp-webrtc-solution/openai_demo (or a xiaozhi fork that proxies to the OpenAI Realtime API), built for the ESP32-S3 target.
  2. Configure the realtime model (gpt-realtime-2) and supply an OpenAI API key.
  3. Map the board's I²S microphone and speaker pins in the firmware's board configuration.
  4. Verify full-duplex capture/playback and barge-in.

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.


7. Reference implementation: the epaper-photo converter

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:

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.


8. Status and open problems

As of June 2026, the state of the work and its unresolved frontier:


9. See also