Ask HN: Printing via an HTTP request to a thermal receipt printer
Hi there!
I would like to send a POST request to a thermal printer, but everything sucks so far... Does anyone have any suggestions on which one is the best one?
And also any libraries that would be helpful. Thanks so much guys!
I'm considering these:
* http://www.adafruit.com/products/600
* http://littleprinter.com/
* a standard Star/Epson printer (I don't want to use these because it's costly and I'm a startup)
Thanks again !!!
8 comments
[ 4.7 ms ] story [ 27.2 ms ] threadPotentially, I would have to install these printers in hundreds of coffee shops that all have different internet configuration. I need to make myself an expert in this, but I'm not sure where to start.
Thanks M0nty
If you're sending a data stream from a central server to a till printer in a store (i.e. the raw printer data is going from a centralised CUPS) that might work, depends on the broadband link.
Once the printers are on the network, they tend to stay that way. The only problem is, they have to be set up using Reverse ARP which is a bit shaky, but once you're used to the procedure it's OK.
The http request would look something like this ideally:
curl -X POST --data-urlencode 'html=<html><head><meta charset="utf-8"></head><body><p style="font-family: Comic Sans Ms; font-size: 36px;">YOUR MESSAGE HERE</p><p>YOUR EMAIL</p></body></html>' http://remote.bergcloud.com/playground/direct_print/Q9UCCLRT...
So I wouldn't have the luxury of having an on site server unfortunately.
PS - I couldn't find your email in your profile. It was empty when I clicked through.
1) You'll need some hardware to act as a webserver that can turn the HTTP requests into something the printer understands. Printers don't really have webservers built in to them with HTTP APIs.
2) Firewalls will be a problem even if you have a dedicated webserver. Most likely you'll add some hardware that connects to a central service as a client, and your central service will relay messages down to your device on site.
I ended up using http://www.bartenderbarcodesoftware.com/ to create the stickers, intercepting the request to the printer with WireShark, then finally re-creating the request using PHP sockets.
It's not easy!