Printer's /dev/usb/lpx file is not shown on ubuntu mate 20.04
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Printer's /dev/usb/lpx file is not shown on ubuntu mate 20.04
Hello all linux user!
On ubuntu mate 18.04 I used to send data in hexadecimal representation into a usb thermal printer with this command:
cat cmds.txt > /dev/usb/lp0
I used as well sending the printing esc/p commands to this file from my program.
I upgraded to ubuntu mate 20.04 and realized, that the lpx file (belonging to the printer) does not appear in the /dev/usb folder, like on ubuntu mate 18.04. I have googled a little bit and found, that
dmesg | grep usblp
command should provide some useful information about connection of the printer. I am not skilled at this area, therefore I do not use proper terms at this point.
With its usage I realized, that: On Ubuntu 20.04 the output is :
$ dmesg | grep usblp
[ 17.634888] usblp 3-3:1.0: usblp1: USB Bidirectional printer dev 3 if 0 alt 0 proto 2 vid 0x04F9 pid 0x209D
[ 17.634950] usbcore: registered new interface driver usblp
[ 35.318303] usblp1: removed
while on Ubuntu 18.04 the log does not end with removed keyword and the lpx file shows in the expected path. The printer shows in output of lsusb on both systems:
$ lsusb
Bus 003 Device 003: ID 04f9:209d Brother Industries, Ltd QL-820NWB P-touch Label Printer
I suspect that on ubuntu 20.04 there is some process removing the usblp. Since the usblp should be responsible for creation of lpx files, they do not show up.
My question is, how to get usblp working to show lpx files on ubuntu mate 20.04?
It's worth checking if the usblp module itself has been unloaded. Most people nowadays use cups for printing with a libusb backend and that's supposed to be incompatible with usblp, so maybe that's why your new Ubuntu removes it. It could well be blacklisted in one of the files in /etc/modprobe.d.
You can easily check if the module is loaded by using
Code:
lsmod|grep usblp
If it is not, you can reload it by hand.
Code:
sudo modprobe usblp
If it is blacklisted by modprobe, that can be corrected by a simple edit.
Hi hazel,
thank you for your reply. I apologize for the delay. Somehow, I did not get the info email about your reply.
Quote:
It's worth checking if the usblp module itself has been unloaded.
Code:
lsmod | grep 'usblp'
gives
usblp 28672 0
So, I expect it to be loaded.
Quote:
It could well be blacklisted in one of the files in /etc/modprobe.d.
usblp is not blacklisted in /etc/modprobe.d/blacklist.conf
Meanwhile, I think I found the core of the problem. On Ubuntu 18.04, when i run
Code:
usb-devices
and check driver section of the printer, I get usblp (no suprise here). But when I run the same in Ubuntu 20.04 i get usbfs. I suspect the ubuntu 20.04 to assign the printer driver for usb HDD. Am I right? Here is the complete output from
Hello hazel,
thank you for you reply. I checked everything according to your suggestions. usblp is loaded and is no blacklisted. But I found, that a wrong driver is assigned to the printer. When I run
Code:
usb-devices
and check output for the printer, particularly the Driver, I get Driver=usbfs. In my opinion, the OS thinks, that the printer is a USB HDD.
When I run usb-devices
and check output for the printer, particularly the Driver, I get Driver=usbfs. In my opinion, the OS thinks, that the printer is a USB HDD.
How can I fix that?
According to the kernel docs, usbfs is just a driver for the filesystem attached to /dev/bus/usb. It doesn't imply that the attached usb device is itself a filesystem. When I check on my box, I find that /dev/bus/usb/001/002 is assigned to the lp group, so that must be the port where my printer is attached. But then I use cups/libusb for my printing and don't ever use usblp.
My point is,
that on ubuntu 18.04 the lpx files appear in the /dev/usb/, where the printer's driver is usblp. On ubuntu 20.04, the driver is usbfs. If i managed to switch the driver in ubuntu 20.04 to usblp, the lpx files would be created in /dev/usb/. But this prehaps cannot be done directly:
Quote:
In short, you often can't force a particular driver to use a particular device.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.