[HN Gopher] Show HN: Printercow - Turn any thermal printer into ...
       ___________________________________________________________________
        
       Show HN: Printercow - Turn any thermal printer into an API endpoint
        
       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.
        
       Author : lionpixel
       Score  : 97 points
       Date   : 2025-01-21 11:06 UTC (11 hours ago)
        
 (HTM) web link (www.printercow.com)
 (TXT) w3m dump (www.printercow.com)
        
       | lionpixel wrote:
       | 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 wrote:
         | 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.
        
           | Allstar wrote:
           | We've got you covered!
           | 
           | https://sales-and-dungeons.app/
        
       | ksdme9 wrote:
       | The whole twitch demo thing is genius and fun. Do printer
       | companies usually not provide a first party apps or integrations?
        
         | lionpixel wrote:
         | When it comes to regular ink/laser printers: yes. When it comes
         | to thermal printers, you are normally left alone with just the
         | ESC/P protocol, plus most printers handle the commands in a
         | different way. The way I solved this issue is to write an image
         | buffer directly to the printer, circumventing the protocol and
         | always ensuring that prints look the same regardless of the
         | printer.
        
           | xp84 wrote:
           | Are prints as clear and as fast printing everything as an
           | image? Or are there some tradeoffs?
        
       | sometinsome wrote:
       | 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
        
       | smokeydoe wrote:
       | This is really cool. I used to enjoy toying with thermal printers
       | until I found out the paper is coated with a very fine dust of
       | BPA. Still they sell thermal printer cameras on Amazon marketed
       | for children
        
         | lionpixel wrote:
         | Indeed. But there are some good BPA-free alternatives on the
         | market
        
           | echoangle wrote:
           | Is there any way to verify that without getting a Lab to do
           | an analysis? I'm not sure if I can trust stuff labelled BPA-
           | Free from Amazon for example.
        
             | kube-system wrote:
             | Even if they are, that doesn't mean they're safer
             | 
             | https://www.epa.gov/sciencematters/are-bpa-substitutes-
             | any-s...
        
               | heeton wrote:
               | That study looked at 6 similar plasticizers.
               | 
               | The alternative chemicals for thermal paper are totally
               | different. That's not to say that they are guaranteed
               | safe, but that study is inapplicable.
               | 
               | E.g. one type of paper claims to use Ascorbic Acid
               | (vitamin C). No idea what else is in it of course, but
               | it's not a BGA-analogue plasticizer.
        
               | kube-system wrote:
               | > E.g. one type of paper claims to use Ascorbic Acid
               | (vitamin C). No idea what else is in it of course, but
               | it's not a BGA-analogue plasticizer.
               | 
               | How would you know it doesn't, if you don't know what's
               | in it?
               | 
               | Regardless, my point is that many BPA-analogue containing
               | products advertise their BPA-free status.
        
             | heeton wrote:
             | Buy from a reputable seller for anything important, instead
             | of amazon.
             | 
             | Or, there are apparently at-home testing chemicals that
             | look simple to use. I haven't done it myself though.
        
               | echoangle wrote:
               | The question is who is reputable. Even when buying from a
               | well known store, I don't know how they audit their
               | suppliers, because the paper is bound to be made by some
               | company I've never heard of.
        
             | xp84 wrote:
             | Yeah I would assume that given how easy it is to start a
             | new Amazon seller account and how impossible it is for some
             | random seller in China to face legal repercussions from the
             | US, the likelihood of finding an "_____-free" item to
             | actually be made of whatever the cheapest and most readily
             | available formulation is. (Including the _____), is pretty
             | high.
        
         | detritus wrote:
         | Yeah, I've had a couple of odd looks from other people in the
         | supermarket when my daughter's piped up about not being allowed
         | to touch the shopping receipts, haha.
         | 
         | I do get the impression companies are beginning to move back to
         | traditional printed receipts, at least a bit, here in the UK.
        
         | madphilosopher wrote:
         | Look for kitchen printers. They're dot-matrix / ink ribbon
         | receipt printers for use in restaurant kitchens, where the
         | plate warmers and other sources of heat will turn thermal paper
         | completely black. So, instead, they use rolls of ordinary bond
         | paper.
         | 
         | The fact that they make a loud noise every time an order comes
         | through is useful for a restaurant kitchen, too.
         | 
         | The Epson TM-U220 is one model to consider.
        
       | heeton wrote:
       | This is awesome! I have a very hacky prototype doing something
       | similar, you've put way more effort into PrinterCow and it looks
       | great.
       | 
       | What's the tech? (I'm crossing my fingers for Elixir/Nerves but I
       | suspect that's still a bit niche)
       | 
       | Edit, I'm now signed up - though I'm struggling to find the
       | install instructions for the RPi.
        
         | lionpixel wrote:
         | Thanks so much! Elixir was on my list but decided for Fastify
         | (Node v22), Postgres and Vue3 in the end as these are the
         | things I am more familiar with. :) The command is on the
         | Printercow homepage - though proper docs are coming by end of
         | the week.
        
           | heeton wrote:
           | (I meant for the Pi software)
           | 
           | Edit: had a look at the firmware and it's not Nerves - but
           | that's fine! I was just curious :)
        
             | lionpixel wrote:
             | Raspberry Pi Installation: - Open Raspberry Pi Imager -
             | Select Raspberry Pi OS Lite (32bit) --> Lite is without
             | desktop environment and saves some Memory on the PI :) -
             | Start the Pi and enter: curl -fsSL
             | https://printercow.com/pi/install.sh -o install.sh \ &&
             | chmod +x install.sh \ && sudo ./install.sh
        
       | dmd wrote:
       | > 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.
       | 
       | Incredible. Instead of just creating online trash that nobody
       | wants to read, it can create physical trash too! For maximum art,
       | it can feed directly into a shredder.
        
         | heeton wrote:
         | Extremely shortsighted take.
         | 
         | I currently use a local LLM to scan my notes, meeting
         | transcripts, todo list and calendar. I currently have an iPad
         | that displays some items (e.g. if I have important personal
         | tasks to do today that I might have forgotten) and I would love
         | it to be printed out like this.
         | 
         | Nothing to do with generating novel text, it's just used as a
         | flexible API to my existing text and items.
        
           | d1sxeyes wrote:
           | Is that handwritten notes? What LLM are you using for that
           | and what level of accuracy do you get?
        
         | sondr3 wrote:
         | Which then again could have AI integrations of its own! Imagine
         | the endless possibilities of AI shredding.
        
           | badgersnake wrote:
           | A shredding company that automatically scans and uploads your
           | documents before securely disposing of them. The scanned text
           | is then used to train AI. It's like the physical equivalent
           | of ignoring robots.txt.
           | 
           | I'm sure YC will fund it.
        
         | sphars wrote:
         | > For maximum art, it can feed directly into a shredder.
         | 
         | A dumpster fire works well too: https://gizmodo.com/watch-your-
         | feelings-about-2020-burn-in-a...
        
         | lionpixel wrote:
         | Totally get the resentment. However, I'm particularly excited
         | about the benefits this could bring, especially for people like
         | my grandma with dementia. She could say, "Print my shopping
         | list," or "Can you write down my son's phone number?" Only
         | thing missing for now is smarter home assistant devices as
         | Alexa is too dumb to handle such requests. :/
        
           | prmoustache wrote:
           | The results could be interesting...
           | 
           | Mom? Are you cooking crystal meth at home, what is all this
           | for? And why did you bought 500 boxes of condoms?
        
           | lnenad wrote:
           | It's sad how jaded hn can sometimes be. I love the idea and I
           | think there are so many ways it could be useful.
        
         | voidUpdate wrote:
         | Why use ai to feed trash nobody wants to read into a shredder
         | when you can use real people? https://youtu.be/SpNlp6AtTOE
        
           | lionpixel wrote:
           | haha :D
        
         | redleader55 wrote:
         | We, as a society, are at the point where we can afford to waste
         | resources in this dumb way "for art". I personally find this
         | obscene.
         | 
         | I wouldn't worry though, I have a feeling this is going away by
         | the end of the decade.
        
       | maalber wrote:
       | Love the idea about a demo on twitch. Simple yet effective! Next
       | up, develop a twitch bot interface so you can handle everything
       | directly there
        
         | lionpixel wrote:
         | Thanks for the feedback! Thought about this as well! If enough
         | people are interested I'll integrate a one-click install
         | option. :)
        
       | voidUpdate wrote:
       | 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
        
       | black_puppydog wrote:
       | 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?
        
         | lionpixel wrote:
         | I like this! Thanks for the feedback!
        
           | TheNewsIsHere wrote:
           | 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!
        
         | jmann99999 wrote:
         | 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
        
       | xorcist wrote:
       | > everyone gets 300 free prints per month during our beta
       | 
       | Ah, printer drivers. One of the things we do not yet rent. Makes
       | sense.
        
         | lionpixel wrote:
         | Not fully decided on the payment yet. Thinking about going the
         | Coolify route with self-hosted and cloud option or with pay
         | what you use (seems more software tending to this one). Happy
         | for any feedback!
        
       | rounce wrote:
       | What's the story if you want to self-host?
        
         | lionpixel wrote:
         | 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 wrote:
           | Is there a public repo?
        
       | ricenb wrote:
       | The demo is great, would give a try asap.
        
       | corytheboyd wrote:
       | Is there something out there like this that is self-hosted? It's
       | ridiculous that this isn't, and it's going to become a pay-per-
       | print model?! I don't care about the AI nonsense, it's a printer.
       | 
       | I could see myself using something like this to print recipes.
       | I'd like to avoid getting my fancy cook book dirty, but have
       | still have recipe in the kitchen to reference. Phone works okay
       | until you have to scroll with dirty/wet hands.
        
         | lionpixel wrote:
         | Once it's out of alpha you can self-host this project
        
           | corytheboyd wrote:
           | It sounded to me like once it's out of alpha the pricing
           | model is "TBD, but likely pay-per-print".
        
             | lionpixel wrote:
             | I really like the proposal from black_puppydog here. Free
             | forever self-host and a pay-per-print in case you want to
             | have support or don't want to hassle with the
             | infrastructure. Like Coolify is doing it.
        
               | corytheboyd wrote:
               | Sounds fine to me! I'd also be happy with a reasonable
               | one-time payment for the self-hosted version.
        
         | calvinmorrison wrote:
         | <?php
         | 
         | // Hardcoded token for authentication $authToken = 'your-
         | secure-token-here';
         | 
         | // Set the printer name (adjust to your printer's name)
         | $printerName = 'YourPrinterName';
         | 
         | // Allow only POST requests if ($_SERVER['REQUEST_METHOD'] !==
         | 'POST') { http_response_code(405); echo json_encode(['error' =>
         | 'Method not allowed. Use POST.']); exit; }
         | 
         | // Check for token in the request if (empty($_POST['token']) ||
         | $_POST['token'] !== $authToken) { http_response_code(401); echo
         | json_encode(['error' => 'Unauthorized: Invalid token.']); exit;
         | }
         | 
         | // Check if a file was uploaded if (empty($_FILES['file']) ||
         | $_FILES['file']['error'] !== UPLOAD_ERR_OK) {
         | http_response_code(400); echo json_encode(['error' => 'No file
         | uploaded or file upload error.']); exit; }
         | 
         | // Get the uploaded file path $uploadedFile =
         | $_FILES['file']['tmp_name']; $fileName =
         | basename($_FILES['file']['name']);
         | 
         | // Use lp command to print the file $command =
         | escapeshellcmd("lp -d " . escapeshellarg($printerName) . " " .
         | escapeshellarg($uploadedFile)); exec($command, $output,
         | $status);
         | 
         | // Check the status of the command if ($status === 0) {
         | http_response_code(200); echo json_encode(['success' => "File
         | '$fileName' sent to printer '$printerName'."]); } else {
         | http_response_code(500); echo json_encode(['error' => 'Failed
         | to print the file.']); }
        
           | corytheboyd wrote:
           | I don't think you can just send any document to a thermal
           | printer and have it come out usable... there's definitely
           | value in software that can _convert_ arbitrary data to
           | whatever format/dimensions/etc the thermal printer needs.
           | Like the post mentions automatic dithering of images. Stuff
           | like that. The HTTP glue is not the hard part.
        
         | pjc50 wrote:
         | > I could see myself using something like this to print
         | recipes.
         | 
         | The home equivalent of a fast food kitchen ticket printer!
         | 
         | I think this is a fun little project, but only until people
         | discover how annoying thermal printers are in actual use,
         | combining all the user-hostility of printers with a tiny form
         | factor.
         | 
         | If you want a really unique gimmick, you can get wireless
         | bluetooth thermal printers that have belt loops. Intended as
         | table-side receipt printers for waitstaff or ticket printers
         | for transit.
         | 
         | Another unique feature receipt printers often have that regular
         | ones don't: a 24V pulse "kicker", intended for firing the
         | release solenoid on cash drawers. I'm sure someone can find a
         | use for that.
         | 
         | (I spent some time in the POS software mines)
        
           | corytheboyd wrote:
           | > The home equivalent of a fast food kitchen ticket printer!
           | 
           | Exactly where my head went haha, next thought was having a
           | clip to hold the recipe up :p
        
         | codazoda wrote:
         | I was surprised by this, but you can install a driver and
         | simply print to these printers. Or, at least, the one I
         | purchased is that way.
         | 
         | You can also use lp, lpr, or nc to send text and codes to it.
         | 
         | Mine is connected to my network via Ethernet. No RPi is
         | required to send stuff to it from any computer on the network.
        
           | corytheboyd wrote:
           | I imagine the software presented here does a lot more than
           | proxy requests to a printer though. What sorts of payloads
           | were you sending off to be printed? If it worked Good Enough
           | for lightly formatted text, no-hosted is way better than
           | self-hosted!
        
             | codazoda wrote:
             | I was printing two things...
             | 
             | 1. A plain text "progress report" that tells me some
             | personal stats about my week last week.
             | 
             | 2. Full designs created in Affinity Designer, which print
             | with the simple "print" menu. These can have any font,
             | graphic, or whatever.
             | 
             | I was able to send everything from plain text with a scroll
             | and cut ESC/POS command on the end (my automated progress
             | report), to an image sent directly to the printer queue, to
             | a pixel perfect desktop design document.
        
         | throwanem wrote:
         | A regular printer, a binder, and a three-hole punch work fine.
         | As a bonus, the printer is also useful in other ways, and any
         | mementos produced with it will last in a way thermal paper
         | never really does.
        
           | corytheboyd wrote:
           | Yes, it does, and we have one for some recipes. It's bulkier
           | than these would be, and we don't have a lot of counter
           | space. Also doesn't solve the disposable problem. We have
           | plastic sheets to protect the pages which works good enough,
           | and it's easy to print new pages if some get soiled anyway.
           | 
           | I don't want mementos, I want disposable references.
           | 
           | It's also not that big of a deal if this isn't feasible,
           | because the binder works fine, the phone works fine. This is
           | just sparked a "hey, what if..." idea is all.
        
       | codazoda wrote:
       | 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 wrote:
         | Great choice MUNBYN printers are awesome! Recently I found that
         | NETUM thermal printers are even cheaper for comparable
         | performance. :)
        
       | pavel_lishin wrote:
       | I'm going to be the party pooper and point out that thermal paper
       | isn't great for your health:
       | https://pmc.ncbi.nlm.nih.gov/articles/PMC5453537/
        
       | rescripting wrote:
       | The "Delete Account" button does nothing. Very clever user
       | retention technique.
        
         | lionpixel wrote:
         | Sorry, this should definitely work. Try clicking on your avatar
         | -> Manage Accounts -> Security -> Delete Account. Will look
         | into this.
        
       | nexus_six wrote:
       | I'm not sure what the point of this really is. Many of those
       | printers and POS systems have OpenCUPS support already, which is
       | more or less "one command". If it requires a Raspberry Pi I have
       | no idea what you are selling. Can you please elaborate on this?
        
         | lionpixel wrote:
         | Valid question. Printercow is aiming for a plug-and-play
         | scenario where you can use whatever thermal printer you want
         | with an extensive html-like template engine.
        
       | jauntywundrkind wrote:
       | Reminds me of BERG's Little Printer (2012). Someone updated the
       | software stack for em! Nice app, great system, lots of sweet
       | social features & good tools.
       | 
       | Alas it seems built around a specific thermal printer, isn't
       | generic.
       | 
       | https://nordprojects.co/projects/littleprinters
       | https://github.com/nordprojects/sirius?tab=readme-ov-file
       | https://github.com/nordprojects/littleprinters-ios-app
        
       | mrtksn wrote:
       | 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 wrote:
         | As far as I understand it:
         | 
         | If it supports ESC/POS commands then yes, otherwise no.
        
         | namero999 wrote:
         | 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!
        
       | avgDev wrote:
       | 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?
        
       | Toxygene wrote:
       | 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
        
       | RadiozRadioz wrote:
       | 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.
        
       ___________________________________________________________________
       (page generated 2025-01-21 23:01 UTC)