
Ask HN: Printing via an HTTP request to a thermal receipt printer - christophe971
Hi there!<p>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?<p>And also any libraries that would be helpful. Thanks so much guys!<p>I&#x27;m considering these:<p>* http:&#x2F;&#x2F;www.adafruit.com&#x2F;products&#x2F;600<p>* http:&#x2F;&#x2F;littleprinter.com&#x2F;<p>* a standard Star&#x2F;Epson printer (I don&#x27;t want to use these because it&#x27;s costly and I&#x27;m a startup)<p>Thanks again !!!
======
m0nty
I use these things every day (I work retail). We use Star TSP700 [Mk I or Mk
II] printers with CUPS. The PPD files are available for download from the Star
Micronics website. Some of my time is spent hacking the PPDs to adjust paper
sizes, resolution etc, but at least I have that option. The printers have an
ethernet port, and some of them come with USB.

~~~
buf
Was setting up CUPS to work with these printers difficult? And also how
painful was it to get the printers on the network reliably?

Potentially, 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

~~~
m0nty
I could send you info by email if you like - my email is in my profile. Our
stores have a server on-site, and various printers and till receipt printers,
not all of them attached to tills. The proprietary app we use creates a PDF,
which then gets sent through to CUPS (see
[https://wiki.linuxfoundation.org/en/OpenPrinting/Database/CU...](https://wiki.linuxfoundation.org/en/OpenPrinting/Database/CUPS-
Filter-Chart) for clues on this).

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.

~~~
buf
The setup I'm trying to achieve is minimal. On site, there would only be a
printer which is connected to the internet via ethernet port (or wireless).
From off site, I want to send an http request to the printer (As an aside, I'm
trying to make the request secure somehow).

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...](http://remote.bergcloud.com/playground/direct_print/Q9UCCLRTY6EL)

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.

~~~
djb_hackernews
If I get what I think you are trying to achieve, I don't think it is possible
with just a printer.

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.

------
tomardern
I've just developed a way to communicate with a Toshiba printer.
[http://www.toshibatec-
eu.co.uk/Europe/en/products/printers/o...](http://www.toshibatec-
eu.co.uk/Europe/en/products/printers/overview_printers/_products/b-ev4d_b-
ev4t/)

I ended up using
[http://www.bartenderbarcodesoftware.com/](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!

------
oelmekki
Can't cups be of any use, here ?

