D&C Lug - Home Page
Devon & Cornwall Linux Users' Group

[ Date Index ][ Thread Index ]
[ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Sane - Anyone got any hints?



Simon Avery wrote:
Hi

This one's been nagging at me for a while, since I moved over completely to Fedora c2. Got all my hardware working EXCEPT for a scanner.

I have three scanners, 1 has no PSU, the other is a Mustek parrallel driven one that Sane's drivers say doesn't work - but the third is a HP Scanjet 4100c usb, which IS supported in Sane. It also works perfectly under XP.

Except it don't work!

sane-find-scanner reports it correctly.
scanimage -L calls it by its rightful name

xsane or xscanimage both segfault, or hang or timeout.

I've tried lots of things, changing ports, checking it again, even replacing the motherboard (including going from Via chipset to SIS), gone from 2.6.5.1:358 to 2.6.8.1:521 (both binary kernels - I've rolled my own before and can't see any real advantage) but nothing's working.

Fedora doesn't have modconf, and none of the FAQ's regarding sane appear to be particularly useful with regard to Fedora (files in wrong places, kernel wrong, etc)

Has anyone successfully setup a usb scanner with Sane? If so, any fairly basic directions please? (The docs and howtos don't give you enough information for me to get my head around exactly what is supposed to be happening)

Or, is there any other workable scanner systems for linux that aren't sane based?

I can't even dual-boot back into XP to scan now, because the mobo upgrade means XP reboots before it even gets to gui, even in safe mode and I don't really want to reinstall it, then have to redo the Grub MBR after XP has tramped its very heavy feet over it. (Fedora auto-detected and setup all the new hardware straight away, btw.)

Thanks for any hints. :)

--
The Mailing List for the Devon & Cornwall LUG
Mail majordomo@xxxxxxxxxxxx with "unsubscribe list" in the
message body to unsubscribe.

I would suggest the hotplugging is awry.
Have a look at the attachement. I used it to set up my
Medion USB scanner which, at the time I bought it, wasn't
listed as working under Sane.
You'll have to change the vendor and model ID of course
but the overall method shouldn't be significantly
different for your scanner.

Keith

--
A Linux System
SuSE 9.0 on ECS KS5A/XP with 1.2GHz Athlon, 384MB RAM, 20GB Maxtor HD
and using Mozilla-Thunderbird
Title: Installation
"); //--> "); //--> Click Here!

SANE Backend for the scanners

Artec?E+?48U Tevion?MD9693 Medion?MD9693 Medion?MD9705 Umax?AstraSlim?SE
Memorex?Mem?48u Medion?MD4394 Microstar?MR?9791 Trust?Easy?Webscan?19200
Home
??-?Overview
??-?Stage?of?development
??-?Supported?scanners
??-?Credits
Installation
Download
Example
Calibration
The installation instructions are also included in the source package (PDF format; tevion9693usb_install.pdf).

Installation

Depending on your kernel version, different steps might be required to get the scanner working. The following description is only valid for Linux systems. I presume, that the kernel supports USB.

1. First of all, check your kernel version:

:~> uname -a
This will return something like:

Linux linux 2.4.17 #1 Mon Feb 18 10:56:08 CET 2002 i686 unknown

If the version is >= 2.4.12, then you do not need libusb and can continue with 3.

2. Install libusb

If the kernel version is smaller than 2.4.12, then check, whether libusb is installed already:

:~> libusb-config --version

If this returns a version smaller than 0.1.6a or an error like "command not found", an update is required. If libusb was installed as RPM, remove it before you continue. Now get version 0.1.6a from http://libusb.sf.net and install it.
Libusb should also work with kernel version 2.2.17 (or higher).

3. Remove already installed SANE RPMs

Either use your preferred package manager to find and de-install existing SANE RPMs or do the following:

:~> rpm -qa | grep sane

The result will look like (if installed):

:~> sane-1.0.8-12

and perhaps

:~> sane-devel-1.0.8-12

Now remove SANE RPMs (as root):

# rpm -e sane-1.0.8-12

and perhaps

# rpm -e sane-devel-1.0.8-12

4. Get a SANE source package (version >= 1.0.10) and unpack it

:~> tar -zxvf sane-backends-1.0.x.tar.gz

You now have a directory sane-backends-1.0.x.

Change to the toplevel directory (sane-backend-1.0.x) and run

:~> configure
:~> make
# make install (as root)

6. Modify modules.conf (scanner module only)

If you are using the scanner module (and not libusb), then add the line

options?scanner?vendor=0x05d8?product=0x4003

to /etc/modules.conf.
After this modification, run

# depmod -a

Remove and reload the scanner module with the commands

# modprobe -r scanner and
# modprobe scanner.



7. Setup libusb (only neccessary, if you can't use the scanner module)

Add the line

none /proc/bus/usb usbdevfs defaults 0 0

to /etc/fstab, if it isn't there already. To mount the filesystem, run

# mount -a

or re-boot your system.

7.1. Set the permissions for the device files

After you have mounted the usbdevfs like described before, you will notice, that you can't scan as a normal user, because the permissions are set to 0644 (owner root). This simply means, that only root has read and write access. You now have two possibilities to enable access for normal users:

7.1.1 Mount the device filesystem with devmode=0666

Add a line like this to /etc/fstab (instead of the line mentioned under 7.)

none /proc/bus/usb usbdevfs defaults,devmode=0666 0 0

Now all users are allowed to access all usb devices. Please note, that this won't work with all kernel versions, just try it. This method probably is acceptable for a single user system, but many people need a better control of access permissions.

7.1.2 Use the hotplug utilities

Download and install the hotplug utilities. It's possible, that your system has support for hotplugging already; check whether there's a directory /etc/hotplug. E.g. on a SuSE 7.3 system, one would enable hotplugging by modifying the configuration file with YaST and setting HOTPLUG_START_USB and START_HOTPLUG to "yes". Please read the documentation that ships with your distribution and/or the one included in the hotplug-package.
After you have installed the hotplug utilities, there should be a file /etc/hotplug/usb.usermap. Add the following line to this file:

tevion9693usb 0x0003 0x05D8 0x4003 0x0000 0x0000 0x00 0x00 0x00

(If you are using a scanner with a different product id, you have to change the line accordingly, e.g. for the Trust Easy Webscan 19200, use 0x4006 instead of 0x4003). Whenever you plug in your scanner now, the script /etc/hotplug/usb/tevion9693usb gets executed. Therefore create a script with the following contents:

#!/bin/bash

if [ "$ACTION" = add ] && [ -f "$DEVICE" ]; then
chown .scanner "$DEVICE"
chmod ug+rw "$DEVICE"
fi

Save it as /etc/hotplug/usb/tevion9693usb. Set the permissions correctly:

# chmod 744 /etc/hotplug/usb/tevion9693usb

This script changes the group to scanner and makes it read-/writeable for the owner (root) and members of the group scanner. Now create a group named scanner and add all users, that should have access to the scanner to this group.

Notes:


-A kernel version >= 2.4.12 is required for the kernel access method (scanner module).

-You must add the path to the firmware file (for my scanner, it's called Artec48.usb) to tevion9693usb.conf. You can find this file on the installation CD shipping with your scanner. It's located in the directories WinXXX (e.g. Win98). If Windows is installed on your computer, then you can also find the firmware file under c:\windows\system32\drivers .

Without this file, the backend won't work !

-If you want to access your scanner through libusb, the scanner module may not be loaded.

-For access through the scanner module, make sure that the permissions of the device files are set correctly, e.g.

# chgrp scanner /dev/usb/scanner0

# chmod 660 /dev/usb/scanner0

If there's no file like /dev/usb/scanner0 or /dev/usbscanner0, then you can create one by running the command:

mknod /dev/usbscanner0 c 180 48 or

mknod /dev/usb/scanner0 c 180 48

-If you get it installed, then please be careful when you do the first scan. Select a small region in 100dpi/8bit and keep the scanner cover open. If something goes wrong, pull the plug immediately !

-If you don't adjust the gamma settings, the results are quite dark. Try an overall gamma value of about 1.5 to 1.7. You can adjust the default gamma-values in tevion9693usb.conf.


Lynx friendly