RC RANDOM CHAOS

Hacker turns a programmable e-ink reader into a real network printer

· via Hacker News

Original source

How to build a printer

Hacker News →

A developer bought an Xteink X3 e-ink reader because its CrossPoint firmware was fully programmable, then grew tired of the clunky upload flow that required joining the device’s hotspot and using a browser upload page. Reasoning that something that looks like paper should behave like paper, he decided to make it a genuine printer — one that shows up in the macOS Print dialog. He implemented the Internet Printing Protocol (IPP) directly on the reader, advertising monochrome 300 dpi output, A5/Letter media, and Apple/PWG raster formats, and used Bonjour/mDNS (including the _universal subtype needed for driverless discovery, which required calling ESP-IDF’s mDNS API rather than the Arduino wrapper) to announce the service, cheekily named ‘penguin.’

The hard part was memory. A Letter page at 300 dpi is roughly 8.4 MB uncompressed, while the ESP32-C3-based device has about 400 KB of RAM and was left with only 6.8 KB of free heap once Wi-Fi and the print server were running. The workaround was to skip buffering the page entirely: incoming rows are decoded, scaled, and dithered to black-and-white on the fly and written straight into the RAM already reserved for the display’s screen image, reusing the working space row by row. The finished page is then saved as a BMP to the SD card using the existing screenshot writer, which frees room for socket buffers.

The result is a self-contained print server running on the reader itself, able to join a Wi-Fi network or spin up its own hotspot, that rendered a test manga page in about a second. Beyond the novelty, it’s a tidy demonstration of streaming image pipelines and constrained-memory engineering on cheap embedded hardware — and of how open, programmable firmware plus a standard protocol like IPP lets hobbyists repurpose consumer gadgets. The code, including the printer implementation, lives in the author’s CrossPoint fork.

Read the full article

Continue reading at Hacker News →

This is an AI-generated summary. Read the original for the full story.