[cups.general] Opening /dev/usb/lp0 fails while printing

Michael R Sweet msweet at apple.com
Thu Apr 24 12:00:53 PDT 2008


Justin Huang wrote:
>> Justin Huang wrote:
>>> I can access my USB printer via /dev/usb/lp0. The printer is a bidi printer, which receives print data from this usb interface (bulk out) and also send status data to the host via the same interface (bulk in).
>>> I'm planning to create a program which opens /dev/usb/lp0, reads status data and then display some human-readable information. It sounds good, right?
>>> My problem is... when I launch the program and then make a print, the printer seems to be locked and the print job cannot be sent out from the backend. I'm using open() with O_RDONLY flag. What can I do to allow my program and the backend filter access the printer at the same time? I'm not planning to modify the backend program. Thanks a lot!
>> You can't, it's a single device and doesn't support multiplexing.
>>
>> --
> 
> That's too bad. I found some devices named as /dev/usbdev5.4_ep01
> or /dev/usbdev5.4_ep81. They seem to represent the endpoints of the USB
> printer. I tried to open each of them but failed. Is there any method
> I can try to allow my program open a single endpoint of the USB device?

If you use libusb to both print and scan, you *may* be able to do
both at the same time - it really depends on the device.

However, once the device is claimed by the USB printer character
device (when you open /dev/usb/lp0) you won't be able to access it
through other means until it is closed and the driver unloaded.

-- 
______________________________________________________________________
Michael R Sweet                        Senior Printing System Engineer





More information about the cups mailing list