A web interface to interact with a thermal printer
Go to file
n07070 4ced780d54 Added file deletion after printing. 2022-05-15 23:48:44 +02:00
archive Moved old files to archive folder 2020-12-27 21:32:51 +01:00
configuration Updated config for the printing of images 2022-03-17 10:38:30 +01:00
docs Added documentation for the EPSON printer and the CUPS driver's archive, just in case someone needs it and the link dies 2020-12-27 21:29:29 +01:00
src Added file deletion after printing. 2022-05-15 23:48:44 +02:00
.gitignore Added gitignore entry 2022-03-17 10:38:05 +01:00
LICENSE Initial commit 2018-10-14 22:58:04 +02:00
README.md Added a picture of the result 2022-05-14 00:08:44 +02:00
pip-selfcheck.json Added the files of the project, 2018-10-14 23:12:47 +02:00
requirements.txt Updated requirements file to be compatible with futur versions. 2022-05-09 21:41:19 +02:00
run.sh Mise en route plus simple 2022-05-09 01:49:35 +02:00
users.json Added the files of the project, 2018-10-14 23:12:47 +02:00

README.md

Little Prynter


Print out shit from the cloud on a thermal paper.

About

This project started when I got a Thermal Printer from a friend. It's now evolved to a complete web solution to print out text and images.

Requirements

To make this project work, you will need :

  • A Thermal Printer :
    • I used Adafruit's thermal printer at first, but it broke down. You can get it here.
    • I then used an EPSON TM-T2OIII. It's expensive, but it's also high quality, and has better CUPS and specific library support.
  • A Raspberry Pi or any computer with USB or Serial.
  • Some electric wires.
  • Some knowledge of the command line,
  • Some knowledge of Python.
  • 3h of your time, 5h if things need debugging.
  • git, virtualenv,pip and python >= 3.8.6.
  • A webcam for the webcam page to work. Will work on a smartphone. Not required.

Context

For the EPSON TM-T20III, you can get the CUPS driver from here. It's not specific to the printer I've been using, so you can try with other printers.

With that, you can try out your printer and print normal text, images or pdf documents for example. LittlePrynter itself does not require any other software than the ones installed with it, i.e the ones listed in the requirements.txt file.

For the Adafruit printer, start by following the guide here to install the CUPS software needed to print images. If you want, you can install it via the command line, following this guide.

You can also get some information from here and here if you're stuck.

The version for the EPSON TM-T20III uses a library called python-escpos, which doesn't need a CUPS driver or anything else. It's included in the Python dependencies.

The project only supports the EPSON printer, but you can try to adapt it for other printers using the adafruit-thermal branch, but I won't offer support for it.

Install & setup the project :

$ git clone https://git.n07070.xyz/n07070/LittlePrynter
$ virtualenv LittlePrynter
$ cd LittlePrynter
$ source bin/activate
$ pip install -r requirements.txt

tip : when you're done, you can get out of the virtualenv either by closing your terminal, or by running deactivate.

You should see a folder named configuration. Enter it, and duplicate the file named config.toml.sample, and rename the copy to config.toml. Now, edit this file by following the comments in the file itself.

You can now start the web server with

$ export FLASK_APP=src/main.py
$ flask run

This command should start a web server with which you can test your configuration. If you plan on exposing your printer to the Internet, and give it an IP / URL, please, please, please, don't run it this way. Look at Flask's documentation and read about running a production server. It's a little more work, but it will prevent your computer/server being hacked in too easily.

Voilà !

Screenshots

The first page. You can print a picture, or a short message. It's basically exposing the API in html.

Using the webcam via Javascript, you can print out a picture from your phone, webcam, or any other video device.

More

If you liked this project, feel free to support my work !

Donations welcome ! :)

Licence

LittlePrynter
   Copyright (C) 2020  N07070

   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <https://www.gnu.org/licenses/>.