No description
  • HTML 51.2%
  • Python 48.8%
Find a file
2026-07-30 14:43:01 +02:00
parser Some work on a new parser? 2026-07-27 21:17:26 +02:00
resources Add text to qr placeholder indicating its a placeholder 2026-04-07 20:06:18 +02:00
templates Merge branch 'receipts' 2026-07-28 21:14:09 +02:00
TM_T88XX_python@4a841b03f4 No longer hardcode the printer path 2026-07-30 14:37:00 +02:00
.gitignore add user_data to .gitignore 2024-09-25 22:37:37 +02:00
.gitmodules Change out printer driver again, this time with our own 2026-07-28 16:12:24 +02:00
app.py Fix the error where printing receipts would not cut the paper 2026-07-30 14:43:01 +02:00
config.py Notify the user that they have arrived at a specific printer. 2026-03-29 12:37:42 +00:00
fonts.py Implement a checkbox to choose if the text will be bold or not 2025-10-22 16:06:09 +02:00
gen_image.py Throw a warning when printing a portrait mode label with text wider than 2026-03-29 12:21:39 +00:00
html_gen.py Improve orientation svg 2026-03-07 16:58:05 +01:00
label_printer.service Update documentation, and change the username in label_printer.service 2026-04-02 17:48:47 +02:00
LICENSE Add license 2024-09-25 21:48:36 +02:00
parse_text.py Communicate valid values for qr code size to user 2026-04-15 21:11:05 +02:00
print.py No longer hardcode the printer path 2026-07-30 14:37:00 +02:00
process_image.py fix typo 2026-03-25 16:57:27 +01:00
README.md Update README 2026-04-25 14:43:39 +02:00
requirements.txt Change out printer driver again, this time with our own 2026-07-28 16:12:24 +02:00
todo Some work on a new parser? 2026-07-27 21:17:26 +02:00
user_handler.py Code cleanup and old users data in ram is now removed 2026-03-15 15:33:24 +01:00

Setup

This guide assumes you have a raspberry pi, running raspberry pi os, and your have a user called "techinc". (If you have a different username, you are going to have to change some lines in label_printer.service)

Install

from the techinc home directory:

sudo apt update
sudo apt upgrade (Had some issues installing pillow through pip without this)
sudo apt install git libopenjp2-7 libfreetype6
git clone https://code.techinc.nl/amy/label_printer.git

navigate into the label_printer directory

python -m venv venv (this will take a while)
source venv/bin/activate
pip install --upgrade colorama flask pillow python-escpos pyusb

run python3 app.py to test if the webserver starts without errors (to reduce the need for troubleshooting later).

If you get something that looks like:

 * Serving Flask app 'app'
 * Debug mode: off
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on http://127.0.0.1:5000
Press CTRL+C to quit

This means things are working as expected. You can quit it by pressing ctrl+C

Installing the systemd daemon

sudo cp label_printer.service to /etc/systemd/system/

sudo systemctl daemon-reload
sudo systemctl enable label_printer
sudo systemctl start label_printer

The interface should now be running on localhost:5000, which we need to route to the outside world in the next step

Setup the nginx

sudo apt install nginx

edit /etc/nginx/sites-available/default and change the contents of:

location / { }

to:

location / {
    proxy_pass http://127.0.0.1:5000;
}
sudo systemctl restart nginx

Setup static ip on the pi

edit /etc/dhcpcd.conf and add:

static ip_address=10.209.10.2/24
static routers=10.209.10.254
static domain_name_servers=10.209.10.255

/etc/wpa_supplicant/wpa_supplicant.conf:

ctrl_interface=/run/wpa_supplicant
update_cunfig=1

wpa_passphrace ssid password >> /etc/wpa_supplicant/wpa_supplicant.conf

sudo apt install dhcpcd sudo ln -s /usr/share/dhcpcd/hooks/10-wpa_supplicant /usr/lib/dhcpcd/dhcpcd-hooks/ sudo systemctl enable dhcpcd