LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 04-19-2019, 06:28 AM   #1
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Mint 17.1 KDE on workstation, CentOS 6.x on servers
Posts: 1,142

Rep: Reputation: 47
How to get USB thermal printer to work in Linux?


I was hoping it would just show up as a /dev/ device but it's not. I do get an error, not finding much help on google.


This is the dmesg output when I plug it in:


Code:
[2715176.060204] usb 3-10.4.5.2: new full-speed USB device number 21 using xhci_hcd

[2715176.153892] usb 3-10.4.5.2: New USB device found, idVendor=0416, idProduct=5011

[2715176.153895] usb 3-10.4.5.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3

[2715176.153897] usb 3-10.4.5.2: Product: POS58 USB Printer

[2715176.153898] usb 3-10.4.5.2: Manufacturer: GD32 Microelectronics

[2715176.153899] usb 3-10.4.5.2: SerialNumber: Printer

[2715181.154159] usblp: can't set desired altsetting 0 on interface 0


Any idea how to get this printer to work? This is the one, hoping it's compatible...


https://www.amazon.ca/gp/product/B06...?ie=UTF8&psc=1


Would be my luck that it's not, or has some weird quirk that requires a complicated work around.


I'm trying on Mint right now but plan will be to get it going on a Raspberry PI. I plugged in into a RPI and get the same error. I just want to at least get it going so I can test it at my desk so I can then figure out the commands so I can code the application that will use it.

How do I make it show up as a /dev device?
 
Old 04-19-2019, 07:41 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 21,381

Rep: Reputation: 5574Reputation: 5574Reputation: 5574Reputation: 5574Reputation: 5574Reputation: 5574Reputation: 5574Reputation: 5574Reputation: 5574Reputation: 5574Reputation: 5574
Quote:
Originally Posted by Red Squirrel View Post
I was hoping it would just show up as a /dev/ device but it's not. I do get an error, not finding much help on google.
This is the dmesg output when I plug it in:
Code:
[2715176.060204] usb 3-10.4.5.2: new full-speed USB device number 21 using xhci_hcd
[2715176.153892] usb 3-10.4.5.2: New USB device found, idVendor=0416, idProduct=5011
[2715176.153895] usb 3-10.4.5.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[2715176.153897] usb 3-10.4.5.2: Product: POS58 USB Printer
[2715176.153898] usb 3-10.4.5.2: Manufacturer: GD32 Microelectronics
[2715176.153899] usb 3-10.4.5.2: SerialNumber: Printer
[2715181.154159] usblp: can't set desired altsetting 0 on interface 0
Any idea how to get this printer to work? This is the one, hoping it's compatible...

https://www.amazon.ca/gp/product/B06...?ie=UTF8&psc=1

Would be my luck that it's not, or has some weird quirk that requires a complicated work around.

I'm trying on Mint right now but plan will be to get it going on a Raspberry PI. I plugged in into a RPI and get the same error. I just want to at least get it going so I can test it at my desk so I can then figure out the commands so I can code the application that will use it. How do I make it show up as a /dev device?
Why does it need to, as long as whatever software you have can access it?? Based on the message, it appears to be a known bug:
https://bugzilla.redhat.com/show_bug.cgi?id=873123

Don't know if you tried leaving the printer plugged in when you're powering up (*MIGHT* make a difference...maybe?), and also make sure that the usblp module is actually loaded. Run "lsmod | grep -i usblp" to see if it's present. If not, unplug the printer, load it with "modprobe usblp", and plug your printer back in, and check dmesg again. Do you have CUPS loaded?
 
Old 04-19-2019, 01:13 PM   #3
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Mint 17.1 KDE on workstation, CentOS 6.x on servers
Posts: 1,142

Original Poster
Rep: Reputation: 47
The software I have to access it does not exist yet, I need to write it. I need a way to access the printer so my code can actually work. I am not home but just tried on my system here which is also running Mint and usblp is not loaded so I assume it will be the same at home, I'll have to check once I'm done my shift. I will try that modprobe command at home and see if that helps.

I do imagine CUPS is running as I do have a standard printer that I can print to. Though I don't want CUPS to take ownership of this particular printer as I will be accessing it in raw mode. Is there a way to ensure CUPS does not take over of it?
 
Old 04-19-2019, 06:52 PM   #5
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Mint 17.1 KDE on workstation, CentOS 6.x on servers
Posts: 1,142

Original Poster
Rep: Reputation: 47
Ok tried the lsmod command and the module is loaded. Still no go.

I did notice that it shows up under lsusb as a com port though.

Code:
Bus 003 Device 026: ID 0416:5011 Winbond Electronics Corp. Virtual Com Port
Could it be it's just going somewhere else instead of /dev/usb? There's TONS of /dev/tty ones but not sure how to check which are actually active. There's a /dev/ttyprintk but don't think it's that, I tried sending data to it.

I think that error I get in dmesg is why it's not working though. Didn't find much except for a page saying it's a bug, how do I fix it?

How do I stop CUPS? I wonder if it's taking over the printer, I did read some stuff to that effect when it comes to these printers. You don't actually want CUPS trying to manage it. I tried "service cups stop" but it does not seem to actually stop the service.

I see some commands like "lpadmin -p <printer>" but what do I put where <printer> goes. I assume those commands would require something to actually show up in /dev/usb/lp[x] but I'm not getting anything like that.

Last edited by Red Squirrel; 04-19-2019 at 06:56 PM.
 
Old 04-19-2019, 09:01 PM   #6
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Mint 17.1 KDE on workstation, CentOS 6.x on servers
Posts: 1,142

Original Poster
Rep: Reputation: 47
So it looks like this only works in BSD, is that really the case?

https://superuser.com/questions/9967...and-cant-print

Was hoping I could get this working in Linux as that's what I'm familiar with. Anything else I can try? I also tried deregistering usblp thinking maybe that is part of cups or something. Basically I need to ensure that cups is not somehow interfering, which I think may be the cause.

Just grasping at straws at this point. Finding posts of people having same issue but no solution.
 
Old 04-19-2019, 09:30 PM   #7
jefro
Moderator
 
Registered: Mar 2008
Posts: 18,951

Rep: Reputation: 2860Reputation: 2860Reputation: 2860Reputation: 2860Reputation: 2860Reputation: 2860Reputation: 2860Reputation: 2860Reputation: 2860Reputation: 2860Reputation: 2860
You have options. You can still (or should be able to) use cups or you should be able to use lp or other older ways to access the printer. Might be able to use some command like more text.txt > lpt1 or such.

As you can see your system is already working on getting it going. If you do have a virtual com port then you have a few things here. One is how your system creates that. There are some threads at LQ on that. Some of the other smart guys here may remember the way a usb gets converted to serial. I think there were two ways, one modern and one older. achi or acm something is one. I forget the older one.

I think I'd create a standalone or usb install of your base distro and then just test this device.

In theory ndiswrapper should have allowed you to use a windows driver but they never finished that project.


There generally isn't better support in BSD's than in Linux. Almost all of their work could be imported or is in Linux under different names.
 
Old 04-20-2019, 01:26 AM   #8
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 3,789
Blog Entries: 1

Rep: Reputation: 811Reputation: 811Reputation: 811Reputation: 811Reputation: 811Reputation: 811Reputation: 811
If it works, it'll show up in /dev/usb/lp*. If it doesn't show up there, you don't have a driver for it.

usblp seems to be deprecated. It's probably not as complicated a device as you want it to be. If it has a /dev/usb/lp? for it, and your user has the permissions right, you could probably echo plain text and redirect it to the device. Or echo a postscript file. If it works in BSD, it should work in linux. Baring a company that went to the effort of making BSD ONLY drivers, which would be weird. If it does work in BSD, you could dedicate a device for it, like a raspberry pi and make it a networked printer, should all else fail.
 
Old 04-20-2019, 01:32 AM   #9
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 3,789
Blog Entries: 1

Rep: Reputation: 811Reputation: 811Reputation: 811Reputation: 811Reputation: 811Reputation: 811Reputation: 811
https://github.com/klirichek/zj-58

via:
https://www.raspberrypi.org/forums/v...c.php?t=111669

Seems hopeful, that it'll work. Just not out of the box.
 
Old 04-20-2019, 07:05 AM   #10
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Mint 17.1 KDE on workstation, CentOS 6.x on servers
Posts: 1,142

Original Poster
Rep: Reputation: 47
That's the issue, it's not showing up in /dev/usb/lp*. If I can get it to show up there, then I should be able to send raw text to it and be good to go.

Would I have better luck if I just got a genuine Epson? This one is an Amazon off brand from China so wonder if that's why I'm having issues. I rather pay more and have something plug and play than to have to screw around with some weird stuff each time I want to make it work.

Last edited by Red Squirrel; 04-20-2019 at 07:38 AM.
 
Old 04-20-2019, 01:22 PM   #11
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Mint 17.1 KDE on workstation, CentOS 6.x on servers
Posts: 1,142

Original Poster
Rep: Reputation: 47
Been screwing with this all day and no go. Different systems always get same error. Found a few posts with people having the same issue but no real solution that works.

Think I'll give up and buy another printer and hope for the best. There is a local company here that specializes in POS systems, I'm hoping they might have some Epson branded ones in stock and I'll just buy locally on Monday since I'm off, so I can try it and if I get the same issue then at least I can rule out the printer and then return it. The Epson ones are not cheap they are a good $500+. But if it works out of the box, it will be worth it.
 
Old 04-20-2019, 03:34 PM   #12
Mike_Walsh
Member
 
Registered: Jul 2017
Location: King's Lynn, UK
Distribution: Nowt but Puppies....
Posts: 327

Rep: Reputation: 139Reputation: 139
@ Red Squirrel:-

This is why I usually try to stick with name-branded hardware wherever possible. I have too many memories over the years of messing around with cheap Chinese gear for weeks on end, trying to get stuff working.....only to find out that they seem to delight in using the most obscure chipsets imaginable. The only drivers available are, of course, for Windoze.

I gave up on that kind of thing as a lost cause, years ago. I soon learnt that with Linux, you need to research your hardware thoroughly before investing in it. You can't indulge in the Windows-users pastime of buying whatever shiny gadget catches your eye..!

I certainly can't find fault with your plan of getting an Epson. I've been using them for over 35 years, and never had a day's trouble with them. Perhaps a wee bit agricultural compared to, say, HP or Canon, but they're built like brick outhouses, and just keep chugging along for ever.....


Mike.

Last edited by Mike_Walsh; 04-20-2019 at 03:37 PM.
 
Old 04-20-2019, 05:06 PM   #13
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Mint 17.1 KDE on workstation, CentOS 6.x on servers
Posts: 1,142

Original Poster
Rep: Reputation: 47
Yeah I'm hoping the Epson will be plug and play. I found this one: https://www.staples.ca/en/Epson-TM-T...4_1-CA_1_20001

But not sure if it supports EPS/POS it does not mention. Is it safe to assume that they all do especially given it's an Epson?
 
Old 04-23-2019, 10:13 PM   #14
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Mint 17.1 KDE on workstation, CentOS 6.x on servers
Posts: 1,142

Original Poster
Rep: Reputation: 47
Well I just went ahead and ordered it, wish me luck. Hopefully it will show up when I plug it in, instead of giving that error.

I will try to return the one I got off Amazon.
 
Old 04-29-2019, 03:58 PM   #15
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Mint 17.1 KDE on workstation, CentOS 6.x on servers
Posts: 1,142

Original Poster
Rep: Reputation: 47
Good news!

So I received the Epson TM-T20II in the mail, plugged it in, and it detects properly! So I guess it was an issue with this particular off brand Chinese printer. Glad that this is plug and play.

Code:
falcon ~ # dmesg
[3649912.188677] usb 3-10.4.5.2: USB disconnect, device number 37
[3649912.188864] usblp3: removed
[3649925.697070] usb 3-10.4.5.2: new full-speed USB device number 38 using xhci_hcd
[3649925.786521] usb 3-10.4.5.2: New USB device found, idVendor=04b8, idProduct=0e15
[3649925.786526] usb 3-10.4.5.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[3649925.786528] usb 3-10.4.5.2: Product: TM-T20II
[3649925.786531] usb 3-10.4.5.2: Manufacturer: EPSON
[3649925.786533] usb 3-10.4.5.2: SerialNumber: 544336594967940000
[3649925.788164] usblp 3-10.4.5.2:1.0: usblp3: USB Bidirectional printer dev 38 if 0 alt 0 proto 2 vid 0x04B8 pid 0x0E15
[3649930.863877] usblp3: removed
[3649930.865728] usblp 3-10.4.5.2:1.0: usblp3: USB Bidirectional printer dev 38 if 0 alt 0 proto 2 vid 0x04B8 pid 0x0E15
falcon ~ # 
falcon ~ # 
falcon ~ # 
falcon ~ # echo "test 1234567890 abcdefghijklmnopqrstuv" > /dev/usb/lp3

I have not played with actual ESC/POS commands yet but the fact that I can send clear text is a good sign. It also has an auto cutter which is kind of neat, once I read up more on the commands I think I'll have a bit of fun with this before I actually put it in production. :P It's neat that it's that easy to talk to and that you don't need to mess around with complicated libraries or anything like that.

Here's hoping it will work on the RPI as well though... but I'll consider this solved for now. I'll have to play with it further when I'm off work.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Thermal Printer with Linux (Gambas3) BlankAndExplain Linux - Newbie 1 04-21-2016 02:21 PM
Continous printing with CUPS thermal printer (GeBE USB Printer N78) ThaRez Linux - Hardware 0 04-15-2014 03:44 PM
CPU fans: thermal pads and thermal paste; newbiesforever General 17 11-23-2009 10:22 PM
80collum thermal printer (serial) frieza Linux - Hardware 1 02-23-2004 10:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 02:57 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration