Skip to content(if available)orjump to list(if available)

Show HN: Printercow – Turn any thermal printer into an API endpoint

Show HN: Printercow – Turn any thermal printer into an API endpoint

88 comments

·January 21, 2025

I've always been fascinated by thermal printers – there's something magical about seeing text and images materialize on paper in seconds. But I found that working with them programmatically was always a pain. You either had to deal with ancient printer protocols or use clunky vendor-specific SDKs. So I built Printercow (https://printercow.com) – it turns any thermal printer into an HTTP endpoint with just one command.

Technical details: - Supports any ESC/POS compatible printer (Epson, Star Micronics, etc.) - Handles paper widths from 58mm to 120mm - Automatic image dithering and scaling - Built-in failover protection for high-volume scenarios

Don't have a printer yet but want to try it out? I've got you covered! When you sign-up you get 300 free prints and you can watch your creations come to life on my printer via Twitch live stream (https://twitch.tv/printercow). Perfect for testing your integration before committing to hardware.

I'm particularly excited about the AI integration possibilities. Instead of yet another chat interface, you can have AI generate content that exists in the physical world – artwork, poems, todo lists, custom receipts, etc.

Would love to hear your thoughts, feature requests, or creative use cases you can think of! Also happy to answer any technical questions about the implementation.

freedomben

This is a great idea, and it looks like you've done a great job! I share your enthusiasm for these printers. I have a Rongta receipt printer sitting on my desk that I like to play with :-)

I have a business usecase for something like this (now that Chrome doesn't allow printing to ESC/POS), and exposing the printer interface as an HTTP API is a clever and great solution! But, sending the data through a third party is a complete no-go for us for reasons of compliance. For this architecture to work for us we would have to host it on our VPN and serve it from our own domain as our customers have a strict whitelist.

As cool an idea as this is, honestly though I don't think this should be a SaaS. Certainly it doesn't fit the typical mold of SaaS where there's nothing to install because it's all delivered through the web. Given you have to install a local Pi or other, you lose all the benefits of SaaS and also incur all the downsides of SaaS. It feels like it was shoehorned into a SaaS because otherwise it would be very hard to monetize. I don't blame you for that because it is indeed a hard problem to figure out how to get paid (in fact I've abandoned good ideas prevously because it was either SaaSify something that shouldn't be a SaaS or else face huge obstacles getting paid), but I wanted to share my thoughts honestly.

black_puppydog

I can see the value in this, but I don't get why it needs to be a SaaS. Don't get me wrong; a revenue stream for something this obviously useful is great! But why not just make it dual licensing; non-commercial projects get it under AGPL or some custom license that prevents them from using it commercially. Everyone else gets a bog-standard yearly license or such... Why not?

jmann99999

I completely agree with this.

It would be nice to try it with SAAS and then buy a local license.

It is similar to the Tydbit device [0] where you can program the device but it runs on their cloud. That is fine unless Tydbit goes out of business. That fear of loss stopped me from doing too much programming with it.

I think the same may be true here.

[0] https://tidbyt.com

lionpixel

I like this! Thanks for the feedback!

TheNewsIsHere

I have a home project that is actually a great fit for this, but a SaaS service would be a hard stop. Self-hosted or bust for my use case.

I mean, it would be a waste of _your_ resources to host it for my use case too!

RadiozRadioz

Interestingly I made this same exact thing a few years ago for a company I worked at.

Raspberry pi connects to the printer, pi runs a daemon, Daemon connects to a central server and downloads stuff to print, server runs an API with a friendly endpoint.

Difference with mine is that I used CUPS on the pi and generated PDFs for it. I supplied a custom PPD to make the printouts extra crisp, but other than that the OS handled it for me. What I wrote was little more than a PDF generator and a basic spooler.

I can attest that this method is very reliable, if you're looking for confirmation that this architecture can be used in production.

I do question whether it's worth paying for this as a SaaS though. Speaking as someone who has built this, I'd probably build it again and it doesn't take long to get "good enough". The bulk of my time was spent on improving the printout quality from the built-in driver. Which was fun but unnecessary.

mrtksn

Okay, the question is: Can it print with a Cat Printer?

You know, the cheap toy-like printers? Like this: https://www.amazon.co.uk/Portable-Instant-Bluetooth-Wireless...

I was trying to hack mine to use it with an app I want to create for personal use. Currently only prints using the official Fun Print app over a bluetooth connection.

There are projects[0]that are supposed to work with a cat printer but mine specifically isn’t. It identifies itself as “MXW01” , which is different that the printers tested.

[0] https://github.com/NaitLee/Cat-Printer https://github.com/bitbank2/Print2BLE

KomoD

As far as I understand it:

If it supports ESC/POS commands then yes, otherwise no.

namero999

Funny, just today I finished reversing a similar toy printer, the "bear" printer, not the "cat" one, and writing a driver/library for it in Rust just for the sake of finally learning a bit of it.

Looking at the code you shared, it seems like the cat has quite a different protocol than the bear. The opcodes seem different, and there seems to be some sort of crc happening that is completely absent in the bear. So I doubt my code will work without major adjustments.

In case you missed it, the first link you shared also has a "test unknown printer", so maybe yours is just a minor hardware iteration but might work nonetheless!

e28eta

long shot: I’ve got a USB-based ESC/POS printer, but couldn’t get my mac nor RPI to recognize it as a printer through CUPS.

The printer shows up in the USB tree, but (maybe?) needs a driver to be recognized as a “printer”? I was trying to follow tutorials that treated it as a line printer, but unsuccessfully.

Any idea how much luck I will have if I try this out? Does this project rely on working drivers? Or does it handle the raw USB communication?

It’s an IBM-branded Type 4610 Model TF6.

codazoda

Inspired by other receipt printer projects on HN, I just purchased a MUNBYN P075 printer last week. I thought it was going to be a lot more complex than it was. I thought I'd have to write ESC/POS codes manually to generate images, for example. But, it's actually quite simple, since there is a printer driver.

I also decided to make a text file for my daily progress report and shoot that over to the printer with `nc`. The only ESC/POS code I'm using is to send the cut command.

I'm also surprised how FAST these printers are now.

Everyone I told I was buying a thermal receipt printer gives me an inquisitive look. I expected that from a lot of people but I was surprised to get the same response from the tech people I work with.

Anyway, they are lovely little devices.

lionpixel

Great choice MUNBYN printers are awesome! Recently I found that NETUM thermal printers are even cheaper for comparable performance. :)

avgDev

Interesting project. I am assuming this is not geared towards business clients who print thousands of labels a day, but more of a fun things to print to thermal printers for individuals? Correct me if I am wrong.

I like the twitch stream, fun approach.

I've wrote quite a few labels in ZPL, which is used for Zebra printers. The reason I've used ZPL code is that serialization happens on the printer itself. Therefore, it is an easy fire and forget.

Can this integrate with a zebra printer? Can this handle large number of prints? Serialization?

sometinsome

Nice! you've built a whole product around and the Twitch demo is great.

In case you need a very basic version of this, I've created a project some time ago, where you can print text over a template, also trough an API and using ESC/POS compatible printers:

https://github.com/emi420/esc-pos-server-print

Toxygene

Very cool. I created a thermal printer project a few years back that prints (low quality) proxies of Magic: the Gathering cards based on the rules for "Momir Basic". It was a fun project, though formatting images to work with the various ESC/POS image formats was quite a challenge.

https://magic.wizards.com/en/formats/momir-basic https://imgur.com/gallery/momir-basic-irl-g2S3hJT

PokeyCat

Very cool! I did a similar project with an accompanying app that connected to one of these inexpensive printers over Bluetooth in order to play a Discord, Lord of Disharmony commander deck in person.

The portability of the whole setup makes it easy to bring to an LGS, it's always a treat to see people's reactions when I pull out the printer and they see how the deck works!

lionpixel

In case you don't want to create an account, you can just comment with your prompts and I will enter them myself. You can watch let it print on https://twitch.tv/printercow then. :)

nolroz

Ok how about a D&D style character sheet for a Lvl 2. Aarakocra barbarian. Lets make it brief and fun with emojis and include prompts for basic rolls and a way to keep track of health points by filling in bubbles or boxes.

voidUpdate

Aww, I was hoping you'd done something fun with the actual firmware of the printer to turn it into something that can receive requests, but its just printing from a pi

rounce

What's the story if you want to self-host?

lionpixel

Speaks nothing against this - though give it some time to leave the alpha phase. Hosting is super easy using Docker and e.g. Coolify as PaaS right now.

rounce

Is there a public repo?