Difference between revisions of "SANE"
m (Updated information section) |
(First major overhaul, did not check that installation works) |
||
Line 1: | Line 1: | ||
{{Languages|SANE}} | {{Languages|SANE}} | ||
− | + | ==Information== | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
For more information on SANE have a look at the [http://www.sane-project.org/ SANE project website] | For more information on SANE have a look at the [http://www.sane-project.org/ SANE project website] | ||
− | + | ===Supported scanners=== | |
For a list of supported scanners have a look at [http://www.sane-project.org/sane-supported-devices.html this page]. | For a list of supported scanners have a look at [http://www.sane-project.org/sane-supported-devices.html this page]. | ||
− | === Installation=== | + | ==Server== |
− | To install SANE login to the SME Server shell as root and issue the following command: | + | This is the installation of the server part, you will also need to install drivers on your clients as described in the [[#Client|Client]] section. |
− | yum install sane-backends | + | ===Installation=== |
− | After succesfull | + | ====Installing required packages==== |
+ | To install SANE and xinetd (required for running it unattended) login to the SME Server shell as root and issue the following command: | ||
+ | yum install sane-backends xinetd | ||
+ | |||
+ | After succesfull of the required packages issue the following commands: | ||
signal-event post-upgrade | signal-event post-upgrade | ||
signal-event reboot | signal-event reboot | ||
− | + | ====Testing the installation==== | |
− | ==== Finding your scanner ==== | + | =====Finding your scanner===== |
After installation and reboot you should be able to find your scanner with the following command: | After installation and reboot you should be able to find your scanner with the following command: | ||
− | + | sane-find-scanner | |
The output should look like this: | The output should look like this: | ||
Line 42: | Line 38: | ||
# can't be detected by this program. | # can't be detected by this program. | ||
− | ==== Determining assigned driver ==== | + | =====Determining assigned driver===== |
To see which hardware location is assigned to the scanner issue the following command: | To see which hardware location is assigned to the scanner issue the following command: | ||
− | + | scanimage -L | |
The output should look something like this: | The output should look something like this: | ||
Line 51: | Line 47: | ||
device `plustek:libusb:001:002' is a Epson Perfection 1250/Photo USB flatbed scanner | device `plustek:libusb:001:002' is a Epson Perfection 1250/Photo USB flatbed scanner | ||
− | + | =====Aquisition===== | |
− | + | To make a test scan you can issue the following command specifying the driver you determined in [[#Determining assigned driver|Determining assigned driver]]. | |
− | |||
− | |||
− | |||
− | To make a test scan you can issue the following command specifying the driver you determined in [ | ||
scanimage -d drivername --format tiff -l 0 -t 0 -x 215 -y 297 > outfile.tiff | scanimage -d drivername --format tiff -l 0 -t 0 -x 215 -y 297 > outfile.tiff | ||
− | Replace drivername with the driver determined in [ | + | Replace drivername with the driver determined in [[#Determining assigned driver|Determining assigned driver]], e.g.: |
scanimage -d plustek:libusb:001:002 --format tiff -l 0 -t 0 -x 215 -y 297 > outfile.tiff | scanimage -d plustek:libusb:001:002 --format tiff -l 0 -t 0 -x 215 -y 297 > outfile.tiff | ||
− | === | + | ====Configuring xinetd to run SANE unattended==== |
+ | After succesfull installation and testing it is time to configure xinetd so SANE will run as a service on your server. | ||
+ | |||
+ | <ol> | ||
+ | <li>Create a group using the server-manager of your SME Server to hold the users that will be allowed to use the scanner application. In this instruction it is assumed that the group will be called saneusers.</li> | ||
+ | <li>One of the first steps we need to do is to add a entry to the internal configuration database to hold the configuration parameters of the saned service daemon with the following commands: | ||
+ | <pre>db configuration set saned service | ||
+ | db configuration setprop saned TCPPort 6566 | ||
+ | db configuration setprop saned status enabled</pre> | ||
+ | <!---db configuration setprop saned access private---> | ||
+ | </li> | ||
+ | <li>Create a custom template fragment by issuing the following commands: | ||
+ | <pre>mkdir -p /etc/e-smith/templates-custom/etc/xinetd.conf/</pre> | ||
+ | <pre>nano /etc/e-smith/templates-custom/etc/xinetd.conf/30sane</pre> | ||
+ | |||
+ | Copy the following section in this file: | ||
+ | <pre> | ||
+ | { | ||
− | + | $OUT = <<HERE; | |
− | + | service sane | |
+ | { | ||
+ | port = 6566 | ||
+ | socket_type = stream | ||
+ | protocol = tcp | ||
+ | user = root | ||
+ | group = saned | ||
+ | wait = no | ||
+ | server = /usr/sbin/saned | ||
+ | } | ||
+ | HERE | ||
+ | } | ||
+ | </pre> | ||
− | + | Expand the configuration file: | |
+ | <pre>expand-template /etc/xinetd.conf</pre> | ||
+ | </li> | ||
+ | <li>We also allow all systems on the network to be able to access the service, this is done by adding another template, with the following commands: | ||
+ | <pre>mkdir -p /etc/e-smith/templates-custom/etc/hosts.allow | ||
+ | nano /etc/e-smith/templates-custom/etc/hosts.allow/sane</pre> | ||
+ | |||
+ | Copy the following section into the file: | ||
+ | <pre> | ||
+ | { | ||
+ | $DB->hosts_allow_spec('saned'); | ||
+ | } | ||
+ | </pre> | ||
+ | Expand the configuration file: | ||
+ | <pre>expand-template /etc/hosts.allow</pre> | ||
+ | </li> | ||
+ | <li> | ||
+ | Now we need to configure the service using the following commands: | ||
+ | <pre>mkdir -p /etc/e-smith/templates-custom/etc/services/ | ||
+ | nano /etc/e-smith/templates-custom/etc/services/saned</pre> | ||
+ | |||
+ | Add the following line to the file: | ||
+ | <pre>sane { ${'saned'}{TCPPort} }/tcp # SANE network scanner daemon</pre> | ||
+ | Expand the configuration file: | ||
+ | <pre>expand-template /etc/xinetd.conf</pre> | ||
+ | </li> | ||
+ | <li>Make a link to allow xinetd to start during the server startup: | ||
+ | <pre>ln -s /etc/init.d/xinetd /etc/rc.d/rc7.d/S50xinetd</pre> | ||
+ | </li> | ||
+ | <li>Now we can start the server with the following command: | ||
+ | <pre>/etc/init.d/xinetd restart</pre> | ||
+ | </li> | ||
+ | </ol> | ||
+ | |||
+ | === Uninstall === | ||
+ | You can remove SANE from your SME Server with the following command | ||
+ | yum remove sane-backends | ||
+ | <!--- | ||
+ | ====Determine scanner resolution==== | ||
+ | |||
+ | scanimage --help | grep -m 1 resolution | ||
− | |||
=== Adding your scanner to the network === | === Adding your scanner to the network === | ||
saned is the SANE daemon. It gives an access to the image acquisition device available on the local host to remote clients. | saned is the SANE daemon. It gives an access to the image acquisition device available on the local host to remote clients. | ||
− | |||
− | |||
====Updating of /etc/hosts.allow for sane==== | ====Updating of /etc/hosts.allow for sane==== | ||
Line 85: | Line 143: | ||
Make in /etc/ hosts.allow a line with template-custom | Make in /etc/ hosts.allow a line with template-custom | ||
− | + | mkdir -p /etc/e-smith/templates-custom/etc/hosts.allow/ | |
− | |||
− | + | nano /etc/e-smith/templates-custom/etc/hosts.allow/saned | |
=> | => | ||
saned: 127.0.0.1 10.97.1.0/255.255.255.0 | saned: 127.0.0.1 10.97.1.0/255.255.255.0 | ||
Line 95: | Line 152: | ||
/sbin/e-smith/expand-template /etc/hosts.allow | /sbin/e-smith/expand-template /etc/hosts.allow | ||
− | |||
− | |||
====Updating of /etc/services for sane==== | ====Updating of /etc/services for sane==== | ||
Line 102: | Line 157: | ||
Make in /etc/services a line with template-custom | Make in /etc/services a line with template-custom | ||
− | mkdir /etc/e-smith/templates-custom/etc/services/ | + | mkdir -p /etc/e-smith/templates-custom/etc/services/ |
nano /etc/e-smith/templates-custom/etc/services/saned | nano /etc/e-smith/templates-custom/etc/services/saned | ||
Line 108: | Line 163: | ||
sane 6566/tcp # SANE network scanner daemon | sane 6566/tcp # SANE network scanner daemon | ||
− | + | expand-template /etc/services | |
− | |||
− | |||
====Add the IP addresses of the computers which are authorized to use the scanner==== | ====Add the IP addresses of the computers which are authorized to use the scanner==== | ||
Line 119: | Line 172: | ||
adress-ip_customer1 | adress-ip_customer1 | ||
adress_ip_customer2 | adress_ip_customer2 | ||
+ | ---> | ||
+ | ==Client== | ||
− | + | ===Windows=== | |
− | |||
− | |||
− | === | ||
− | |||
− | |||
http://sanetwain.ozuzo.net/ | http://sanetwain.ozuzo.net/ | ||
Line 134: | Line 184: | ||
setup127.exe | setup127.exe | ||
− | ==== | + | ====Configuration==== |
- index connection | - index connection | ||
Line 155: | Line 205: | ||
SANE TWAIN drivers have many possibilities. SANE TWAIN drivers can be used alone or called from another application (photoshop, acrobat, ...) like a classical usb scanner. | SANE TWAIN drivers have many possibilities. SANE TWAIN drivers can be used alone or called from another application (photoshop, acrobat, ...) like a classical usb scanner. | ||
− | + | ====Testing==== | |
− | |||
− | |||
− | === | ||
Start a terminal on your server (with putty for example). | Start a terminal on your server (with putty for example). | ||
Line 188: | Line 235: | ||
Restart ' saned - d128 ' on the terminal and open Scanimage one more time, it should scan! | Restart ' saned - d128 ' on the terminal and open Scanimage one more time, it should scan! | ||
Lines are displayed on the terminal with putty. (type -d for debug mode) | Lines are displayed on the terminal with putty. (type -d for debug mode) | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
The first time, I didn’t succeed to use the scanner on my windows computer when using sanetwain | The first time, I didn’t succeed to use the scanner on my windows computer when using sanetwain | ||
Line 243: | Line 244: | ||
I put in comment (# in front of the line) all lines which did not correspond to my driver. | I put in comment (# in front of the line) all lines which did not correspond to my driver. | ||
− | + | ===MacOS X=== | |
− | + | {{Incomplete}} | |
− | === | + | SANE can also be installed on MacOS X, for more information have a look at |
− | + | http://www.ellert.se/twain-sane/. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | If you get things working on MacOS X please provide installation instructions here. | |
− | + | ===Linux=== | |
+ | To use SANE on your linux PC you need to install the xsane package. | ||
− | It’s enough to configure xsane so that it | + | It’s enough to configure xsane so that it knows where to find the server with the scanner attached by adding the line with the IP address of your server to /etc/sane.d/net.conf on your client PC |
− | |||
− | |||
− | |||
− | |||
− | You can use xsane or make the acquisition from | + | You can use xsane or make the acquisition from other software for instance OpenOffice or GIMP. |
Revision as of 21:47, 31 March 2008
Information
For more information on SANE have a look at the SANE project website
Supported scanners
For a list of supported scanners have a look at this page.
Server
This is the installation of the server part, you will also need to install drivers on your clients as described in the Client section.
Installation
Installing required packages
To install SANE and xinetd (required for running it unattended) login to the SME Server shell as root and issue the following command:
yum install sane-backends xinetd
After succesfull of the required packages issue the following commands:
signal-event post-upgrade signal-event reboot
Testing the installation
Finding your scanner
After installation and reboot you should be able to find your scanner with the following command:
sane-find-scanner
The output should look like this:
# No SCSI scanners found. If you expected something different, make sure that # you have loaded a SCSI driver for your SCSI adapter. # Also you need support for SCSI Generic (sg) in your operating system. # If using Linux, try "modprobe sg". found USB scanner (vendor=0x04b8 [EPSON], product=0x010f [EPSON Scanner 010F], chip=LM9832/3) at libusb:001:002 # Your USB scanner was (probably) detected. It may or may not be supported by # SANE. Try scanimage -L and read the backend's manpage. # Not checking for parallel port scanners. # Most Scanners connected to the parallel port or other proprietary ports # can't be detected by this program.
Determining assigned driver
To see which hardware location is assigned to the scanner issue the following command:
scanimage -L
The output should look something like this:
device `plustek:libusb:001:002' is a Epson Perfection 1250/Photo USB flatbed scanner
Aquisition
To make a test scan you can issue the following command specifying the driver you determined in Determining assigned driver.
scanimage -d drivername --format tiff -l 0 -t 0 -x 215 -y 297 > outfile.tiff
Replace drivername with the driver determined in Determining assigned driver, e.g.:
scanimage -d plustek:libusb:001:002 --format tiff -l 0 -t 0 -x 215 -y 297 > outfile.tiff
Configuring xinetd to run SANE unattended
After succesfull installation and testing it is time to configure xinetd so SANE will run as a service on your server.
- Create a group using the server-manager of your SME Server to hold the users that will be allowed to use the scanner application. In this instruction it is assumed that the group will be called saneusers.
- One of the first steps we need to do is to add a entry to the internal configuration database to hold the configuration parameters of the saned service daemon with the following commands:
db configuration set saned service db configuration setprop saned TCPPort 6566 db configuration setprop saned status enabled
- Create a custom template fragment by issuing the following commands:
mkdir -p /etc/e-smith/templates-custom/etc/xinetd.conf/
nano /etc/e-smith/templates-custom/etc/xinetd.conf/30sane
Copy the following section in this file:
{ $OUT = <<HERE; service sane { port = 6566 socket_type = stream protocol = tcp user = root group = saned wait = no server = /usr/sbin/saned } HERE }
Expand the configuration file:
expand-template /etc/xinetd.conf
- We also allow all systems on the network to be able to access the service, this is done by adding another template, with the following commands:
mkdir -p /etc/e-smith/templates-custom/etc/hosts.allow nano /etc/e-smith/templates-custom/etc/hosts.allow/sane
Copy the following section into the file:
{ $DB->hosts_allow_spec('saned'); }
Expand the configuration file:
expand-template /etc/hosts.allow
-
Now we need to configure the service using the following commands:
mkdir -p /etc/e-smith/templates-custom/etc/services/ nano /etc/e-smith/templates-custom/etc/services/saned
Add the following line to the file:
sane { ${'saned'}{TCPPort} }/tcp # SANE network scanner daemon
Expand the configuration file:
expand-template /etc/xinetd.conf
- Make a link to allow xinetd to start during the server startup:
ln -s /etc/init.d/xinetd /etc/rc.d/rc7.d/S50xinetd
- Now we can start the server with the following command:
/etc/init.d/xinetd restart
Uninstall
You can remove SANE from your SME Server with the following command
yum remove sane-backends
Client
Windows
In download section, take the ZIPfile (sanetwain127.zip or Windowsinstaller (setup127.exe)
make :
setup127.exe
Configuration
- index connection Hostname => address ip server Port => 6566 Username => user’s name
I made : Get list of devices on startup
- index printer I made : Show printer setup dialog before print (I have several printers!)
- index Startup I made : Acquire preview on program start Use as interface language => fr
Usage
SANE TWAIN drivers have many possibilities. SANE TWAIN drivers can be used alone or called from another application (photoshop, acrobat, ...) like a classical usb scanner.
Testing
Start a terminal on your server (with putty for example). make :
saned -d128
example
# saned -d128 [saned] main: starting debug mode (level 128) [saned] main: trying to get port for service `sane-port' (getaddrinfo) [saned] main: "sane-port" service unknown on your host; you should add [saned] main: sane-port 6566/tcp saned # SANE network scanner daemon [saned] main: to your /etc/services file (or equivalent). Proceeding anyway. [saned] main: [0] socket () using IPv4 [saned] main: [0] setsockopt () [saned] main: [0] bind () to port 6566 [saned] main: [0] listen () [saned] main: [1] socket () using IPv6 [saned] main: [1] socket failed: Address family not supported by protocol [saned] main: waiting for control connection
If you have “waiting for control connection “, all sounds good. Now on your windows computer, open Scanimage (name of gui software for sanetwain)
The scanner should start and lines should appear in the terminal (putty)
On the first connection, it often takes a long time and a message like this can appear: Time out reading word from socket Close Scanimage... saned must close up under putty (else ctrl+C to close saned and to come back to the prompt)
Restart ' saned - d128 ' on the terminal and open Scanimage one more time, it should scan! Lines are displayed on the terminal with putty. (type -d for debug mode)
The first time, I didn’t succeed to use the scanner on my windows computer when using sanetwain
=> outdated delay of wait..
I resolved problem by changing the file /etc/sane.d/dll.conf
I put in comment (# in front of the line) all lines which did not correspond to my driver.
MacOS X
SANE can also be installed on MacOS X, for more information have a look at http://www.ellert.se/twain-sane/.
If you get things working on MacOS X please provide installation instructions here.
Linux
To use SANE on your linux PC you need to install the xsane package.
It’s enough to configure xsane so that it knows where to find the server with the scanner attached by adding the line with the IP address of your server to /etc/sane.d/net.conf on your client PC
You can use xsane or make the acquisition from other software for instance OpenOffice or GIMP.