Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Other Things Gentoo
  • Search

cups, udev and usb printer

Still need help with Gentoo, and your question doesn't fit in the above forums? Here is your last bastion of hope.
Post Reply
Advanced search
11 posts • Page 1 of 1
Author
Message
alo-alo
n00b
n00b
Posts: 74
Joined: Sun Oct 05, 2003 9:47 am

cups, udev and usb printer

  • Quote

Post by alo-alo » Tue Feb 17, 2004 11:16 pm

Hi! Did anybody get working usb printer with udev and cups? I can't print with cups. Cups accepts jobs, but it won't print. Over which device are you printing?
Top
alshain
Apprentice
Apprentice
User avatar
Posts: 202
Joined: Fri Aug 02, 2002 2:33 pm
Location: London, UK

Re: cups, udev and usb printer

  • Quote

Post by alshain » Tue Feb 24, 2004 7:38 pm

alo-alo wrote:Hi! Did anybody get working usb printer with udev and cups? I can't print with cups. Cups accepts jobs, but it won't print. Over which device are you printing?
Hello, did you have any success? Since moving to udev I've had absolutely no luck printing at all. Initially the job would show up briefly in the print queue and disappear. Now with kernel 2.6.3 the printer just spews endless blank pages at me (it's an Epson Stylus 680 by the way). It's frustrating having to boot to Windows just to print things. :evil:

Andrew
Top
alshain
Apprentice
Apprentice
User avatar
Posts: 202
Joined: Fri Aug 02, 2002 2:33 pm
Location: London, UK

Re: cups, udev and usb printer

  • Quote

Post by alshain » Tue Feb 24, 2004 8:55 pm

alo-alo wrote:Hi! Did anybody get working usb printer with udev and cups? I can't print with cups. Cups accepts jobs, but it won't print. Over which device are you printing?
Oh joy! I used foomatic-compiledb to build a ppd database and then

foomatic-configure -n mushroom -N "Epson Stylus Color 680" -L "Here" -c usb:/dev/lp0 --ppd /etc/cups/ppd/Epson-Stylus_Color_680-gimp-print-ijs.ppd -d gimp-print -s cups

and my printer now works again! Strange that neither adding the printer via the web interface or kdecontrol worked.

Andrew

P.S. Yes, it looks exactly like a mushroom :D
Top
beandog
Bodhisattva
Bodhisattva
User avatar
Posts: 2074
Joined: Sun May 04, 2003 11:53 pm
Location: /usa/utah
Contact:
Contact beandog
Website

  • Quote

Post by beandog » Sun Feb 29, 2004 5:54 am

I just realized what was happening to mine.. on the cups admin, it says:

Code: Select all

"Unable to open USB device "usb://HP/DeskJet%20845C?serial=TH173141WMSX": No such device" 
but then I saw right above that,

Code: Select all

 Location: /dev/usb/lp0
and realized the location might have changed with udev ... sure enough /dev/usb/ doesn't even exist. /dev/lp0 does though.

Even then it gave me a few problems, and to play it safe, I just deleted my printer from the cups list completely and readded it. You may not want to do that though, since it loses all your old print jobs.
If it ain't broke, tweak it. dvds | blurays | blog | wiki
Top
Bob Paddock
n00b
n00b
Posts: 49
Joined: Sun Aug 25, 2002 2:18 am
Contact:
Contact Bob Paddock
Website

Re: cups, udev and usb printer

  • Quote

Post by Bob Paddock » Sun Feb 29, 2004 12:38 pm

alo-alo wrote:Hi! Did anybody get working usb printer with udev and cups? I can't print with cups. Cups accepts jobs, but it won't print. Over which device are you printing?
Yes, I just did, took some digging, but not hard to do in the end.

There are some prerequisites:

Make sure 'usblp' is compiled into your kernel or you are loading it as a module.

Make sure your printer is connected and on, and that 'usbview' shows it.


You may need to Reboot or do the following to get the udev files we need to
find created, they probably already do exist at this point, so you probably
don't have to do this:

Code: Select all


/etc/init.d/hotplug stop
/etc/init.d/hotplug start


Next Open the file:

Code: Select all


# /etc/udev/udev.rules:  device naming rules for udev

Look for these lines:

Code: Select all

# USB Epson printer to be called lp_epson
#BUS="usb", SYSFS_serial="HXOLL0012202323480", NAME="lp_epson"

# USB HP printer to be called lp_hp
#BUS="usb", SYSFS_serial="W09090207101241330", NAME="lp_hp"

To get my Lexmark Z53 working I had to add:

Code: Select all


# USB Lexmark Z53 printer to be called usb_lp_lexmark_z53
BUS="usb", SYSFS_product="Lexmark Z53", NAME="usb_lp_lexmark_z53"

You can use anything you want for the NAME field as long as it does not already exist
in the /dev directory.

The tricky part is figuring out what to put for "SYSFS_" it could be "product",
"serial", "manufacture", "SCSI UUID", "vendor", or several other choices.

To find out the best choice for your printer you need to look in:

Code: Select all


cat /proc/bus/usb/devices

that will give you index for:

/sys/bus/usb/devices

This is the 'devices' entry for my Lexmark Z53:

T:  Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  2 Spd=12  MxCh= 0
D:  Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=16 #Cfgs=  1
P:  Vendor=043d ProdID=0054 Rev= 1.00
S:  Manufacturer=Lexmark
S:  Product=Lexmark Z53
C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr=  4mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=07(print) Sub=01 Prot=02 Driver=usblp
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=83(I) Atr=02(Bulk) MxPS=  16 Ivl=0ms

I took a guess and tried "SYSFS_product" and it worked.
Note the "I: If#=" says "Driver=usblp" on the end.

You may need to find your device the 'hard way' by probing around
in:

Code: Select all

/sys/bus/usb/devices
The "T:" line for your printer should lead you to the right spot,
with Bus=, Lev= and Dev#= entries.

I found the printer that I was looking for in:

Code: Select all

/sys/bus/usb/devices/usb1/1-2
where you find these files:

Code: Select all


ls /sys/bus/usb/devices/usb1/1-2


1-2:1.0              bDeviceClass     bDeviceSubClass  bNumConfigurations  bcdDevice     detach_state  idVendor      power    speed
bConfigurationValue  bDeviceProtocol  bMaxPower        bNumInterfaces      bmAttributes  idProduct     manufacturer  product

You can use any of those file names as the suffix to "SYSFS_". Pick the one
that uniquely identifies your printer, in my case it was the 'product' file.

Code: Select all

cat product

Lexmark Z53
The 'SYSFS_product="Lexmark Z53" in the rule file is what links your
device to UDEV's /sys to get things working.

When you have the rule file set up correctly, do:

Code: Select all


/etc/init.d/hotplug stop
/etc/init.d/hotplug start

Now you should see your device name listed in /dev:

Code: Select all

ls /dev
...
/dev/usb_lp_lexmark_z53
...

To get CUPS to use that printer I had to:

Code: Select all

ln -s /dev/usb_lp_lexmark_z53 /dev/usblp0
Now CUPS uses "USB Printer #1" to print.

You may need to restart hotplug again after adding /dev/usblp0.



--
                    http://www.softwaresafety.net/
Top
Evil Dark Archon
Guru
Guru
User avatar
Posts: 562
Joined: Sat Dec 21, 2002 9:50 pm
Location: Santa Rosa, CA
Contact:
Contact Evil Dark Archon
Website

  • Quote

Post by Evil Dark Archon » Sun Feb 29, 2004 8:25 pm

you can have the udev rule make the symlink to usblp0, just add a SYMLINK=usblp0 after the NAME statement.
This post has been over explained for newb-informing purposes.

Registered Linux user 347334
Abit AV8-3rd eye, AMD Athlon64 3500+ 90nm, ATI Radeon x850 pro
Top
thundersteele
Apprentice
Apprentice
Posts: 219
Joined: Sat Aug 30, 2003 12:30 pm

  • Quote

Post by thundersteele » Tue Apr 06, 2004 6:22 am

Thanx Bob and Evil, I followed your explanations and it is working now.

First I had to change my kernel, cause mm based love-sources had problems with hotplug, but now it is working. great.
Top
Nate_S
Guru
Guru
User avatar
Posts: 414
Joined: Thu Mar 18, 2004 9:05 pm

  • Quote

Post by Nate_S » Sat May 01, 2004 10:23 pm

I noticed that udev (or is it the kernel? it's just the default %k -- using 2.6.6-rc1-love1) now names usb printers lp0 instead of usblp0 or usb/lp0. I set up a udev rule to create lots of symlinks for it like so:

BUS="usb", SYSFS{manufacturer}="Hewlett-Packard", SYSFS{product}="DeskJet 960C", SYSFS{serial}="MY21N1D1M2RO", NAME="usblp%n" SYMLINK="deskjet960 printers/hpdeskjet-960c usb/lp%n %k"
(all one line in /etc/udev/rules.d/10-local.rules)
that's for my hp deskjet 960c

Also, there's a udevinfo command that you can use to find out the info instead of manually searching the /sys directory. Search the forum for 'writing udev rules'

-Nate
Top
dsd
Developer
Developer
Posts: 2162
Joined: Sun Mar 30, 2003 10:54 am
Location: nr London

  • Quote

Post by dsd » Sat May 01, 2004 10:34 pm

the next release of udev will include a rule which by default will create /dev/usb/lp0 as well as /dev/lp0 - this should kill any udev-related cups problems.

the new rule looks like:

Code: Select all

BUS="usb", KERNEL="lp[0-9]*",   NAME="usb/%k"
and thats probably the most simplistic way you can get this going right now.
http://dev.gentoo.org/~dsd
Top
AlterEgo
Veteran
Veteran
User avatar
Posts: 1619
Joined: Thu Apr 25, 2002 2:51 pm

  • Quote

Post by AlterEgo » Sun May 02, 2004 9:55 am

dsd wrote:the next release of udev will include a rule which by default will create /dev/usb/lp0 as well as /dev/lp0 - this should kill any udev-related cups problems.

the new rule looks like:

Code: Select all

BUS="usb", KERNEL="lp[0-9]*",   NAME="usb/%k"
and thats probably the most simplistic way you can get this going right now.
Thanks a lot for that hint!
It solved/circumvented a nasty problem that has been bugging me for weeks
I can now use the usb printer and access my card reader.

:D
Top
rajl
Apprentice
Apprentice
Posts: 287
Joined: Wed Sep 25, 2002 12:39 am

  • Quote

Post by rajl » Sun Aug 22, 2004 12:29 am

So I have that udev rule in place for udev printers, but it's not making the entries appear in the udev tree?
-Rajl

-----------------------------------------------------------
It's easy to be brave once you consider the alternatives.
Top
Post Reply

11 posts • Page 1 of 1

Return to “Other Things Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic