Troubleshooting CUPS Server Configuration for USB Thermal Label Printer
In this article, we will discuss the steps to configure a CUPS (Common Unix Printing System) server for a USB thermal label printer. While setting up a simple CUPS print server, as explained in this article, users may encounter issues in getting the printer to function properly.
Key Concepts
- CUPS (Common Unix Printing System)
- USB thermal label printer
- Print server
- cupsfilter
- lpadmin
- lpoptions
Checking Printer Connection
To begin with, check if the printer is properly connected to the system. Use the command lsusb to list all USB devices and check if the printer is present in the list. Also, check if the printer appears in the CUPS web interface by visiting http://localhost:631 on the system.
cupsfilter
The cupsfilter command is used to check if CUPS can correctly process the printer's raw data. To test the printer with this command, use the following syntax:
echo "Hello World" | lp -d printer_name -o raw | cupsfilter -d -m printer_PPD_file > test.psReplace printer_name with the name of your printer and printer_PPD_file with the PPD (PostScript Printer Description) file for your printer.
lpadmin
The lpadmin command is used to add and configure printer queues. To add a new printer queue, use the following syntax:
lpadmin -p printer_name -E -v usb:/// -m printer_PPD_file Replace printer_name with a name for the printer queue, printer_vendor_id and printer_product_id with the vendor and product IDs of the printer, and printer_PPD_file with the PPD file for the printer.
lpoptions
The lpoptions command is used to set printer options. For example, to set the media size for a printer, use the following syntax:
lpoptions -p printer_name -o media=Custom.50x75mmReplace printer_name with the name of the printer queue and media with the name of the media size option. If the media size is not available in the PPD file, you may need to modify the PPD file to include the custom media size.
- Verify the printer is connected and appears in CUPS web interface
- Test the printer with the
cupsfiltercommand - Add a new printer queue with the
lpadmincommand - Set printer options with the
lpoptionscommand