13 ms·
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 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 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.
- lionpixel 2y agoIn 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 https://twitch.tv/printercow then. :)
- nolroz 2y agoOk 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 2y agoWe've got you covered! https://sales-and-dungeons.app/ https://sales-and-dungeons.app/
- ksdme9 2y agoThe whole twitch demo thing is genius and fun. Do printer companies usually not provide a first party apps or integrations?
- lionpixel 2y agoWhen 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 2y agoAre prints as clear and as fast printing everything as an image? Or are there some tradeoffs?
- sometinsome 2y agoNice! 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 https://github.com/emi420/esc-pos-server-print
- smokeydoe 2y agoThis 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 2y agoIndeed. But there are some good BPA-free alternatives on the market
- echoangle 2y agoIs 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 2y agoEven if they are, that doesn't mean they're safer https://www.epa.gov/sciencematters/are-bpa-substitutes-any-safer-bpa https://www.epa.gov/sciencematters/are-bpa-substitutes-any-s...
- heeton 2y agoThat 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 2y ago> 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 2y agoThis 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 2y agoThanks 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 2y ago(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 2y agoRaspberry 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 https://printercow.com/pi/install.sh -o install.sh \ && chmod +x install.sh \ && sudo ./install.sh
- dmd 2y ago> 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 2y agoExtremely 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 2y agoIs that handwritten notes? What LLM are you using for that and what level of accuracy do you get?
- heeton 2y agoNo, just computer notes. Currently on llama3.2 text-only 3B, running on an M3 Macbook Pro. Accuracy is good for my limited use case (extracting context, giving me links and reminders). It's not yet good enough (for me) at summarising larger notesets, it might miss out useful / pertinent things in a way Claude does not. I'd also like it to be better at inferring partial context from audio transcriptions. But hey, it's an open source 2GB model running on my laptop, it'll get better.
- sondr3 2y agoWhich then again could have AI integrations of its own! Imagine the endless possibilities of AI shredding.
- 2y ago
- Dromadie 2y agoInteresting concept. I'm assuming since this is being done as a SaaS (which I understand, want to be compensated for your time), there's no way to run a server locally over wifi without allowing external internet access?
- maalber 2y agoLove 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 2y agoThanks for the feedback! Thought about this as well! If enough people are interested I'll integrate a one-click install option. :)
- voidUpdate 2y agoAww, 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 2y agoI 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 2y agoI like this! Thanks for the feedback!
- TheNewsIsHere 2y agoI 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 2y agoI 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 https://tidbyt.com
- downrightmike 2y agoWe're long past the point where most people have a computer in their pocket and not one on their desk
- xorcist 2y ago> 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 2y agoNot 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!
- deleted 2y ago[deleted]
- rounce 2y agoWhat's the story if you want to self-host?
- ricenb 2y agoThe demo is great, would give a try asap.
- corytheboyd 2y agoIs 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 2y agoOnce it's out of alpha you can self-host this project
- corytheboyd 2y agoIt sounded to me like once it’s out of alpha the pricing model is “TBD, but likely pay-per-print”.
- lionpixel 2y agoI 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 2y agoSounds fine to me! I’d also be happy with a reasonable one-time payment for the self-hosted version.
- calvinmorrison 2y ago<?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.']); }
- codazoda 2y agoInspired 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 2y agoGreat choice MUNBYN printers are awesome! Recently I found that NETUM thermal printers are even cheaper for comparable performance. :)
- pavel_lishin 2y agoI'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/ https://pmc.ncbi.nlm.nih.gov/articles/PMC5453537/
- deleted 2y ago[deleted]
- rescripting 2y agoThe "Delete Account" button does nothing. Very clever user retention technique.
- deleted 2y ago[deleted]
- lionpixel 2y agoSorry, this should definitely work. Try clicking on your avatar -> Manage Accounts -> Security -> Delete Account. Will look into this.
- sleepybrett 2y ago[flagged]
- deleted 2y ago[deleted]
- nexus_six 2y agoI'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 2y agoValid 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.
- JJOmeo 2y agoI've got a bunch of thermal printers in my work lab that definitely don't have this but they all support ESC/POS. They're all currently produced kiosk style printers.
- jauntywundrkind 2y agoReminds 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://nordprojects.co/projects/littleprinters https://github.com/nordprojects/sirius?tab=readme-ov-file https://github.com/nordprojects/sirius?tab=readme-ov-file https://github.com/nordprojects/littleprinters-ios-app https://github.com/nordprojects/littleprinters-ios-app
- sleepybrett 2y agoberg didn't charge for use, just for the printer.. of course they also didn't last long.
- mrtksn 2y agoOkay, 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-Students/dp/B08NCLFPTV 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/NaitLee/Cat-Printer https://github.com/bitbank2/Print2BLE https://github.com/bitbank2/Print2BLE
- KomoD 2y agoAs far as I understand it: If it supports ESC/POS commands then yes, otherwise no.
- namero999 2y agoFunny, 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!
- mrtksn 2y agoI managed to get it going through inspecting the bluetooth packages, now building my app for it. Couldn't get the correct image output yet but it appears to be simple, just have to send the image line by line
- namero999 2y agoMost likely the logic is at least similar. Yes, line by line, each line is encoded in bytes where each bit is a pixel. I had to "invert" the image as the printer will print the "white" pixels (those with a value >0). The printer has an internal buffer so you can send multiple lines at the same time, but on the bear this starts to break down after 200 lines or so (consider that the bear has a higher 300 dpi resolution, so 576 pixel per line). Also pay attention to overheating, I put 1 or 2 seconds of pause every 400 lines just in case.
- avgDev 2y agoInteresting 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?
- lionpixel 2y agoI am using Printercow for another project of mine where I developed a POS-system where many thousands receipts need to be printed. This was one of the motivations. AI was kind of a afterthought. :P
- Toxygene 2y agoVery 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://magic.wizards.com/en/formats/momir-basic https://imgur.com/gallery/momir-basic-irl-g2S3hJT https://imgur.com/gallery/momir-basic-irl-g2S3hJT
- PokeyCat 2y agoVery 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!
- RadiozRadioz 2y agoInterestingly 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.
- e28eta 2y agolong 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.
- JJOmeo 2y agoSome of these show up as USB to serial converters and while you do need appropriate kernel drivers for that, they'll never be recognized as a "printer". Still usable though.
- freedomben 2y agoThis 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.
- lionpixel 2y agoThank you for the detailed feedback! I really appreciate you sharing your perspective, especially about the compliance requirements. You're right, and you're not alone - many others in the thread have expressed similar concerns about the SaaS approach. After taking some time to reflect, I've decided to pivot towards a dual-track solution: 1. A free, self-hostable version for businesses with compliance requirements or those who prefer to maintain their own infrastructure 2. A cloud version for users who want a managed solution I'll be working on both versions over the next few weeks. :)
- freedomben 2y agoThat's great news! Seriously, kudos to you for taking such feedback so constructively. I do really think this could be a great path for you. Particularly once the core product is giong, you could look into add SSO, RBAC, and other enterprise-y management features and have a legit open product that makes money selling managed/hosted services to corps. This is niche enough yet common enough that I could see it being very attractive to people building higher level products! Let me know if I can be of help. I've got quite a bit of devops/infra experience especially containers and kubernetes, as well as mostly backend dev (though enough frontend to be considered "full stack" by many, but IMHO I'm not great at frontend). Very happy to help consult!
- JJOmeo 2y agoThis could be plain software on any computer with network and a serial port. Not sure if the product is tied to RP hardware but it certainly wouldn't have to be. I work with thermal printers controlled by significantly less powerful hardware still running Linux, and still easily hit physical speed limits. I'd rather see this as a pure software daemon that can run anywhere.
- irs 2y agoThis is nice! Was looking for exactly a similar feature in a previous HN discussion [0]. Want something that I can integrate with IFTTT/Zapier. I was looking to buy one of ESC/POS compatible printer but none of the official sites seem to sell directly on the site and have to contact their sales to get a quote. I see a few on ebay and from third party sellers in Amazon. Does anyone have a recommendation on where to buy an official / new one without going through the sales call hassle? Or buying from 3rd parties is the only option? [0] https://news.ycombinator.com/item?id=42599784 https://news.ycombinator.com/item?id=42599784
- fmajid 2y agoI found this one at B&H: https://www.bhphotovideo.com/c/product/1789487-REG/epson_c31ch51a9991_desktop_direct_thermal_pos.html https://www.bhphotovideo.com/c/product/1789487-REG/epson_c31...
- irs 2y agoThanks for checking on this. Will look into this model.
- gibs0ns 2y agoI've used Rongta thermal printers a fair bit, I've found them to be cost effective and easy to use. I mostly use them via WebUSB and some random JS ESC/POS lib. Though I have never bought directly from Rongta.
- irs 2y agoYeah Rongta brands are the ones that come up frequently when I search on Amazon. Will check them out. Thanks.
- dougi3 2y agoI do not have a Raspberry Pi laying around, but I do have an Ubuntu computer. Can the Printercow code be executed on my Ubuntu computer?
- gurveer_singh29 2y agoI work with restaurants— i think this could be quite usefull for them and for our product. Do you have an email i can reach out on, ideally would like to have a quick chat. The sooner the better. I think i have some people who could use this right now
- RileyJames 2y agoI know nothing about thermal printing. Does it cost more to print more black? Or is the cost of printing baked into the paper? In standard printing white is free. Is the opposite (or cost neutral) true for thermal printing?
- CraigRood 2y agoFrom my limited experience working as systems for a large retailer. Thermal paper is more expensive, but the printers are cheaper and more reliable. It's not massive - I would estimate about ~20% difference - of course this can depend on print counts. Having printers down can have a much larger operational impact than the difference between types.
- solarkraft 2y ago300 free prints? Signing up? AI integration? What? You may be building something cool, I don’t know, but it clearly looks to be different from just providing printer integration. That should be running locally, as a simple application, on an ESP32 or Raspberry Pi. Trying to SaaS an infra utility is crazy.