Victoria is the barcode printing daemon handling the barcode generation and the connection with the network connected printer.
It act as the gateway for the other process to physically print the barcodes they send through redis. Victoria also handle the data dispatching to printers and serve as an abstraction for the different printers and the printing dialect.
This package run as a daemon in the buildroot firmware with file logging and pid file.
During development process the script launch the program with the following command to output the log in the console.
> source venv/bin/activate
> venv/bin/python victoria --no-daemon --debug
A set of utility script are available in the /utils
directory.
Generate a template with the title passed with --title
argument, and
the barcode info with --barcode
argument.
Send a print request through redis to the running victoria
script.
The configuration serve to map the printers to a set of data.
- The communication medium to the printer
- The mandatory data to communicate with the printer depending on the medium
- The redis channel to listen to
- The available templates to print
This is an exemple configuration file loaded with the -c <path>
arugment.
despinassy:
uri: "postgresql://postgres@localhost/<db_name>" | "sqlite://"
victoria:
redis: 'victoria' # Default redis channel to listen to
printers:
- main: # Name of the printer
type: "static" # The method of communication
address: "192.168.8.8" # The 'static' method need an address
port: 9100 # The 'static' method need a port
width: 100 # Print output width
height: 150 # Print output height
dialect: "zpl" # Dialect used by the printer
redis: "victoria" # The redis channel this specific printer listen to