SuSE GmbH

SuSE Support Database

Title: Scanner under Linux

----------

Mainpage o Searchform o History o Versions o Categories o Contents
Deutsch

----------

Scanner under Linux

Applies to

SuSE Linux: Versions since 5.2

Preliminary Remarks

Basic instructions on the integration of a scanner is included in the Handbook since version 5.2


Index

1. Hardware
2. Software
3. Handscanner
4. Installating a SCSI-Scanner
5. Automatically loading a kernel module (for Experts!!)
6. Scanning over a Network


  1. Hardware

    In the mean-time quite a few SCSI models are supported, here's a list:

    • HP Scanjet, HP Scanjet+
    • HP Scanjet II SCSI-Scanner
    • HP Scanjet Familie (3c only)
    • Mustek Paragon 6000CX
    • Epson GT6000
    • Fujitsu SCSI-2 Scanner
    • A4 Tech AC 4096
    • Nikon Coolscan SCSI 35mm film scanner
    • UMAX SCSI Scanner

    There are also drivers available for a few Handscanners although these are not included in SuSE Linux (see below).

    Support for parallel scanners has been limited (last updated: 03-11-1999)
    See http://www.buzzard.org.uk/jonathan/scanners.html for more information.

    For general information on parallel-port programming under Linux see http://www.torque.net/linux-pp.html


  2. Software

    SANE (Scanner Acces Now Easy) is a powerfull software package although the performance is sometimes unreliable.

    SANE, http://www.mostang.com/sane/, also in the SuSE distribution, includes the program xscanimage (see below).
    In order to scan using GIMP you'll need both sane and GIMP from the series gra.

    OCR software is also available.  Under X you can use the program xocr, although it is still in its infancy.  This program is included in the Linux Snapshot CDs.


  3. Handscanners

    Drivers for Handscanners are, until now (SuSE 6.0), not included.  A few drivers can be found on tsx-11.mit.edu under .../ALPHA/scanner, although some are outdated.

    for example you'll find drivers for:

    • Mustek M105 Handscanner
    • Genius 4500 Handscanner
    • Geius GS-B105G
    • Logitech Scanman 32 / 256


  4. Installing a SCSI Scanner

    Install your SCSI scanner so that it can be found under /proc/scsi/scsi.  In the following example a HP Scanjet on a second SCSI controller is configured (The scanner is detected as a processor, which is completely normal.):

     $ cat /proc/scsi/scsi 
    Attached devices: 
    Host: scsi0 Channel: 00 Id: 02 Lun: 00
      Vendor: TOSHIBA  Model: DVD-ROM SD-M1201 Rev: 1R08
      Type:   CD-ROM                           ANSI SCSI revision: 02
    Host: scsi0 Channel: 00 Id: 03 Lun: 00
      Vendor: YAMAHA   Model: CRW4416S         Rev: 1.0f
      Type:   CD-ROM                           ANSI SCSI revision: 02
    Host: scsi1 Channel: 00 Id: 01 Lun: 00
      Vendor: HP       Model: C6270A           Rev: 3828
      Type:   Processor                        ANSI SCSI revision: 02
    
    There must be a "/dev/sg0".  The drive number may be different depending on your hardware setup.  In this case the scanner is the third device detected and therefore has the number /dev/sg2sg is the generic SCSI driver that the scanner software addresses.  This is a char-major 21 and should be loaded as a module.
     $ ls -l /dev/sg*
    crw-------   1 root disk  21,   0 Jul 23 01:05 /dev/sg0
    crw-------   1 root disk  21,   1 Jul 23 01:05 /dev/sg1
    crw-rw----   1 root disk  21,   2 Jul 23 01:05 /dev/sg2
    
     $ ls -l /dev/scanner
    lrwxrwxrwx   1 root root     3 Nov  3 16:59 /dev/scanner -> sg2
    
     $ grep char-major-21 /etc/conf.modules
    alias char-major-21       sg
    
    All of this is pre-installed with SuSE Linux.  You can configure your scanner easily using YaST as soon as your SCSI is configured. Under menu item System Administration --> / Integrate hardware into system --> you can install your scanner.  In the preceeding example you'd choose /dev/sg2, in the background you see which device is detected.  If you accidently choose an SCSI hard drive the data will be irreparably lost!!!
    Essentially YaST sets a symbolic link, "/dev/scanner", to the actual device, in this case "/dev/sg2".

    The hardware is configured, all that is left to do is to add every user that should be able to access the scanner to the group disk as follows:

     $ grep ^disk /etc/group
    disk:x:6:olaf
    
    In this example the user "olaf" can now access the scanner.  After adding a user to a group you'll need to log-out and -in again to actualize the new group permissions.  You can also administer groups with YaST under menu item System Administration --> / Group Administration.
    You should now start GIMP, if this is the first time GIMP will make the directory ~/.gimp-1.1/plug-ins (the version number may be different depending on your software).  In this directory you should make a link to the program xscanimage as follows:
     $ cd ~/.gimp-1.1/plug-ins/
    
     $ ln -s /usr/X11R6/bin/xscanimage
    
     $ ls -l ~/.gimp-1.1/plug-ins/
    total 0
    lrwxrwxrwx 1 olaf  users   25 Okt 27 19:31 xscanimage -> /usr/X11R6/bin/xscanimage
    
    After doing this the GIMP menu item "Xtns" will include the item "Aquire Image -> Device dialog" under which you should choose item "/dev/scanner".  If you should happen to see something about png in this dialog you've done something incorrectly and should start this process again.


  5. Automatically loading the kernel-module (for Experts!)

    Usually the scanner is turned off in the moment you'd like to scan something but the scanner-driver sg.o can be loaded and activated whenever needed by adding changing the file /etc/conf.modules or /etc/modules.conf with the following command:
    post-install sg echo "scsi add-single-device 1 0 1 0" > /proc/scsi/scsi
    
    These values are given in /proc/scsi/scsi (See the example above):
    1 = Host (Starting with 0!)
    0 = Channel
    1 = SCSI ID of the device
    0 = LUN Number
    A selection from: /usr/src/linux/drivers/scsi/scsi.c:
    ...
        /*
         * Usage: echo "scsi add-single-device 0 1 2 3" >/proc/scsi/scsi
         * with  "0 1 2 3" replaced by your "Host Channel Id Lun".
         * Consider this feature BETA.
         *     CAUTION: This is not for hotplugging your peripherals. As
         *     SCSI was not designed for this you could damage your
         *     hardware !
         * However perhaps it is legal to switch on an
         * already connected device. It is perhaps not
         * guaranteed this device doesn't corrupt an ongoing data transfer.
         */
    ...
    
    If you're SCSI Hostadapter driver isn't in your kernel or isn't yet loaded you can add a pre-install command:
    pre-install sg modprobe advansys
    
    When you attempt to scan something sane addresses /dev/scanner which, in turn, loads sg.o. Before this, though, the pre-install command loads the specific SCSI driver, then the generic SCSI driver sg.o. The post-install command then intializes the device after which you can use your scanner.
    In summary, the file modules.conf / modules.conf should include the following (these values are unique for every system, us the actual values for your system.
    pre-install sg modprobe advansys
    alias char-major-21       sg
    post-install sg echo "scsi add-single-device 1 0 1 0" > /proc/scsi/scsi
    


  6. Scanning over a Network

    If you've configured the scanner and the scanstation correctly and you'd rather avoid starting gimp over a network you can install the program saned.  This daemon, using port 6566, connects to the scanner and sends the scanned data directly on the client. Both computers need to have sane installed.

      Configuring a scan server:
    • First you need to add the following lines to the file /etc/services:
       $ grep sane /etc/services 
      # Entry for the sane scan daemon
      sane            6566/tcp        # SANE network scanner daemon
      
    • You can either start saned directly or it can be started as needed by inetd after adding the following lines to the file /etc/inetd.conf:
       $ grep sane /etc/inetd.conf
      # sane scan daemon
      sane stream tcp nowait root /usr/sbin/saned saned
      
    • Next you need to restart inetd:
      su - -c "/sbin/init.d/inetd restart"
      
    • All hostnames that should have permission to access the scanner need to be entered in the file /etc/sane.d/saned.conf.  There are no wildcards or IP-addresses allowed, just the full domainname (comparable to /etc/hosts.lpr).
      The only other possibility is to add a simple + which gives all hosts permission.  If you've second thoughts or worries you can start saned over tcpd with which you can use hosts.allow and hosts.deny to give permission to specific computers. This is explained in the manpage for saned ( man saned ).

      Client configuration:
      On the client-side you need to add the computers hostname to which the scanner is connected.  In the file /etc/saned.d/dll.conf the line "net" needs to be activated or un-uncommented.  This tells the local xscanimage to check for a network scanner.

----------

See also:

----------

Keywords: SCANNER, OCR

----------

Categories: Hardware

----------

Feedback welcome: Send Mail to mb@suse.de (Please give the following subject: SDB-scanner)

----------

Mainpage o Searchform o History o Versions o Categories o Contents
Deutsch

----------

SDB-scanner, Copyright SuSE GmbH, Nuremberg, Germany - Version: 21. Mar 1997
SuSE GmbH - Last generated: 02. Dec 1999 16:02:47 by wimer with sdb_gen 1.00.0