Changes

Jump to navigation Jump to search
2,500 bytes removed ,  12:57, 9 August 2017
no edit summary
Line 1: Line 1:  
{{Languages|SANE}}
 
{{Languages|SANE}}
 +
 
==Information==
 
==Information==
 +
SANE stands for "Scanner Access Now Easy" and is an application programming interface (API) that provides standardized access to any raster image scanner hardware (flatbed scanner, hand-held scanner, video- and still-cameras, frame-grabbers, etc.)
 +
{{#smeversion:smeserver-sane}}
 
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===
 
===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].
 +
 +
Note the SME 8 rpm uses [http://www.sane-project.org/sane-backends-1.0.18.html this page]
 +
 +
Note the SME 9 rpm uses [http://www.sane-project.org/sane-backends-1.0.21.html this page]
    
==Server==
 
==Server==
 
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.
 
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.
 +
 
===Installation===
 
===Installation===
====Installing required packages====
+
==== SME 8.X, 9.X====
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:
+
Install SANE and required packages
  signal-event post-upgrade
+
 
signal-event reboot
+
yum --enablerepo=smecontribs install  smeserver-sane
 +
 
 +
==== Finish the installation ====
 +
 
 +
then
 +
expand-template /etc/xinetd.conf
 +
expand-template /etc/services
 +
expand-template /etc/hosts.allow
 +
expand-template /etc/sane.d/saned.conf
 +
 +
service xinetd restart
 +
 
 +
or if you prefer to restart your server
 +
 
 +
  signal-event post-upgrade; signal-event reboot
    
====Testing the installation====
 
====Testing the installation====
Line 56: Line 77:     
  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 saned.</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 sane-port service
  −
db configuration setprop sane-port TCPPort 6566
  −
db configuration setprop sane-port status enabled</pre>
  −
<!---db configuration setprop sane-port 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
  −
{
  −
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-port      { ${'sane-port'}{TCPPort} }/tcp              # SANE network scanner daemon</pre>
  −
Expand the configuration file:
  −
<pre>expand-template /etc/services</pre>
  −
</li>
  −
<li>
  −
Now we need to configure saned.conf using the following commands:
  −
<pre>nano /etc/sane.d/saned.conf</pre>
  −
Add the following lines to the file:
  −
<pre>localhost
  −
adresse-ip_client1
  −
adresse_ip_client2</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 ===  
 
=== Uninstall ===  
 
You can remove SANE from your SME Server with the following command
 
You can remove SANE from your SME Server with the following command
  yum remove sane-backends  
+
  rpm -e sane-backends sane-backends-libs  smeserver-sane
<!---
  −
====Determine scanner resolution====
     −
scanimage --help | grep -m 1 resolution
+
==Client==
    +
===Windows XP and Vista===
   −
=== Adding your scanner to the network ===
+
http://sanetwain.ozuzo.net/
   −
saned is the SANE daemon. It gives an access to the image acquisition device available on the local host to remote clients.
+
In download section, take the ZIP file (sanetwain127.zip and Windowsinstaller (setup127.exe)
   −
====Updating of /etc/hosts.allow for sane====  
+
====Configuration====
   −
Make in /etc/ hosts.allow a line with template-custom
+
- index connection
 +
:Hostname  => address ip server
 +
:Port => 6566
 +
:Username => user’s name
   −
mkdir -p /etc/e-smith/templates-custom/etc/hosts.allow/
+
I made : Get list of devices on startup
   −
nano /etc/e-smith/templates-custom/etc/hosts.allow/saned
+
- index printer
  =>
+
:I made : Show printer setup dialog before print
  saned: 127.0.0.1 10.97.1.0/255.255.255.0
+
:(I have several printers!)
   −
(10.97.1.0 => your ip)
+
- index Startup
 +
:I made : Acquire preview on program start
 +
:Use as interface language => fr
   −
  /sbin/e-smith/expand-template /etc/hosts.allow
+
====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.  
   −
====Updating of /etc/services for sane====
+
===MacOS X===
 +
SANE can also be installed on MacOS X, for more information have a look at
 +
http://www.ellert.se/twain-sane/.
   −
Make in /etc/services a line with template-custom
+
If you get things working on MacOS X please provide installation instructions here.
   −
  mkdir -p /etc/e-smith/templates-custom/etc/services/
+
===Linux===
 
+
To use SANE on your linux PC you need to install the xsane package.  
  nano /etc/e-smith/templates-custom/etc/services/saned
  −
  =>
  −
  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====  
  −
 
  −
  nano /etc/sane.d/saned.conf
  −
  =>
  −
  localhost
  −
  adress-ip_customer1
  −
  adress_ip_customer2
  −
--->
  −
==Client==
  −
 
  −
===Windows XP===
  −
 
  −
http://sanetwain.ozuzo.net/
  −
 
  −
In download section, take  the ZIPfile (sanetwain127.zip or Windowsinstaller (setup127.exe)
  −
 
  −
make :
  −
  setup127.exe
      
====Configuration====
 
====Configuration====
 +
Then configure xsane so that it knows where to find the server with the scanner attached, add a line with the IP address of your server to /etc/sane.d/net.conf on your client PC
   −
- index connection
+
  nano -w /etc/sane.d/net.conf
Hostname  => address ip server
+
   
Port => 6566
+
  IP_address_of_your_server
Username => user’s name
     −
I made : Get list of devices on startup
+
====Usage====
   −
- index printer
+
You can use kooka or xsane or make the acquisition from other software for instance OpenOffice or GIMP.
I made : Show printer setup dialog before print
  −
(I have several printers!)
     −
- index Startup
+
===Client Troubleshooting===
I made : Acquire preview on program start
+
{{Incomplete}}
Use as interface language => fr
+
Only needed if your client can't find the scanner
 
  −
====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====
+
Disable saned
 +
/etc/init.d/xinetd stop
 +
or
 +
config setprop saned status disabled
 +
/sbin/e-smith/expand-template /etc/xinetd.conf
 +
/etc/init.d/xinetd restart
   −
Start a terminal on your server (with putty for example).  
+
Start a terminal on your server.  
make :
+
saned -d128  
  saned -d128  
      
example
 
example
 
   # saned -d128  
 
   # saned -d128  
 
   [saned] main: starting debug mode (level 128)  
 
   [saned] main: starting debug mode (level 128)  
   [saned] main: trying to get port for service `sane-port' (getaddrinfo)  
+
   [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] socket () using IPv4  
 
   [saned] main: [0] setsockopt ()  
 
   [saned] main: [0] setsockopt ()  
Line 234: Line 156:  
   [saned] main: waiting for control connection  
 
   [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)  
+
If you have “waiting for control connection “, all sounds good. Now on your scanning software, eg Scanimage (name of gui software for sanetwain)  
   −
The scanner should start and lines should appear in the terminal (putty)
+
The scanner should start and lines should appear in the terminal.
    
On the first connection, it often takes a long time and a message like this can appear: Time out reading word from socket  
 
On the first connection, it often takes a long time and a message like this can appear: Time out reading word from socket  
Line 252: Line 174:  
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===
+
Enable saned when finished
{{Incomplete}}
+
/etc/init.d/xinetd start
SANE can also be installed on MacOS X, for more information have a look at
+
or
http://www.ellert.se/twain-sane/.  
+
config setprop saned status enabled
 
+
/sbin/e-smith/expand-template /etc/xinetd.conf
If you get things working on MacOS X please provide installation instructions here.
+
/etc/init.d/xinetd restart
 
+
=== Bugs ===
===Linux===
+
Please raise bugs under the SME-Contribs section in {{BugzillaFileBug|product=|component=|title=bugzilla}}and select the smeserver-sane component or use {{BugzillaFileBug|product=SME%20Contribs|component=smeserver-sane|title=this link}}.
To use SANE on your linux PC you need to install the xsane package.
+
{{#bugzilla:columns=id,product,version,status,summary |sort=id |order=desc |component=smeserver-sane |noresultsmessage="No open bugs found."}}
 
  −
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.
   
----
 
----
[[Category:Howto]]
+
[[Category:Contrib]]
 +
[[Category:Administration]]
254

edits

Navigation menu