SANE

From SME Server
Revision as of 03:42, 31 March 2008 by Ecureuil (talk | contribs) (New page: Thank you to jaysee (IXUS) for his patience and help to the SANE's configuration Before installation, go to http://www.sane-project.org/sane-supported-devices.html to see if your scanner...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Thank you to jaysee (IXUS) for his patience and help to the SANE's configuration

Before installation, go to http://www.sane-project.org/sane-supported-devices.html to see if your scanner is supported.

On sme 7.3 the SANE's version is 1.0.14. (I compiled sane-1.0.17 for sme 7.3)

HOWTO install and use a scanner with SME 7.3

Configuration of /etc/yum.conf for that it goes searching the rpms in centos.

Put a 1 for base centos and a 1 for updates centos like this:

 [base]
 enabled=1
 mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
 name=CentOS - os
 gpgcheck=1
 enablegroups=0
 exclude=kernel kernel-smp kernel-xenU mkinitrd mdadm initscripts

 [updates]
 enabled=1
 mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
 name=CentOS - updates
 gpgcheck=1
 enablegroups=0
 exclude=kernel kernel-smp kernel-xenU mkinitrd mdadm initscripts

Installation of sane

 yum install sane-backends 

Test of your scanner (recognition and driver)

 sane-find-scanner 

It searches your scanner.

example

 sane-find-scanner 
 
 # 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. 


 scanimage -L 

it gives you the driver of your scanner if it is acknowledged by sane

example

 scanimage -L 
 device `plustek:libusb:001:002' is a Epson Perfection 1250/Photo USB flatbed scanner 


If a driver is found, you can continue the configuration...

Otherwise make following order to remove the rpm : sane-backends

 yum remove sane-backends 



Test of your scanner: (Your first acquisition)

 scanimage -d plustek:libusb:001:002 --format tiff -l 0 -t 0 -x 215 -y 297 > outfile.tiff 

‘plustek:libusb:001:002’ => to put what was found with the command scanimage -L


you can see the resolution of your scanner with this command

 /usr/bin/scanimage --help | grep -m 1 resolution 

For more informations on sane-backends possibilities:

 man sane

configuration to put the scanner on your network

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

Make in /etc/ hosts.allow a line with template-custom

 mkdir /etc/e-smith/templates-custom/etc 
 mkdir /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 

(10.97.1.0 => your ip)

 /sbin/e-smith/expand-template /etc/hosts.allow 

Updating of /etc/services for sane

Make in /etc/services a line with template-custom

 mkdir /etc/e-smith/templates-custom/etc/services/ 
 nano /etc/e-smith/templates-custom/etc/services/saned 
 =>
 sane 6566/tcp # SANE network scanner daemon 
 /sbin/e-smith/expand-template /etc/services 

Add the ip’s addresses of the computers which are authorized to use the scanner

 nano /etc/sane.d/saned.conf 
 =>
 localhost 
 adress-ip_customer1 
 adress_ip_customer2 



INSTALLATION and CONFIGURATION of SANETWAIN on windows platforms

Installation of SANETWAIN

http://sanetwain.ozuzo.net/

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

UTILISATION

SANETWAIN has many possibilities...

Sanetwain can be used alone or called from another application (photoshop, acrobat, ...) like a classical usb scanner.



First test on network

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)


Now automatize the saned startup

If xinetd is not installed :

 yum install xinetd 

Updating of /etc/xinetd.conf for sane

Make in /etc/xinetd.conf a block with template-custom

 mkdir /etc/e-smith/templates-custom/etc/xinetd.conf/ 

Create a users group where users are going to use the scanner I add a group, saned, with server-manager.

 nano /etc/e-smith/templates-custom/etc/xinetd.conf/20sane-port 
 =>
 { 
 
 $OUT = <<HERE; 
 
 service sane 
 { 
 port = 6566 
 socket_type = stream 
 protocol = tcp 
 user = root 
 group = saned 
 wait = no 
 server = /usr/sbin/saned 
 } 
 HERE 
 } 
 /sbin/e-smith/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
 /etc/init.d/xinetd restart 



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.


With MacOS X plateform

There would also be the possibility to use sane. It has links on the sanetwain site => http://www.ellert.se/twain-sane/ To test... I doesn’t have a mac


With linux platform

It’s necessary to install xsane (already installed on my pc). It’s enough to configure xsane so that it achieves the scanner on the server.

 nano /etc/sane.d/net.conf (sur le pc client) 
 =>
 address-ip_server 

You can use xsane or make the acquisition from a software (openoffice, gimp, ...)