Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Integration connecting a receipt printer to the metti ecosystem printing orders for the given destination.

Notifications You must be signed in to change notification settings

eppelduerferjugend/metti-printer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

metti-printer

Provisioning

Install python-escpos from GitHub.

We assume the repository to be placed at /srv/metti-printer on e.g. a Raspberry Pi.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install python3 python3-pip python3-full libopenjp2-7 git

sudo mkdir /opt/python-venv
python3 -m venv /opt/python-venv/
/opt/python-venv/bin/pip3 install requests pyusb
/opt/python-venv/bin/pip3 pip3 install git+https://github.com/python-escpos/python-escpos.git

Configure src/constants.py:

cp src/constants.py.example src/constants.py

Sync changes from local repostory to the Raspberry Pi:

rsync -aP --delete . pi@hostname:/srv/metti-printer/

To grant permission to the printer via USB without being root, add the file /etc/udev/rules.d/10-crew.rules with the following content:

SUBSYSTEM !="usb_device", ACTION !="add", GOTO="datalogger_rules_end"
SYSFS{idVendor} =="VENDOR_ID", SYSFS{idProduct} =="PRODUCT_ID", SYMLINK+="datalogger"
MODE="0666", OWNER="crew", GROUP="root"
LABEL="datalogger_rules_end"

In it, replace VENDOR_ID by the vendor id and PRODUCT_ID by the product id of the USB device that can be determined by running lsusb and identifying the USB printer.

To make the python printer server start at boot time as a daemon, install it as a service like so:

# Configure service
sudo ln -s /srv/metti-printer/provisioning/metti-printer.service /etc/systemd/system/metti-printer.service

# Enable service
sudo systemctl enable metti-printer
sudo systemctl daemon-reload

# (Re-)start service
sudo systemctl start metti-printer
sudo systemctl restart metti-printer

# Show service status
sudo systemctl status metti-printer

# Follow service logs
journalctl -u metti-printer.service -f

See also

About

Integration connecting a receipt printer to the metti ecosystem printing orders for the given destination.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages