Getting a scanner to work in Ubuntu Linux...

1,248 views
Skip to first unread message

bbneo

unread,
Sep 10, 2010, 6:51:33 AM9/10/10
to Akron Linux Users Group
I am trying to get Ed Hamrick's Vuescan scanner software to work with
my Xerox Documate document scanner and my Ubuntu 10.04 notebook. Ed's
software doesn't recognize the scanner by default, but when it is run
as root, there is no problem. Ed says that this has something to do
with "libusb" permission setting and gives me some information in his
release notes about how to fix it, but I can't find any of the "rules"
files, etc.

Anybody have experience with fixing this type of issue? I would like
to be able to scan documents as my normal user self.

I will include some additional information below.

Thanks,
Brad

BTW, have a great time at Linuxfest. It looks to be super cool this
year, and again, I am somewhat stuck about being able to go, because
we are 10 days away from closing on the sale of our house.

====================================================
Ed's Release Notes (see below, I am a big fan of his software, btw)
discuss a number of "rules" files and permission setting, but I can't
find the mentioned files in Ubuntu.

From my system:

I can't find a lot of the recommended files that are discussed in the
release notes page in Ubuntu (10.04)... like "/etc/udev/rules.d/50-
udev-default.rules"...

This is what I find:

brad@brad-laptop:~$ ls -R /etc/udev
/etc/udev:
rules.d udev.conf

/etc/udev/rules.d:
10-vboxdrv.rules 70-persistent-cd.rules README
50-raw1394.rules 70-persistent-net.rules

I can't figure out where to change the permissions. One article
discussed adding users to the "scanner" group, but there doesn't seem
to be one on my system (I could add it, I guess.) There is a "saned"
group, but adding myself to that group didn't change anything.

lsusb shows the scanner:

brad@brad-laptop:~$ lsusb

Bus 005 Device 007: ID 04a7:0446 Visioneer Xerox DocuMate 510 <===
Bus 005 Device 006: ID 0a5c:4503 Broadcom Corp.
Bus 005 Device 005: ID 0a5c:4502 Broadcom Corp.
Bus 005 Device 004: ID 413c:8126 Dell Computer Corp. Wireless 355
Bluetooth
Bus 005 Device 003: ID 0a5c:4500 Broadcom Corp. BCM2046B1 USB 2.0 Hub
(part of BCM2046 Bluetooth)
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 046d:c51b Logitech, Inc. V220 Cordless Optical
Mouse for Notebooks
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

There is no "/proc/bus/usb/devices" file

usb-devices gives this info:

T: Bus=05 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 7 Spd=12 MxCh= 0
D: Ver= 1.00 Cls=ff(vend.) Sub=ff Prot=ff MxPS= 8 #Cfgs= 1
P: Vendor=04a7 ProdID=0446 Rev=00.01
S: Manufacturer=XEROX
S: Product=DocuMate 510
C: #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=100mA
I: If#= 0 Alt= 0 #EPs= 3 Cls=00(>ifc ) Sub=00 Prot=00 Driver=(none)


===================================================
http://www.hamrick.com/vuescan/vuescan.htm#linux

Linux Release Notes

On Linux, run vuescan from any directory. Your serial number will be
stored in ".vuescanrc" in your home directory.

If you're using a newer version of Ubuntu Linux, you can install the
needed version of libstdc++ with the command "sudo apt-get install
libstdc++5". If you're using 64-bit Linux, you might also need to
install "ia32-libs" and "ia32-libs-gtk".

If you're using a newer Linux distribution that's LSB compliant, edit
"/etc/udev/rules.d/50-udev-default.rules", find the line that begins
with "libusb device access" and change 0644 to 0666. (It might be in "/
lib/udev/rules.d")

If you're using a Firewire scanner, make sure you've loaded the sbp2
module.

If you get errors from gtk when starting VueScan, make sure the LANG
environment variable is set to C.

If VueScan crashes on startup, make sure you aren't using the idescsi
module - this can cause problems.

Note that PIE (Pacific Image Electronics) scanners do not work with
VueScan on Linux because CyberView X isn't available on Linux. VueScan
uses the CyberView X libraries to control the scanner.

If you're using the Epson Perfection 3170 (GT-9400), make sure you
have /usr/lib/libesint32.so from the Epson AVASYS SANE distribution.
You also need to set up the environment variable
SANEI_EPKOWA_FIRMWAREFILE to point to the firmware file esfw32.bin.
For newer versions of iscan, set up ISCAN_FW_DIR instead.

If you're using the Epson Perfection 4180 (GT-F600), make sure you
have /usr/lib/libesint43.so from the Epson AVASYS SANE distribution.
You also need to set up the environment variable
SANEI_EPKOWA_FIRMWAREFILE to point to the firmware file esfw43.bin.
For newer versions of iscan, set up ISCAN_FW_DIR instead.

If you're using the Epson Perfection 4490 (GT-X750), make sure you
have /usr/lib/libesint54.so from the Epson AVASYS SANE distribution.
You also need to set up the environment variable
SANEI_EPKOWA_FIRMWAREFILE to point to the firmware file esfw54.bin.
For newer versions of iscan, set up ISCAN_FW_DIR instead.

You need to make sure all of the /dev/sg* devices are read/write
accessible. To see what scanners are available, type "cat /proc/scsi/
scsi".

Note that the Adaptec AVA-1505 SCSI card doesn't work with a Nikon
film scanner, and will cause a hard bus hang if you use VueScan with
it. This is due to a bug in the aha152x driver. Another bug in this
driver causes junk to be appended to the end of a raw scan when using
the PhotoSmart. Other SCSI cards seem to work fine with VueScan on
Linux.

There have also been problems reported with the Adaptec AVA-2904E and
the Canon FS2710, although this combination works fine on Windows.

If you want to add or remove scsi devices without rebooting your
system, use the following commands:

echo "scsi add-single-device 0 0 ? 0" > /proc/scsi/scsi
echo "scsi remove-single-device 0 0 ? 0" > /proc/scsi/scsi

(use the SCSI ID in place of "?" above)
If you're using libusb to access a USB scanner, you need to make sure
the protections in /proc/bus/usb are set up properly. There's some
information about setting up libusb on Linux.
To use the scanner.o module on Linux, you need to load the scanner
driver and specify the vendor ID and product ID of the scanner. For
instance, to recognize the Canon N670U, use "modprobe scanner
vendor=0x04a9 product=0x220d". Then type "cat /proc/bus/usb/devices"
and make sure "Driver=usbscanner" is enabled for your scanner.

If you're using Linux 2.4.12 or later, you don't need to do anything
special to have the scanner auto-recognized.

If you're using an earler version of Linux with a USB scanner, set up
the SCANNER0 environment variable to point to /dev/usbscanner or /dev/
usb/scanner (it needs to be read/write accessible), set up the
SCANVID0 environment variable with the USB Vendor ID (VID) and set up
the SCANPID0 environment variable with the USB Product ID (PID). You
can support up to 8 USB scanners at a time by using SCANNER1,
SCANNER2, SCANVID1, SCANVID2, etc.

For instance, to set up VueScan for the Epson 640, use the following
commands if you're using csh:

setenv SCANNER0 /dev/usbscanner
setenv SCANVID0 04b8
setenv SCANPID0 010c
or if you're using sh or bash:
export SCANNER0="/dev/usbscanner"
export SCANVID0="04b8"
export SCANPID0="010c"
Note that you don't need to set up these environment variables on
newer Linux kernels or if you're using libusb.
If you're having problems with USB timeouts (i.e. with the Nikon
CoolScan IV (LS-40), make sure you use the "usb-
uhci" (CONFIG_USB_UHCI) module instead of the alternate
"uhci" (CONFIG_UHCI_ALT) module. You might also increase the kernel
usb timeout value (CONFIG_USB_LONG_TIMEOUT=y).
===================================================================


Bill Mayhew

unread,
Sep 10, 2010, 12:25:21 PM9/10/10
to Akron Linux Users Group
Hi,

I am running Redhat Enterprise Linux with a 2.6.9 kernel. I do have
the files in /proc and /etc/udev. I don't have the libusb entry in
the permissions file. On my system there's a /usr/share/doc folder
with a lot of information about libusb, if Ubuntu has on-line docs,
maybe there'd be some good hints there.

One thing that comes to mind... My RHEL4 server is used to aggregate
AES256 encrypted backups of our Windows and Linux systems for writing
onto a Lacie 2big Quadra drive that we swap back and forth with a
duplicate drive kept in a bank safe deposit box. Anyway... one time I
forgot to use the eject command before I unplugged the hard drive and
and when I plugged the drive I was swapping in, the system would
enumerate the drive with lsusb, but wouldn't appear to create a device
node for the drive.

The fix was to do:

rmmod ehci_hcd
modprobe -a ehci_hcd

to reload the modue. After that, I plugged in the drive and the
system had the device node and I was able to mount the drive like
you'd expect.

If you've been plugging and unplugging the scanner without using eject
in between, you might need to reload the usb module like I did for the
hard drive. Looking back at my /var/log/messages, it looked like
ehci_hcd incremented the bus number for the drive each time it was
plugged in, so on subsequent tries, the logical device didn't map to
the right device node.

Apologies if this idea is off-base. It was just an idea, and I
realize that I have RHEL4 and not Ubuntu.

Thanks,
Bill
> ===================================================http://www.hamrick.com/vuescan/vuescan.htm#linux

bbneo

unread,
Sep 11, 2010, 5:04:35 PM9/11/10
to Akron Linux Users Group
Bill,
Thanks for your comments. The machine I am trying to use the scanner
on is Ubuntu, and apparently doesn't have that file structure, but I
will try to hunt up some on system documents.

Your comment about the USB hard drives is interesting, because I have
a fedora 11 system on which I use a WD usb external hdd for backups.
I usually connect the drive to the machine, do an rsync and then
unmount and disconnect the drive, but something happened to the drive
recently, and now whenever I mount it, instead of mounting as "/media/
WD-1Gb", I have a second "/media/WD-1Gb_" mount name, and that second
name is the one that I have to use to access the drive. The first one
shows me nothing.

I did have to rebuild the backup about a month ago after something
happened to it, but I also have a second backup drive that I rsync
with the first periodically and try to keep in a waterproof firebox in
another part of the house.

Brad

I have been working all day packing up my home office for an upcoming
move, so I didn't get to go down to LinuxFest... I really would have
loved to hear some of the talks about security, SELinux and the
medical applications, but I did listen to a Linux Link Tech Show
Podcast and heard an interesting discussion about the Sugar operating
system for education. Sounds really cool. Part of the One Laptop Per
Child project... they also have a "Live" version which can boot/run
from a usb drive and so a student can just take their own Sugar
desktop anywhere they go.

admf...@gmail.com

unread,
Sep 11, 2010, 5:15:17 PM9/11/10
to Akron Linux Users Group, bbneo
> Your comment about the USB hard drives is interesting, because I have
> a fedora 11 system on which I use a WD usb external hdd for backups.
> I usually connect the drive to the machine, do an rsync and then
> unmount and disconnect the drive, but something happened to the drive
> recently, and now whenever I mount it, instead of mounting as "/media/
> WD-1Gb", I have a second "/media/WD-1Gb_" mount name, and that second
> name is the one that I have to use to access the drive. The first one
> shows me nothing.

Check your fstab for an /media/WD-1Gb, the usb subsystem for mounding
drives seems to go through these gyrations every so often. I would have
the trouble every once in a while.
also double check your boot drive and make sure is isnt having any trouble.

stevea

unread,
Sep 13, 2010, 4:02:10 PM9/13/10
to Bill Mayhew, Akron Linux Users Group

For consistency ....

modprobe -r ehci_hcd
modprobe -a ehci_hcd

insmod and rmmod are a little different than modprobe in some corner
cases, maybe deprecated.

-S

Bill Mayhew

unread,
Sep 14, 2010, 9:36:40 AM9/14/10
to Akron Linux Users Group
The ubuntu 10.10 man page http://manpages.ubuntu.com/manpages/maverick/man8/rmmod.8.html
does not indicate rmmod is, "deprecated." There is the suggestion,
"Most users will want to use modprobe(8) with the -r option
instead."

Corner case: some administration and rc scripts, and installation
programs would need to be updated if rmmod were taken out of the
distribution.

Either modprobe or rmmod is fine for this application; use your
favorite.
> ...
>
> read more »- Hide quoted text -
>
> - Show quoted text -

stevea

unread,
Sep 18, 2010, 2:35:38 PM9/18/10
to Bill Mayhew, Akron Linux Users Group
Eh - not so fast. modprobe handles module dependencies and options.
The options are only useful on module loads (insmod or modprobe -a) but
the dependencies are important for module removal. The module may
refuse to unload w/ rmmod whereas is could succeed w/ modprobe -r.

Also you can't count in the man pages to announce deprecated code.
ifconfig and route have been deprecated for years, but few end user know
how to use 'ip' and 'tc'.

People using out-of-date, inappropriate or suboptimal calls in legacy
scripts isn't a corner case - it's part of the reality of code
evolution. That's why you should code defensively - using modprobe
instead of insmod & rmmod,and ip instead of ifconfig & route in scripts.

-S

Reply all
Reply to author
Forward
0 new messages