usb printer

Bill Weaver bweaver at pacplanet.com
Wed Nov 14 14:12:57 PST 2007


> I've installed cups on a debian 4, no problems so far.
> When I try to add a printer (hp deskjet 990 cxi, usb connection) via the
> cup web administration, in the Device section I found a list of devices
> but NOT the usb port. Why? Where does cups get the list of defices?
> thanks in advance
> Agostino

On RHE4, connecting several HP Deskjet 460 USB printers to various hosts on the system, I was able to ID on the fly, just which USB printer was plugged into a host. Utilizing the following command:

"grep -wH 'Serial Number:' /proc/scsi/usb-storage/ grep -wH 'Deskjet 460' /proc/scsi/usb-storage/* | awk '{print $1}' | cut -d '/' -f 5 | cut -d ':' -f 1 | awk '{print $3}'"

Returns the serial number of the attached USB printer.  Since the USB printer lacks an IP address (obviously), it appears that, in at least the HP printer case, the serial number of the printer is the ID'g feature.  Please mod script to suit the printers you utilize.

A simple "grep -wH '<Printer Name>' /proc/scsi/usb-storage/*"  will return the full listing of the associated file for the info you need.

In our case, I utilize scripting and cron, to look to see if the printer is plugged into the usb port on bootup, or added/disconnected later on.  Then by manipulating CUPS directly or thru it's config files I can add the serial number of the printer with known info on the printer to give the device to print to, enabling or disabling queues as needed:

usb://Deskjet/460?serial=<actual serial number of printer?>

This is what appears in the ports pulldown menu in the CUPS Web Interface.  Please note that even though /dev/usb/lp0 indicates that a USB printer is attached (or an absense indicates is not attached), you can not actually use that as the device to print to.

I hope this helps.




More information about the cups mailing list