Annotation of wikisrc/scanner.mdwn, revision 1.3
1.1 wiz 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:
1.2 wiz 15: # cd /usr/src/sys/arch/i386/conf
16: # cp GENERIC GENERIC_UGEN
1.1 wiz 17:
18: Comment out the uscanner device:
19:
1.2 wiz 20: # vi GENERIC_UGEN
1.1 wiz 21:
22: by using '#' so it looks like:
23:
24: # USB scanners
1.2 wiz 25: # uscanner* at uhub? port ?
1.1 wiz 26:
27: Then, continue to config, make and install the new kernel:
28:
1.2 wiz 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
1.1 wiz 37:
38: 3. Add the [SANE](http://www.sane-project.org/) packages to the system:
39:
1.2 wiz 40: # cd /usr/pkgsrc/graphics/sane-backend
41: # make install
42: # cd ../sane-frontend
43: # make install
44: # cd ../xsane
45: # make install
1.1 wiz 46:
47: 4. Connect the USB scanner and check if it's recognized:
48:
1.2 wiz 49: # sane-find-scanner
1.1 wiz 50:
51: When the scanner is found, check if it is correctly supported and usable:
52:
1.2 wiz 53: # scanimage -L
1.1 wiz 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:
1.2 wiz 59: # scanimage -v -B -d name_of_backend:libusb:/dev/usb0:/dev/ugen0 --format pnm > /tmp/image.pnm
1.1 wiz 60:
61: or
62:
1.2 wiz 63: # scanimage -v -B -d hp:libusb:/dev/usb0:/dev/ugen0 --format pnm > /tmp/image.pnm
1.1 wiz 64:
65: or
66:
1.2 wiz 67: # scanimage -v -B -d gt68xx:libusb:/dev/usb0:/dev/ugen0 --format pnm > /tmp/image.pnm
1.1 wiz 68:
1.3 ! wiz 69: or use an alternative X frontend:
1.1 wiz 70:
1.2 wiz 71: # xsane
1.1 wiz 72:
73: To find what options are available, do:
74:
1.2 wiz 75: # scanimage --help -d gt68xx:libusb:/dev/usb0:/dev/ugen0
1.1 wiz 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