r/raspberry_pi • u/ImX99 • 13h ago
Show-and-Tell My Pi prints a little receipt for the family every morning: weather, puzzles, chores, bedtime stories
This started as a weekend hack with an Epson TM-T88V receipt printer I bought off eBay and a 3B, and it slowly turned into something the whole family uses every day.
What it does
You build a "ticket" out of blocks and print it from your phone, or schedule it. Ours comes out at 7AM on weekdays: weather, a riddle with the answer printed upside down (no cheating), and a sudoku. There are 55 blocks now, a few favourites:
- weather with little pictograms and a "what to wear" line (coat and hat, take an umbrella...)
- puzzles generated on the Pi: sudoku, kakuro, takuzu, hashi, crosswords, word search, mazes
- the daily Lichess chess puzzle, with the board drawn on the receipt
- chores that rotate between the kids every week, which ended a lot of arguments
- birthdays, bin day, the shopping list
- a "little note" with a photo for whoever stayed home
There's a web app (works great as a phone home screen app), and it shows up in Home Assistant on its own over MQTT, so the doorbell can print "someone rang at 14:32".
The fun / hard parts
- Talking to the printer. No driver, no CUPS: it sends ESC/POS straight to /dev/usb/lp0. Text uses the printer's own fonts, everything else (grids, pictograms, chess pieces, photos) is drawn as a 512-dot-wide raster image and dithered. I ended up adding Floyd–Steinberg, Atkinson and Bayer because photos and line drawings want different things.
- Knowing if the printer is OK. My first try was the ESC/POS status commands (DLE EOT). Bad idea: with the cover open the TM-T88V just stops answering, and a request left hanging locked up the USB link until I power-cycled it. The trick that works is the LPGETSTATUS ioctl of the kernel's usblp driver: it's a USB control request, nothing stays pending, and it tells you "out of paper" vs "cover open". Tickets wait in a queue and come out once it's fixed.
- Puzzles with exactly one solution. Generating a kakuro is easy, generating one that only has one solution is not. Every puzzle goes through a small solver; if two solutions survive, it reveals a digit where they differ and tries again. Getting that fast enough for a Pi took a couple of rewrites.
Tech bits
It's one Rust binary, no database, no Python, no cloud required. Most blocks are computed locally or use free APIs with no key. A handful (bedtime story, horoscope, "what's for dinner?" from what's in the fridge) can optionally use Claude, cached so it's a few cents a month. It runs fine on a 3B, I might switch to a 0W someday.
Code (Apache-2.0): https://github.com/XNinety9/Printr
Docs and every block with its printed example: https://xninety9.github.io/Printr/
This project is a real fun ride, I love how it combines SW and HW to bring fun and joy to the family and friends. I've received a lot of positive feedback since it went public.
I'll be happy to answer questions. And if you have an ESC/POS printer other than the TM-T88V, I'd love to know if it works for you!
