Posted by: reformedmusings | December 13, 2008

Fixing Epson scanners in Ubuntu 8.10 Intrepid Linux

Well, after talking about all the USB fixes in the new 2.6.27-9 Linux kernel sported by Ubuntu 8.10 Intrepid, I have to eat a little crow. As I further evaluated Ubuntu Intrepid for adoption as my primary production system, I found that it didn’t properly recognize my USB Epson Stylus CX7800 All-in-One  as a scanner. Bummer. This was a problem in earlier versions of *buntu, but was fixed in 8.04 Hardy. Apparently Intrepid broke it again. Sheesh.

Being the dutiful fellow that I am, I went right to the forums to find a solution. While the problem seems to be rather wide-spread, none of the few solutions presented worked. I downloaded updated scanner drivers from Epson Japan’s website but held off installing them until I analyzed the situation. Analysis consisted of checking the extent of the situation and comparing the Intrepid installation against my working Hardy one.

The first smart thing to do is find out if you are in the scanner group with permissions to use a scanner. This is simple enough. In the menus, go to System -> Administration -> Users and Groups. Click on Unlock and type in your administrative password.

scan-users-top

Highlight your name and click on Properties, then on the User Privileges tab:

scan-user-priv

Ensure that the box next to “Use scanners” is checked. If it wasn’t, you must check it, click OK, then logout and log back in so that the user change registers with the system.

In order to see if a USB device is recognized, open a terminal window and type:

lsusb

This should yield results looking something like this:

scan-lsusb

As you can see, the Epson CX7800 shows up in the list. So, the device is detected. It also shows up in the list of detected printers under System -> Administration -> Printing, so we know that the printer portion is good to go.

Next it would be prudent to see if the correct libraries are loaded for the scanner. Linux uses the SANE (Scanner Access Now Easy) to interface with scanners. Open Synaptic Package Manager and type “sane” in the search box to see what’s already installed:

scan-synaptic

Ensure that sane, sane-utils, libsane, and libsane-extras are ALL installed. The Epson drivers are in libsane-extra, which wasn’t initially installed by Ubuntu on my system. (xsane is a scanner GUI that uses sane. While optional, I always install it’s a descent and easy-to-use program.) If you are missing any of these packages, install them and restart udev to reinitialize your hardware by typing this line into the terminal:

sudo /etc/init.d/udev restart

The next step is to see if Ubuntu recognized the scanner. Type the following  command in the terminal:

sane-find-scanner

You should get an output like this:

scan-sane-find

You can see that sane found the scanner on the USB bus. But that isn’t sufficient. The note below the line where it lists the USB scanner recommends trying another command. So, let’s type that one:

scanimage -L

which yields:

scan-scanimage-nogo

No scanners were identified – that’s what I received when I went through this process. I tried using the same commands as a super user (sudo), but no change. Ugh. Time to troubleshoot in earnest. Keep that terminal open, though, because we’ll need the information from the outputs we just received.

The first thing that I did was check the /etc/udev/rules.d/ directory for a 45-libsane.rules file as suggested by one forum poster. It didn’t exist, so I created the file. Then I noticed a 50-libsane-extras.rules file. In viewing it, I found the line I had just added in the other file. Dead end on that approach. However, it reinforced the fact that libsane-extras indeed supports the CX7800 and host of other scanners out fo the box. By all rights, it should work if we’ve done everything I’ve covered so far in this post correctly. Time to dig deeper into the system.

After comparing the Intrepid and Hardy setups (a luxury most users don’t have), I noticed that the file /etc/sane.d/epkowa.conf file was present in Hardy but missing in Intrepid. Hmmm. This was an issue in earlier versions of *buntu and now the solution was looking familiar. So, I copied the file from 8.04 over to the 8.10 installation.

What if you don’t have a spare copy of epkowa.conf laying around? Create it from scratch. In the terminal, type:

sudo gedit /etc/sane.d/epkowa.conf

Then cut and paste the following text in its entirely into the empty file:

# epkowa.conf — sample configuration for the EPKOWA SANE backend
# Copyright (C) 2004  Olaf Meeuwissen
#
# See sane-epkowa(5), sane-scsi(5) and sane-usb(5) for details.

# SCSI scanners can be configured simply by listing the path to the
# device.  For example, if your system claims to have a /dev/scanner
# SCSI device, all you have to do is uncomment the following line:
#
#/dev/scanner
#
# In the interest of maintainability, most installations would have
# /dev/scanner sym-linked to the real SCSI scanner device node.
#
# An alternative way that works for many operating systems and is a
# little bit more generic, is to have the backend probe for your SCSI
# scanner with the following configuration command:
#
scsi EPSON

# On systems with libusb, the following line is sufficient to get the
# backend to recognise your USB scanners.  It presumes, however, that
# the scanner—more precisely, it’s USB product ID—is known to the
# backend.
# For all USB scanners that are officially supported by this backend,
# this presumption is true.  A list of such scanners can be found in
# sane-epkowa(5).
#
usb

# For any USB scanner not known to the backend (yet), you may, at your
# own peril(!!), force the backend to recognise and use it via libusb.
# You can do so by the following configuration command:
#
#   usb <USB vendor ID> <USB product ID>
#
# SEIKO EPSON’s USB vendor ID is ‘0x04b8’ (without quotes).  In order
# to find the USB product ID, use lsusb(1) or, on Linux systems, peek
# at the information in /proc/bus/usb/devices.
# A sample configuration for the Perfection 1650 (GT-8200), which has
# a product ID of 0x0110, would look as follows:
#
#usb 0x04b8 0x0110

# When not accessing your USB scanner via libusb, you may need to use
# one of the configuration commands below or commands that are almost
# the same.  These commands typically access the scanner via a kernel
# scanner module.
#
#usb /dev/usb/scanner0
#usb /dev/usbscanner0
#usb /dev/uscanner0
#
# Linux had a scanner module until version 2.6.2.  As of version 2.6.3
# libusb is your only option.  Linux’ scanner module can be loaded via
# the modprobe(8) command like so:
#
#   modprobe scanner vendor=<USB vendor ID> product=<USB product ID>
#
# If the scanner module already knows the vendor and product IDs, you
# do not have to specify them.  If you want to have this done automa-
# tically every time you boot, you can add the above line, except for
# the modprobe command itself, to your /etc/modules file.

# Although not tested with this backend, parallel port scanners should
# be usable.  You can configure them as shown below, but I do not know
# much about the details.  Information is welcome.
#
#pio 0x278
#pio 0x378
#pio 0x3BC

Now save the file.

UPDATE: (Many thanks to saftaplan for bringing this to my attention.) This immediately-following section is not required for Intrepid, but may be for distributions older than Hardy:

But remembering my experience from a year ago in Edgy, just copying the file over wasn’t sufficient because a key line is commented out. If you are running a distribution older than Hardy and don’t already have the file opened by creating it above, then edit the file as a super user by typing this in the terminal:

sudo gedit /etc/sane.d/epkowa.conf

I found and changed the line that looked like:

#usb 0x04b8 0x0110

to match my scanner. The first hexidecimal number represents the manufacturer. 04b8 is Epson’s code and so doesn’t need to be changed. The second number is your scanner model. You can get this from the output of your sane-find-scanner command in the terminal. In my case, that command’s output had “081f” after “product=”, which is the code for the CX7800. That’s the code that goes last on the above line. After deleting the ‘#’ in front of the line to uncomment it and putting in my information, the line now looks like:

usb 0x04b8 0x081f

I then saved the file and exited gedit.

So, what did we just do? Simply stated, we jammed our scanner into the operating system’s face by explicitly telling the USB subsystem to recognize the device listed as a scanner. Sounds harsh, but it worked a year ago in the Edgy and Gutsy Kubuntu distributions.

After saving the file, reboot your system. After it comes back up, open a terminal again and type:

sane-find-scanner

Your output should look something like I illustrated near the top of this post again. Now type:

scanimage -L

This time you should see something like:

scan-scanimage-found

Success! The system recognizes our scanner. Now you can go into a scanning program like xsane or gscan2pdf and it should find your Epson scanner.

I’ll say one more time that the necessity for this procedure doesn’t make sense to me. libsane-extras explicitly supports a host of Epson scanning devices. All I can imagine is that the USB subsystem in Ubuntu 8.10 Intrepid, while fixing the automatic mounting of removable media, regressed on the correct implementation of USB scanners. It seems that perhaps the lessons learned in Edgy and Gutsy weren’t learned as well as they should have been. Sigh.

But in any event, this procedure should get you up and scanning again in 8.10 Intrepid. Mine works now, which brings me a step closer to switching over to Ubuntu 8.10 Intrepid for my production system.


Responses

  1. […] this post by our good friend Bob shows why Linux will never get more than 2% of market share. Can you […]

  2. Thanks a lot for the how-to. I was kind of suprised that my brother’s scanner suddenly didn’t work anymore in 8.10. Kind of stupid that it’s just epkowa.conf that’s missing. I didn’t have to do the part of jamming the scanner into the OS’es face: once I copied the configuration file, my scanner was instantly recognized.
    FYI, I filed a bug report: https://bugs.launchpad.net/ubuntu/+source/sane-backends-extras/+bug/134667 , and gave this page as a reference. I hope you don’t mind.
    Thanks again!

  3. Sorry, wrong URL. It’s https://bugs.launchpad.net/ubuntu/+source/sane-backends-extras/+bug/307991 .

  4. You’re welcome. Thank you for filing the bug report. I haven’t had time to do that yet. No problem with the linking here. I hope that it helps others in our position.

  5. […] (12/13/2008): If you are having problems with an Epson scanner in Intrepid, see this post. Possibly related posts: (automatically generated)Moving from Kubuntu 8.04 to Ubuntu 8.10KDEInstall […]

  6. You, my friend, are a lifesaver. Your walkthrough worked perfectly for my Epson CX7400, and your explanation meant I actually understood what I was trying to do, instead of just applying a blind fix on a stranger’s recommendation. Thanks.

  7. moriarty6,

    You are very welcome. I’m a strong believer in understanding, if possible, why I’m doing something. I’m glad that it resolved your issues. Happy scanning!

  8. The weirdest thing. I followed your instructions and it worked. Now today, the scanner is not recognised! Any ideas why this could be? Mine is an RX650 which is supported by the backend so “usb” only should be required, but I have tried it with the hard coded entry with the product ID.

  9. Hi pjaikins,

    Did you change, install, or uninstall anything just before today? Are the permissions still set correctly? Does it work with “sudo scanimagle -L”?

  10. I confess that I have been trying to get my Digital TV card working and have been mucking around with the cx88_dvb modules and the like. This may have stuffed things up. 😦
    I have completely removed sane, sane-utils, sane-extras from within Synaptic and rebooted, then installed them again with a follow up reboot. No dice though! sudo scanimage -L yields no results.

  11. Hmmm. It’s not obvious to me how a Digital TV card and a USB printer might be related. When you reinstalled sane, etc., did you reapply the fixes in the post?

  12. Ran through the steps again and no luck. Interestingly the epkowa.conf file was present in the /etc/sane.d even after uninstalling and reinstalling the sane-extras. Is there any debug messaging logs or other status commands that I could use?

  13. Generally if a program didn’t install a file, it won’t remove it unless you select “purge” rather than just uninstall.

    You can use “lsusb” to see if your system recognizes the scanner as a device. You can also try unplugging the scanner from the USB port, then plug it back in and then type “dmesg | grep usb” in the terminal to see if the system picks it up properly and how it recognizes it. If the USB system doesn’t recognize your scanner, sane won’t either.

  14. lsusb shows the following:
    Bus 002 Device 002: ID 0bc7:0008 X10 Wireless Technology, Inc. Wireless Transceiver (ACPI-compliant)
    Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 001 Device 006: ID 046d:09a2 Logitech, Inc.
    Bus 001 Device 005: ID 04b8:081c Seiko Epson Corp. Stylus Photo RX640/RX650 (PM-A890)
    Bus 001 Device 003: ID 0424:2504 Standard Microsystems Corp. USB 2.0 Hub
    Bus 001 Device 004: ID 04b4:6830 Cypress Semiconductor Corp. CY7C68300A EZ-USB AT2 USB 2.0 to ATA/ATAPI
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

    dmesg|grep usb shows the following after I unplug then replug the device:
    [15232.645115] usb 1-2.3: USB disconnect, address 7
    [15232.648579] usblp0: removed
    [15273.289151] usb 1-2.3: new high speed USB device using ehci_hcd and address 8
    [15273.391736] usb 1-2.3: configuration #1 chosen from 1 choice
    [15273.402272] usblp0: USB Bidirectional printer dev 8 if 1 alt 0 proto 2 vid 0x04B8 pid 0x081C
    [15273.414282] usb-storage: device found at 8
    [15273.414285] usb-storage: waiting for device to settle before scanning
    [15278.412268] usb-storage: device scan complete

  15. That looks good. If sane, sane-extras, and sane-utils are installed correctly, and the above fixes set up, you should at least get “sudo scanimage -L” to see the scanner. You might check to ensure that you and root have scanner privileges. If root doesn’t have scanner privileges, using sudo won’t help.

    Other than that, I’ll have to think on this overnight.

  16. Thanks, enabled everything on the root and no dice. My account already has access to the scanner as per your instructions. Thanks for your help. I too will think about what I have done in the interim to see if I can reverse it.

  17. Success! I looked at my home directory and found that there was a sane-backend folder that was from a previous effort to get the scanner working, I performed a “make uninstall”. Then I opened Synaptic and selected completely remove for the following:
    Completely removed the following packages:
    libsane
    libsane-extras
    sane
    sane-utils
    xsane-common

    Removed the following packages:
    gscan2pdf
    xsane

    I checked the /etc/sane.d and it still had epkowa.conf, so I completely removed this directory.

    Then I rebooted the system. Then reinstalled the following:
    Installed the following packages:
    gscan2pdf (0.9.25-1)
    libsane (1.0.19-6ubuntu1)
    libsane-extras (1.0.19.8ubuntu1)
    sane (1.0.14-6)
    sane-utils (1.0.19-6ubuntu1)
    xsane (0.995-3ubuntu2)
    xsane-common (0.995-3ubuntu2)

    Again, rebooted and ran Xane and success, the scanner was recognised! I’m so relieved! \(^_^)/

    Listen up Ubuntu dev team, we should not have to do this crap!

  18. Great news!

    I wholeheartedly agree that all of this should not be necessary. Maybe some day…

  19. […] everything except preview). I found a good tutorial for fixing the problem with my all-in-one here, but it requires some time in the terminal. Mostly you just follow the instructions and cut/paste […]

  20. I just wanted to express my gratitude for your very informative blog post. I am using an Epson Stylus CX7450 and Xubuntu 8.10. As in your situation my scanner wasn’t recognized but by simply following your detailed steps I was able to get it up and going! Thank you very much, the time and research you spent in solving this has been very helpful. Thank you again. 🙂

  21. You are most welcome. I’m very happy that it worked for you.

    Happily in Karmic, installing libsane-extras enables my CX7800 with no other intervention.

  22. I just wanted to add my sincere thanks for the fantastically helpful blog post!

    I’m a linux newbie and had previously been running Ubuntu 9.10 where my Epson DX8400 had just worked as a scanner, but I had great problems getting to print (I got there in the end following someone else’s post); then I upgraded to Ubuntu 10.04 to find to my delight that my printer just worked and to my horror that the scanner did not!

    I had to change to an Epson TX117, which Ubuntu 10.04 still recognised to print to, but still failed to recognise to scan from, and after much hunting on the net and re-installing the xsane and sane packages a few times with no success, I finally came across this post – thank God!!

    Anyway, it seemed to be a combination of the right set of packages together with the epkowa.conf file that finally got things going for me.

    Thanks again!! 🙂

    • Thank you for taking time to write. I’m glad that you were able to get everything working. Welcome to the freedom of Linux as well!

  23. It is now February 2012 with bleedin’ Natty installed and they still haven’t learnt
    BUT thanks to Refiormedmusings it’s up and running!
    I have to say after all these years your page still does the trick..
    Thank you!

    • Super! I’m glad that this post helped you. Thanks for taking time to let me know.


Leave a reply to reformedmusings Cancel reply

Categories