Simple utility for creating standalone print server for peripage A6/A6+ thermal printer
Edit config in __main__.py
# Config
PRINTER_MODEL = ppa6.PrinterType.A6p
PRINTER_MAC = '00:15:83:15:bc:5f'
SERVER_PORT = 11001
BREAK_SIZE = 100
TIMEZONE = 'Europe/Moscow'
SECRET_KEY = '1234567890'
RECEIVE_DIRECTORY = 'received'Edit server properties in scripts/print_ascii_clipboard.py
SERVER_ADDR = '192.168.1.101:11001'
BREAK = 1 # Enable/disable
CONCENTRATION = 2 # Value (0-2)
SECRET_KEY = '1234567890'Edit server properties in scripts/print_image_drag_and_drop.py
SERVER_ADDR = '192.168.1.101:11001'
BREAK = 1 # Enable/disable
CONCENTRATION = 2 # Value (0-2)
SECRET_KEY = '1234567890'Edit server properties in scripts/print_image_clipboard.py
SERVER_ADDR = '192.168.1.101:11001'
BREAK = 1 # Enable/disable
CONCENTRATION = 2 # Value (0-2)
SECRET_KEY = '1234567890'Libraries:
$ sudo apt install bluetooth bluez libbluetooth-dev libopenjp2-7Packages:
$ pip3 install Pillow aiohttp aiohttp_middlewares ppa6 python-dateutil
Tabs automatically converted to 4 spaces
- Copy text to clipboard
- Run
print_ascii_clipboard.pyorprint_ascii_clipboard.bat
Endpoint:
Set print_date to 1 to enable print leading date
Set print_break to 1 to enable print trailing break
Set request body to ASCII text to print
POST /print_ascii?print_date=1&print_break=1
body: "Hello World!"
Supported: jpeg, png
- Drag and drop image file on
print_image_drag_and_drop.bat.pyorprint_image_drag_and_drop.bat
Endpoint:
Set print_date to 1 to enable print leading date
Set print_break to 1 to enable print trailing break
Set request body to image file, supported png and jpg
POST /print_image?print_break=1
body: { image: binary image file }
Supported: jpeg, png
- Copy image from browser/editor/etc and run
print_image_clipboard.pyorprint_image_clipboard.batEndpoint: Same as above
Run with:
python3 -m print-server