This guide will help you deploy the ticket printer app in 3 simple methods.
# Make the script executable
chmod +x deploy.sh
# Run the deployment script
./deploy.shThis will guide you through the deployment process.
# 1. Transfer files to Raspberry Pi (choose one):
# A. Via USB drive - copy folder to USB, insert into Pi
# B. Via SCP:
scp -r . [email protected]:/home/pi/ticket-printer-app
# 2. SSH into Raspberry Pi
ssh [email protected]
# 3. Navigate to folder
cd ~/ticket-printer-app
# 4. Run setup
chmod +x setup.sh
./setup.sh
# 5. Connect printer and start
python3 app.py# Install dependencies
pip3 install -r requirements.txt
# Run locally
python3 app.py
# Open browser
open http://localhost:5000- Connect your printer to the Raspberry Pi via USB
- Find printer ID:
sudo lsusb
- Update config in
app.pyif needed - Test print:
python3 -c "from escpos.printer import Usb; p = Usb(0x0416, 0x5011); p.text('Test'); p.cut()" - Start service (optional):
sudo systemctl start ticket-printer sudo systemctl enable ticket-printer - Access web interface:
http://YOUR_PI_IP:5000
See DEPLOYMENT.md for detailed deployment instructions.
sudo usermod -a -G lp,dialout $USER
# Log out and back insudo lsusb # Check if printer is detected
sudo chmod 666 /dev/ttyUSB0 # Fix permissionssudo systemctl status ticket-printer
sudo journalctl -u ticket-printer -fSet environment variables to configure printer type:
# USB Printer (default)
export PRINTER_TYPE=usb
export USB_VENDOR=0x0416
export USB_PRODUCT=0x5011
# Serial/GPIO Printer
export PRINTER_TYPE=serial
export SERIAL_PORT=/dev/ttyAMA0
# Bluetooth Printer
export PRINTER_TYPE=bluetooth
export SERIAL_PORT=/dev/rfcomm0
# Network Printer
export PRINTER_TYPE=network
export NETWORK_HOST=192.168.1.100
# Then run
python3 app.pyFor detailed configuration, see the full DEPLOYMENT.md guide.