Print from pi

From Publication Station
Revision as of 11:52, 31 May 2016 by Andre (talk | contribs)

Printing from a RaspberryPi to a line printer (dot matrix, receipt printer) can be done quite simply, by simply writing the text to printer using:

echo "hello printer" > /dev/usb/lp0

Where:

  • /dev/usb/lp0 is the location of the printer
  • > is a write to command

Sara wants to expand this mechanism, to have ePub's hyperlinks to make the printer print the words under the hyperlink.

In order to do so, a possible plan:

  • have words in epub under hyperlink pointing towards a server-side script
  • the server side receives the words and writes it to the Pi

How does server writes to the Pi ???

  • a reverse ssh tunnel that allows the server to login Pi
  • server runs print command over ssh. eg. ssh user1@server1 'df -H' ssh user1@server1 'echo "hello printer" > /dev/usb/lp0'