LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   CUPS Backend using same Device URI for two different printers (https://www.linuxquestions.org/questions/linux-software-2/cups-backend-using-same-device-uri-for-two-different-printers-4175579306/)

jmanley 05-08-2016 09:17 PM

CUPS Backend using same Device URI for two different printers
 
I have two Citizen CLP-7201e printers attached to a USB hub and I have the drivers downloaded for CUPS from Citizen's website.
They are loaded with different size labels.
When I have one or the other setup they work fine.
If I try and set them both up in CUPS at the same time then neither one works. I'm guessing it has to do with the "auto detected" device URI in CUPS
Below is the output of the /usr/lib/cups/backend/usb showing the two printers detected but with the same Device URI.
I also checked lsusb -v and the iSerial is 0 so I'm guessing that is why CUPS is not adding a SERIAL=XXXXX and appending that on to the USB device URI.
I've googled and tried using udev with rules and I did get it to add a SYMLINK I called Printer1 and another SYMLINK I called Printer2 in the rules for udev but even with restarts, reboots, and adding and removing the prints CUPS did not use these symlinks (this was just a guess and me trying stuff to be through).
I'd appreciate any ideas.
Thanks;
Jon

Code:

root@Z:/usr/lib/cups/backend# ./usb
DEBUG: Loading USB quirks from "/usr/share/cups/usb".
DEBUG: Loaded 131 quirks.
DEBUG: list_devices
DEBUG: libusb_get_device_list=12
DEBUG2: Printer found with device ID: MANUFACTURER:CITIZEN;COMMAND SET:NATIVE ON, NATIVE OFF;MODEL:CLP-7201e;ACTIVE COMMAND:NATIVE OFF; Device URI: usb://CITIZEN/CLP-7201e
direct usb://CITIZEN/CLP-7201e "CITIZEN CLP-7201e" "CITIZEN CLP-7201e" "MANUFACTURER:CITIZEN;COMMAND SET:NATIVE ON, NATIVE OFF;MODEL:CLP-7201e;ACTIVE COMMAND:NATIVE OFF;" ""
DEBUG2: Printer found with device ID: MANUFACTURER:CITIZEN;COMMAND SET:NATIVE ON, NATIVE OFF;MODEL:CLP-7201e;ACTIVE COMMAND:NATIVE OFF; Device URI: usb://CITIZEN/CLP-7201e
direct usb://CITIZEN/CLP-7201e "CITIZEN CLP-7201e" "CITIZEN CLP-7201e" "MANUFACTURER:CITIZEN;COMMAND SET:NATIVE ON, NATIVE OFF;MODEL:CLP-7201e;ACTIVE COMMAND:NATIVE OFF;" ""


ferrari 05-08-2016 09:50 PM

It is unfortunate that the reported device URIs are identical. Some printers differentiate themselves with unique serial numbers which gets around this problem. Perhaps this thread may answer your question. It involves setting up additional CUPS printer classes. I've never had the need to do this, so don't have direct experience with it. Hopefully, it will work for you.

ferrari 05-08-2016 10:46 PM

Is it practical to consider connecting these USB-attached printers to different print servers? Or perhaps convert them to CUPS network printers using two cheap Raspberry Pi's for example. Just a thought. :)

jmanley 05-08-2016 11:00 PM

Quote:

Originally Posted by ferrari (Post 5542414)
Is it practical to consider connecting these USB-attached printers to different print servers? Or perhaps convert them to CUPS network printers using two cheap Raspberry Pi's for example. Just a thought. :)

That's not really what I want to do.

jmanley 05-08-2016 11:07 PM

I've already tried it with Class in CUPS - this is basically the same issue, however classes do not work as the CUPS Backend still thinks they are the same printer on the same Device URI / Printer port.


Quote:

Originally Posted by ferrari (Post 5542399)
It is unfortunate that the reported device URIs are identical. Some printers differentiate themselves with unique serial numbers which gets around this problem. Perhaps this thread may answer your question. It involves setting up additional CUPS printer classes. I've never had the need to do this, so don't have direct experience with it. Hopefully, it will work for you.


ferrari 05-09-2016 12:08 AM

Then AFAIU there is nothing further that can be done. The only UDEV approach I've seen relied on using legacy usblp (rather than libusb) and assigning specific device node names for each instance of a USB-attached device.

jmanley 05-09-2016 12:37 AM

So how can I force it to use usblp instead of libusb?

Quote:

Originally Posted by ferrari (Post 5542436)
Then AFAIU there is nothing further that can be done. The only UDEV approach I've seen relied on using legacy usblp (rather than libusb) and assigning specific device node names for each instance of a USB-attached device.


ferrari 05-09-2016 03:23 AM

Quote:

So how can I force it to use usblp instead of libusb?
I'm in uncharted territory here, so I'm not sure if it is feasible or not, so no promises from me. IIRC, CUPS 1.7 onwards can handle both the libusb backend and usblp concurrently without conflict. I'm not a Debian user, but for openSUSE at least usblp is compiled as a module and can be loaded manually. For example, When I do this with my system, then connect my Brother USB-attached printer, I get the following device node appear
Code:

# ls -l /dev/usb/*
crw-rw-r--+ 1 root lp 180, 0 May  9 19:57 /dev/usb/lp0

as well as 'direct usb://Brother/DCP-7055?serial=E69893D1N337394' reported by lpinfo.

Here's some posts from a user describing some udev rules used to identify two identical printers from each other (post #4 onwards) and issign unique lpN device nodes...
https://forums.gentoo.org/viewtopic-t-556395.html

FWIW, similar discussion here
http://www.henningweiler.de/2009/01/...ical-printers/

Good luck with this! If it was me in your position, I'd be using the pragmatic CUPS server suggestion :)

ferrari 05-09-2016 04:21 AM

I don't feel at all all hopeful about you succeeding with the above, but in any case here's how you can set up a custom backend capable of communicating with /dev/usb/lp0

https://en.opensuse.org/SDB:Using_Yo...le_USB_printer

Another similar backend would be used to communicate with lp1.


All times are GMT -5. The time now is 08:28 PM.