No description
Find a file
2026-04-08 22:10:14 +02:00
resources Add image presets functionality 2025-11-02 15:56:02 +01:00
templates Set default orientation to landscape 2026-04-08 22:10:14 +02:00
.gitignore add user_data to .gitignore 2024-09-25 22:37:37 +02:00
.gitmodules Fully integrate the go library and reorganize files 2024-09-15 20:53:03 +02:00
app.py Notify the user that they have arrived at a specific printer. 2026-03-29 12:37:42 +00: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
print.py Move away from faxmachine to python-escpos 2026-04-03 19:43:56 +00:00
process_image.py fix typo 2026-03-25 16:57:27 +01:00
README.md Update documentation, and change the username in label_printer.service 2026-04-02 17:48:47 +02:00
requirements.txt Freeze requirements.txt 2024-11-28 00:04:09 +01: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 install python3-flask python3-pil python3-colorama golang git
git clone https://code.techinc.nl/amy/label_printer.git

navigate into the label_printer directory

run make to build the go library

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