Urgent.News

What's breaking now, across thousands of outlets.

Tech

How to build a printer

Article URL: https://nishantjosh.dev/blogs/how-to-build-a-fking-printer/ Comments URL: https://news.ycombinator.com/item?id=49617255 Points: 307 # Comments: 59

On an ordinary day, a writer pondered the concept of crafting a printer. Curiosity led them to stumble upon the Xteink X3, an e-ink display. Intrigued, they noticed the device's programmable nature, prompting them to customize it further. They began altering the CrossPoint firmware, introducing features like distinct boot animations, dice shaking for random outcomes, and a LinkedIn QR code for professional networking.

The writer realized that if the Xteink resembled paper, it ought to function like paper. This notion sparked the idea of utilizing the Internet Printing Protocol (IPP), which enables computers to interact with printers. Following this, they determined the printer's capabilities, such as monochrome output, 300 dpi resolution, one-sided printing, and accepting Apple raster and PWG raster formats.

To facilitate communication between the MacBook and the Xteink, the writer designated the printer with the name "penguin," employing Bonjour to broadcast an _ipp._tcp service. They incorporated universal subtype support to allow macOS to automatically discover the printer. Transmitting a page to the Xteink proved to be just one aspect of the task; receiving it was equally crucial.

An A5 or Letter page at 300 dpi equated to approximately 8.4 MB of grayscale pixels. Given the Xteink's limited resources, with only 400 KB of RAM, the writer devised a solution. They opted to use memory mapping on the SD card, effectively simulating additional RAM. This allowed the Xteink to act as a storage device, with the incoming page undergoing transformation and directly written to the display.

The writer executed this process row by row, utilizing the display's reserved RAM as working space. The decoded pixels were then arranged on the screen, with each completed page saved as a BMP on the SD card. The printer server ran on the Xteink itself, enabling it to join a Wi-Fi network or create its own hotspot. Saved printouts could be accessed on the reader through a folder on the SD card.

Through tireless effort, the writer successfully printed a manga page from Mushoku Tensei, experiencing a significant improvement in visual quality. The printer server, developed within the CrossPoint framework, was integrated into the Xteink, ensuring seamless functionality. With this creation, the writer had effectively built a printer capable of printing documents directly onto an e-ink display.

Written by urgent.news from Hacker News's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

This story

This is one outlet's version. Read the fullest account.

Read the original at nishantjosh.dev →

More in Tech

More from Tuesday 8 September →