File:  [NetBSD Developer Wiki] / wikisrc / scanner.mdwn
Revision 1.3: download - view: text, annotated - select for diffs
Mon Jun 20 10:55:11 2011 UTC (8 years, 11 months ago) by wiz
Branches: MAIN
CVS tags: HEAD
Wording; finished.

    1: Using Scanners on NetBSD
    2: ========================
    3: 
    4: Setup
    5: -----
    6: 
    7: To connect a USB scanner do:
    8: 
    9: 1. Check if it is supported by SANE:
   10: 
   11:   [SANE:Supported Devices](http://www.sane-project.org/sane-mfgs.html)
   12: 
   13: 2. Make /dev/ugen0 usable through removal of uscanner from the kernel config by commenting it:
   14: 
   15:         # cd /usr/src/sys/arch/i386/conf
   16:         # cp GENERIC GENERIC_UGEN
   17: 
   18:     Comment out the uscanner device:
   19: 
   20:         # vi GENERIC_UGEN
   21: 
   22:     by using '#' so it looks like:
   23: 
   24:         # USB scanners
   25:         # uscanner* at uhub? port ?
   26: 
   27:     Then, continue to config, make and install the new kernel:
   28: 
   29:         # config GENERIC_UGEN
   30:         # cd ../compile/GENERIC_UGEN
   31:         # make depend
   32:         # make
   33:         # cp netbsd /netbsd.ugen
   34:         # cp /netbsd /netbsd.old
   35:         # cp netbsd /netbsd
   36:         # shutdown -r now
   37: 
   38: 3. Add the [SANE](http://www.sane-project.org/) packages to the system:
   39: 
   40:         # cd /usr/pkgsrc/graphics/sane-backend
   41:         # make install
   42:         # cd ../sane-frontend
   43:         # make install
   44:         # cd ../xsane
   45:         # make install
   46: 
   47: 4. Connect the USB scanner and check if it's recognized:
   48: 
   49:         # sane-find-scanner
   50: 
   51:     When the scanner is found, check if it is correctly supported and usable:
   52: 
   53:         # scanimage -L
   54: 
   55:     Some scanners (e.g. the [Epson Perfection 2480](http://wiki.ubuntuusers.de/Epson_Perfection_2480)) need firmware loaded; put the firmware image in some place and add the scanner backend configuration file to point to it.
   56: 
   57:     Scan an image by using the name of appropriate backend found on the SANE supported devices page (usually printed out by sane-find-scanner), for an example:
   58: 
   59:         # scanimage -v -B -d name_of_backend:libusb:/dev/usb0:/dev/ugen0 --format pnm > /tmp/image.pnm
   60: 
   61:     or
   62: 
   63:         # scanimage -v -B -d hp:libusb:/dev/usb0:/dev/ugen0 --format pnm > /tmp/image.pnm
   64: 
   65:     or
   66: 
   67:         # scanimage -v -B -d gt68xx:libusb:/dev/usb0:/dev/ugen0 --format pnm > /tmp/image.pnm
   68: 
   69:     or use an alternative X frontend:
   70: 
   71:         # xsane
   72: 
   73:     To find what options are available, do:
   74: 
   75:         # scanimage --help -d gt68xx:libusb:/dev/usb0:/dev/ugen0
   76: 
   77: User access
   78: -----------
   79: 
   80: To grant another user access to use the scanner, create a 'scanner' group.
   81: 
   82:     # groupadd scanner
   83: 
   84: Add user to the group scanner:
   85: 
   86:     # usermod -G scanner user_name
   87: 
   88: Change group for a device:
   89: 
   90:     # chgrp scanner /dev/ugen*
   91: 
   92: For some drivers, you also need access to the usb bus devices:
   93: 
   94:     # chgrp scanner /dev/usb*
   95: 
   96: Also check if the permissions are sufficient, otherwise also do:
   97: 
   98:     # chmod g+rw /dev/usb* /dev/ugen*
   99: 
  100: Additional features
  101: -------------------
  102: 
  103: To postprocess the images, the [ImageMagick](http://www.imagemagick.org/) package is very useful. For example, to batch-convert some images to black/white, use:
  104: 
  105:     # mkdir ./bw ; for f in *.jpg ; do convert -colorspace gray "$f" "./bw/$f.jpg" ; done

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb