All pastes #924700 Raw Edit

Miscellany

public text v1 · immutable
·published 2008-03-01 16:47 UTC
rendered paste body
Thank you to jaysee for its patience and its help for 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 : 1.0.14. 

HOWTO  installation and use of a scanner wit SME 7.3 

Configuration of /etc/yum.conf so that it goes to research the rpms in contribs 
Take 1 for base centos and  1 for updates centos 

[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 was found, you can continue the configuration... 

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

yum remove sane-backends 

---------------------- 

Test 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 the command

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

For more information on the possibilities of sane-backends : 

man sane

---------------------- 

Now, configuration so that your scanner is approachable on network 

saned is the SANE daemon that allows remote clients to access image acquisition devices       available on the local host.

---------------------- 

Updating of de /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 
------------------------ 

With nano add the ip’s adresses  de tous les postes client utilisant le scanner 

nano /etc/sane.d/saned.conf 

localhost 
adress-ip_customer1 
adress_ip_customer2 

or 

nano /etc/sane.d/saned.conf 

localhost 
+ 

the + accepts everybody
--------------------- 

installation of sanetwain for your windows platforms and configuration 

INSTALLATION of SANETWAIN with windows plateform
http://sanetwain.ozuzo.net/ 
In section Download, recover the ZIPfile (sanetwain127.zip and Windowsinstaller(setup127.exe) 
lancer setup127.exe 

CONFIGURATION : 
onglet connexion 
hôt => adresse ip du serveur qui a le scanner 
Port => 6566 
Utilisatuer => nom_utilisateur 

cocher récupérer les périphériques au démarrage 

onglet imprimante 
j'ai coché paramètrer l'imprimante avant impression 
(j'ai plusieurs imprimantes!) 

onglet Démarrage 
j'ai coché Acquisition de l'aperçu au démarrage 
langue de l'interface => fr 

sanetwain a beaucoup de possibilités... je n'ai pas encore tout testé 

UTILISATION 
On peut utiliser sanetwain seul ou il peut être appelé à partir d'une autre application (photoshop, acrobat, ...) 

----------------------- 

Premier test en réseau : 

Ouvrez un terminal sur votre serveur (avec putty par exemple). 
tapez : 
saned -d128 

# 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 

Sur votre poste client windows, ouvrez Scanimage (nom du logiciel de sanetwain) 

normalement, le scanner devrait se déclencher et des lignes devraient apparaitre dans le terminal (putty) 

Souvent, à la première connection, c'est long et un message apparait : délai d'attente dépassé (ce n'est pas tout à fait ce message, c'est une traduction!) 
Fermez Scanimage... saned doit se fermer sous putty (sinon ctrl+C pour fermer sane et revenir au prompt) 

Relancer 'saned -d128' sur le terminal et ouvrez de nouveau Scanimage, cela devrait scanner!l 
Vous voyez plein de lignes s'afficher sur le terminal avec putty... (-d c'est le mode debug) 

----------------------- 

Maintenant automatisons le démarrage de saned : 

Si xinetd n'est pas installé : 
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/ 

put the group of your users who 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 
/etc/init.d/xinetd restart 
----------------------- 

Je n'arrivais pas à scanner de mon poste client windows quand je lançais sanetwain 

=> délai d'attente dépassé... 

j'ai résolu le problème en modifiant le fichier /etc/sane.d/dll.conf 
J'ai mis en commentaire (# devant la ligne) toutes les lignes qui ne correspondaient pas à mon driver. 

----------------------- 

Sous MacOS X 

Il y aurait aussi la possiblité d'utiliser sane. Il y a un lien sur le site de sanetwain => http://www.ellert.se/twain-sane/ 
A tester... 
je n'ai pas de mac 

----------------------- 

Sous linux 

Il faut installer xsane (déjà installé sur mon pc). 
Il suffit de configurer xsane pour qu'il accède au scanner sur le serveur. 

nano /etc/sane.d/net.conf (sur le pc client) 
adresse-ip_du_serveur 

vous pouvez utiliser xsane ou faire de l'acquisition à partir d'un logiciel (openoffice, gimp, ...) 

---------------------- 

Ecureuil 

----------------------