LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 10-31-2021, 01:21 PM   #1
DJ541
LQ Newbie
 
Registered: Oct 2021
Posts: 4

Rep: Reputation: Disabled
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?

Thank you.
 
Old 11-01-2021, 06:33 AM   #2
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,651
Blog Entries: 19

Rep: Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480
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.
 
1 members found this post helpful.
Old 11-01-2021, 08:34 AM   #3
DJ541
LQ Newbie
 
Registered: Oct 2021
Posts: 4

Original Poster
Rep: Reputation: Disabled
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
Code:
usb-devices
on ubuntu 20.04:

T: Bus=03 Lev=01 Prnt=01 Port=02 Cnt=02 Dev#= 3 Spd=12 MxCh= 0
D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=04f9 ProdID=209d Rev=01.00
S: Manufacturer=Brother
S: Product=QL-820NWB
S: SerialNumber=000M0Z803274
C: #Ifs= 2 Cfg#= 1 Atr=c0 MxPwr=0mA
I: If#=0x0 Alt= 1 #EPs= 2 Cls=07(print) Sub=01 Prot=04 Driver=usbfs
I: If#=0x1 Alt= 1 #EPs= 2 Cls=07(print) Sub=01 Prot=04 Driver=usbfs
 
Old 11-01-2021, 12:01 PM   #4
DJ541
LQ Newbie
 
Registered: Oct 2021
Posts: 4

Original Poster
Rep: Reputation: Disabled
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.

How can I fix that?
 
Old 11-02-2021, 07:22 AM   #5
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,651
Blog Entries: 19

Rep: Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480
Quote:
Originally Posted by DJ541 View Post
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.

Sorry but I'm not sure where you go from here.
 
Old 11-02-2021, 04:26 PM   #6
DJ541
LQ Newbie
 
Registered: Oct 2021
Posts: 4

Original Poster
Rep: Reputation: Disabled
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.
from

https://unix.stackexchange.com/quest...iver-to-device

It seems, I will have to switch to libusb to establish communication with my printer on newer OSs.

Quote:
But then I use cups/libusb for my printing and don't ever use usblp
Can you recommend me any good tutorials for libusb (C++)? I need to send raw data (esc/p commands in hexadecimal represenattion) to the printer.

Thanks
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
images not shown correctly firefox, chrone Linux Mint 17.3 mate phovos Linux - Software 2 01-03-2016 06:09 AM
LXer: Ubuntu MATE 15.04 Arrives With MATE Desktop 1.8.2 and MATE Tweak LXer Syndicated Linux News 0 05-15-2015 09:30 AM
usb keyboard identified and events shown but key character not shown on the prompt flyxtop Linux - Software 0 11-30-2013 07:45 AM
User shown as "already exist" when there is no user directory shown on home directory Sharpeye Linux - Newbie 3 03-18-2009 01:17 AM
While booting no option is shown for Linux! Only windows xp is shown!! mon avis Linux - General 7 08-06-2006 04:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration