Getting a Scanner to work in Linux
CUPS also shows a fax queue, but nothing happens when I send document to it. To send faxes I have to run a hard copy through the printer and use the printer control panel. Whatever, it works.
The 3050 has a sheet-feed scanner. Yeah, el cheapo, it's what I could afford at the time. Here is where I get annoyed. My main workstation is Debian Lenny, and the darned thing does not set up scanners bloodlessly, you have to jump through mondo hoops. Last time I looked it was the 21st century, did something happen and I got sent back to 1998? Though I recall having to jump through the same hoops on Kubuntu last year on the same PC.
Useless HP Toolbox
The machine comes with the HP Toolbox, which is sort of useful, but mostly not. The graphical interface is very limited and doesn't even recognize the printer and throws up sad communication errors. It doesn't do much of anything, I wonder why they even bother.There are some commands that are occasionally useful, and which helped me get the scanner to work. The first step for any scanner connected to a Linux PC is to consult the SANE supported devices database. (SANE is the scanner backend for Linux.) This isn't 100% complete, but it's a good start.
Then run this command to see if SANE detects your scanner:
$ scanimage -L
No scanners were identified. If you were expecting something different, check that the scanner is plugged in, turned on and detected by the sane-find-scanner tool
Don't take no for an answer; try it as root:
# scanimage -L
device `hpaio:/usb/HP_LaserJet_3050?serial=00CNBK406377' is a Hewlett-Packard HP_LaserJet_3050 all-in-one
This is good news and bad news. The good news is SANE sees it. The bad news is this indicates a permissions problem, and since the advent of udev adjusting device permissions is hell itself.
Next step is find the USB address:
# sane-find-scanner
found USB scanner (vendor=0x03f0 [Hewlett-Packard], product=0x3217 [HP LaserJet 3050]) at libusb:005:002
We're getting closer, really we are! Ordinarily at this point we would take this information, the vendor=0x03f0 and product=0x3217, and plug it into a /etc/udev/rules.d/ script. On my Lenny PC, that is /etc/udev/rules.d/z60_libsane.rules. Quit laughing, it is too. I don't invent this stuff, I just use it.
OK then. This file is already full of rules, so all I need to do to create a new one is copy-and-paste, using the vendor and product ID for my printer. My new rule looks like this:
# Hewlett-Packard LaserJet 3050 MFP
SYSFS{idVendor}=="03f0", SYSFS{idProduct}=="3217", MODE="0664", GROUP="scanner", ENV{libsane_matched}="yes"
Then I need to add myself to the "scanner" group, and log out and log back in to activate my shiny new group membership.
But still no scanner. A fast test is to scan a document as root and as an unprivileged user with the scanimage > filename.pnm command. This tells you if it works at all, and if you have permission problems.
Somewheres in my peeve-fueled Google searches I learned about this command from the HP Toolbox:
# hp-check -t
This spits out a lot of information, and the key bit for me was
'hpaio' not in '/etc/sane.d/dll.conf'...
SANE backend 'hpaio' is not properly set up.
Um. OK. I guess the person who crafted this message was charged by the word and ran out of budget. But it turns out it is literal-- I added the word "hpaio" to /etc/sane.d/dll.conf and lo, forsooth, and boy howdy I now have a functioning scanner.
Crazy Dream
I have this crazy dream. I dream of a world where things like this do not happen because vendors take pride in their products and want customers to have good experiences. Where HP works with CUPS and SANE to create an integrated installer and device manager. Where it doesn't take fifteen freaking years of experience to figure out how to make something that I paid for to work like it is supposed to. You know all those people who stick with commercial vendors because they get support? Ha. It is to laugh-- I got nothing from HP.At any rate the thing works now.
0 TrackBacks
Listed below are links to blogs that reference this entry: Getting a Scanner to work in Linux.
TrackBack URL for this entry: https://swarm.jupitermedia.com/mt-tb.cgi/9201



Good for you, mine still doesn't work :( I was really hoping this article would help, but alas, it has not. It has, however, taught me about the awesome "hp-check -t", so thanks for that.
What does "I added the word "hpaio" to /etc/sane.d/dll.conf" mean? Put the word in the file? Or add it to file name? Or what?
Thanks,
john
All of my HP stuff worked out of the box, no config, plug and play ... but, I am running Fedora 11.
Samsung 1710 took a little bit of time, maybe 2 minutes.
Lexmark z53 took 10 minutes of research and 2 minutes to config.
Wonder if it has anything to do with the Distro ?
Wow, looks like something out of the "Twilight Zone".
I'm having some trouble with my OEM Mandriva 2008 (the one I got on my pre-installed Linux box).
I have a Canon scanner (Lide 25) which went uninstalled for some time. I thought it was perfectly compatible, but it's something like nearly perfectly compatible.
Anyway, I plugged the USB thing hoping it would call XSane automagically.
Alas, nothing. Kaputt.
Something was missing and there I set out to discover what it was and... and it is a very big mess. After changing config files and facing the less motivating task of compiling things (no problems when testing a weirdo game, but for mainstream things like XSane -- well, no way!).
Then I had an idea and tried to boot an old Ubuntu 8.10 I had getting dust over here (since my Ubuntu and Kubuntu 9.04 were sto... erm, "donated" to friends).
Lo and behold! It worked so fine it found the scanner by itself and thus my daughter could have her map printed to bring to class.
Now I have to use Ubuntu on my Mandriva 2008 PC to use the scanner and I have to use Mandriva 2009 in my other PC (which has an old Mandrake 10.1 installed) because it's the only which has WPA2 encryption (yes, Ubuntu pre-9.10 didn't have it).
In another post on LT, I write about the very uninspiring Live CD boot times of 9.10. Someone should make it clear whether this Upstart thing is available for CD boot... it might not be, since it's a new thing -- and live CDs are supposed not to mess with the user's HD.
My point is, probably like everyone, I have a lot of things to do (like getting my turntable to work...) and cannot lose time tweaking things which should be working without user intervention.
And, no, I don't miss Windows. I have to work with it everyday. It's a lot more difficult to use than Linux.
But these distro folks should get their act together... after all, distros are supposed to make things work, aren't they? If I have to do things myself, I might as well go through the trouble of using Gentoo or something alike.
I use this printer/scanner in Ubuntu (starting with 8.04 and up to 9.10) and it worked without me doing anything special. I just connected it to the computer and I was able to print immediately. As for the scanner, it works flawlessly with Xsane. Again, no set up from my part.
So it must be the distribution you are using.
I am using Kubuntu (now on 9.10 with KDE 4.3.3) and as photography is a thing I really like, I was a little sad when I started looking around at what was available to control my scanners in Linux. Until one day when I did a search and saw someone mention Vuescan. This is my favourite scanner program and I bought a pro license some years ago for Windows. But this mention I saw was about Linux!
So I went to their website and sure enough, there is a Linux version available. Just download, install and enter the serial number (I have upgrades free for life). Everything works as expected and I can do all the same things as I did in Windows before.
Yes, It cost a little money, but it is not expensive at all, so I am perfectly happy to pay for this software. It does exactly what I need. And it does it in Linux :-)
My HP 5580 scanner-printer mostly works, but I stopped paying attention to HPLIP support when they told me my problem with printing on transparencies was caused by using non-HP media. I told them I can use any damn media I please, thank you.
HPLIP also ignored the fact that the transparencies printed properly on the same system when I ran windows. Also the scanner shows blurry vertical bands on linux that are not present on windows.
Obviously, there is a functional difference between the linux and widows drivers.
HPLIP support rejects both these facts, claiming the drivers function identically.
I use that series of HP all in one in both Linux Mint gnome and Linux Mind KDE. I discovered that "google" usually provides the answer I seek. Google let me know about the along with . Once you have added ,sane> access the scanning package via . I am doing everything in Linux (except for Quickbooks). My secret for complete Linux success has been attitude, patience and discovery.
Jack H.
My aging but still good Epson 636U scanner is recognized immediately when I bring up Sane on my sidux boxes. No problems, it just works.
I had similar UDEV problems a few months ago:
http://jhansonxi.blogspot.com/2009/08/writing-udev-rules-to-get-scsi-scanner.html
Sigh...HP. There was a time when HP sold quality equipment and supported it well. I am old enough to remember. But somewhere along the road they discovered that they could make more money selling ink cartridges, which they push by giving you shoddy junk and the illusion of tech support for a low initial price. If it makes you feel any better, my last HP all-in-one was even more crapped up on a Mac than on Linux.
HP Toolbox has always worked flawlessly for me using Ubuntu, using Debian Squeeze it was not so simple. I have an HP 5180 networked printer/scannner and it works very well, with squeeze it took a bit of mucking around to get HPLIP to work. But it does work. Thanks HP
I would give anything for my old ix and vx serial port scanners to work in linux.
hp 5510 worked perfect with hplip
hp 6510 worked with hplip but live to work half time
now i am with epson stylus cx9300F (all in one)
. the printer works fine
. for the scanner i needed to d\l driver from epson site
. and everything works fine
(epson ink is cheaper in 50%)
Thanks for the article. This is exactly the sort of experience I was dreading when I bought a Lexmark X2670 printer-scanner combo a few months ago. Unlike my previous printer, it wasn't supported by default in Mandriva, but the manufacturer's site said Linux was "supported" so I thought they'd at least give me a refund if it failed. The driver took a while to find on their site, but I eventually downloaded a 27MB file meant for Fedora, and attempted to install it in Mandriva 2008.
The install seemed to work, so I tried a test page. Printing worked perfectly, and better still, the options were available in the usual way through CUPS - I'd been expecting some half-baked proprietary application. Then I fired up SANE and there was the scanner, in all its glory, and it too worked flawlessly.
It was like a dream - a lot like Carla's dream, in fact. My only gripe is with the ridiculous EULA on the bundled print cartridges, but at least Lexamark appears to have a clue about software.
Never take the word of the vendor as to whether the device is supported in Linux. By "supported" the vendor almost always means "works using some bits you can only get from us on some Linux distros at this particular time". Just because vendor supplied drivers work today don't mean they'll keep working when you upgrade to the next release of your distro, or for that matter after you install a security update.
It's sad, but you have to check with the project, sane in this case, to be sure that the device is really supported no matter what distro you choose and no matter how many times you upgrade your software.
Carla, are you a member of the 'scanner' group?
Debian does not necessarily add new users to this and other usefull groups because it might have some security implications.
Have any of you tried Vuescan for linux? It seems to support every recently made scanner I could find including many network ones. I am considering purchasing it in order to get my brother MFC7820N working in Ubuntu (9.04 or 8.10)