Per i motivi più disparati, nel corso degli ultimi 2 anni, mi sono trovato ad avere per le mani 4 scanner Fujitsu SanSanp iX500. Funzionano perfettamente sia via usb che via wi-fi, e il software di gestione proprietario di Fujitsu è davvero semplice e ben fatto sia per Windows, sia per MacOs X.
Con Linux (Centos nel mio caso) ho sempre avuto un po' di difficoltà nell'ottenere risultati decenti: in particolare riscontravo continui inceppamenti dopo la prima pagina scansionata.
Non che mi fossi mai realmente impegnato a farli funzionare: non erano certo destinati a me e gli utenti avrebbero usato Windows/MacOs X.
Armato di puro spirito di conoscenza ho scavato un po' più a fondo per cercare di utilizzare lo scanner con Centos 7.3.
1)Installo backend, frontend e gui per SANE
1 |
yum install sane-backends-drivers-scanners.x86_64 sane-frontends.x86_64 xsane sane-backends |
2) Attacco lo scanner via usb, nel mio caso ho usato porta e cavo usb3.0.
Questi i log del kernel:
1 2 3 4 5 |
Jun 07 10:53:11 client kernel: usb 2-1.6: new high-speed USB device number 11 using ehci-pci Jun 07 10:53:11 client kernel: usb 2-1.6: New USB device found, idVendor=04c5, idProduct=132b Jun 07 10:53:11 client kernel: usb 2-1.6: New USB device strings: Mfr=1, Product=2, SerialNumber=0 Jun 07 10:53:11 client kernel: usb 2-1.6: Product: ScanSnap iX500 Jun 07 10:53:11 client kernel: usb 2-1.6: Manufacturer: Fujitsu |
Questi i risultati dei comandi di sane che trovano lo scanner in questione (tra le altre cose):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
utente@client:]# sane-find-scanner could not open USB device 0x046d/0xc245 at 002:005: Access denied (insufficient permissions) could not open USB device 0x2516/0x0004 at 002:004: Access denied (insufficient permissions) could not open USB device 0x0ac8/0x332d at 002:003: Access denied (insufficient permissions) could not open USB device 0x8087/0x0024 at 002:002: Access denied (insufficient permissions) could not open USB device 0x1d6b/0x0002 at 002:001: Access denied (insufficient permissions) could not open USB device 0x8087/0x0024 at 001:002: Access denied (insufficient permissions) could not open USB device 0x1d6b/0x0002 at 001:001: Access denied (insufficient permissions) found USB scanner (vendor=0x04c5 [Fujitsu], product=0x132b [ScanSnap iX500]) at libusb:004:002 could not open USB device 0x1d6b/0x0003 at 004:001: Access denied (insufficient permissions) could not open USB device 0x1e4e/0x0102 at 003:002: Access denied (insufficient permissions) could not open USB device 0x1d6b/0x0002 at 003:001: Access denied (insufficient permissions) utente@client:]# scanimage --list-devices device `v4l:/dev/video1' is a Noname Vega USB 2.0 Camera. virtual device device `v4l:/dev/video0' is a Noname USB2.0 Camera virtual device device `fujitsu:ScanSnap iX500:1251809' is a FUJITSU ScanSnap iX500 scanner device `epson2:net:1.2.3.4' is a Epson PID 0869 flatbed scanner device `epson2:net:5.6.7.8' is a Epson PID 0869 flatbed scanner device `epson2:net:9.10.11.12' is a Epson PID 087D flatbed scanner |
3) Inserisco un foglio nell'ADF dello scanner (cioè, lo metto nell'unico posto dove si possono mettere i fogli da scansionare) e faccio un test:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
utente@client:]# scanimage --test -d 'fujitsu:ScanSnap iX500:1251809' scanimage: scanning image of size 5096x6600 pixels at 1 bits/pixel scanimage: acquiring gray frame, 1 bits/sample scanimage: reading one scanline, 637 bytes... PASS scanimage: reading one byte... PASS scanimage: stepped read, 2 bytes... PASS scanimage: stepped read, 4 bytes... PASS scanimage: stepped read, 8 bytes... PASS scanimage: stepped read, 16 bytes... PASS scanimage: stepped read, 32 bytes... PASS scanimage: stepped read, 64 bytes... PASS scanimage: stepped read, 128 bytes... PASS scanimage: stepped read, 256 bytes... PASS scanimage: stepped read, 512 bytes... PASS scanimage: stepped read, 1024 bytes... PASS scanimage: stepped read, 1023 bytes... PASS scanimage: stepped read, 511 bytes... PASS scanimage: stepped read, 255 bytes... PASS scanimage: stepped read, 127 bytes... PASS scanimage: stepped read, 63 bytes... PASS scanimage: stepped read, 31 bytes... PASS scanimage: stepped read, 15 bytes... PASS scanimage: stepped read, 7 bytes... PASS scanimage: stepped read, 3 bytes... PASS |
Ora uso il frontend a linea di comando "scanimage", che produce come output file .tiff o .pnm, per scansionare 2 o più pagine
- 2 PAGINE SCANIMAGE
L'idea è di produrre dei tiff numerati da dare in pasto poi a convert
1 2 3 4 5 6 7 |
utente@client:]# scanimage -d 'fujitsu:ScanSnap iX500:1251809' --format tiff --batch=$(date +%Y%m%d_%H%M%S)_P%04d.tiff Scanning -1 pages, incrementing by 1, numbering from 1 Scanning page 1 Scanned page 1. (scanner status = 5) Scanning page 2 scanimage: sane_read: Document feeder jammed Scanned page 2. (scanner status = 6) |
Purtroppo si inceppa e quindi non posso convertire i tiff col comando
1 |
convert *.tiff mio_documento.pdf |
- 2 PAGINE SCANIMAGE ADF DUPLEX E COLORI
1 2 3 4 5 6 7 8 9 10 11 12 |
utente@client:]# scanimage -d "fujitsu:ScanSnap iX500:1251809" --source "ADF Duplex" -b --mode color Scanning -1 pages, incrementing by 1, numbering from 1 Scanning page 1 Scanned page 1. (scanner status = 5) Scanning page 2 Scanned page 2. (scanner status = 5) Scanning page 3 Scanned page 3. (scanner status = 5) Scanning page 4 Scanned page 4. (scanner status = 5) Scanning page 5 scanimage: sane_start: Document feeder out of documents |
Così funziona, massimo 2 pagine però (fronte/retro quindi 4 file di output) altrimenti si inceppa.
Per poi creare il pdf digito:
1 |
utente@client:]# convert *.pnm gab.pdf |
Nota che con questo comando abbiamo una qualità e una dimensione del file MOSTRUOSA.
1 2 3 4 5 6 |
utente@client:]# du -sh ./* 385M ./gab.pdf 97M ./out1.pnm 97M ./out2.pnm 97M ./out3.pnm 97M ./out4.pnm |
- 3 PAGINE SCANIMAGE ADF FRONT TIFF
Mischio un po' i comandi di prima con 3 pagine solo fronte e risultato in tiff.
1 2 3 4 5 6 7 |
utente@client]# scanimage -d "fujitsu:ScanSnap iX500:1251809" --source "ADF Front" --mode color --format tiff --batch=$(date +%Y%m%d_%H%M%S)_P%04d.tiff Scanning -1 pages, incrementing by 1, numbering from 1 Scanning page 1 Scanned page 1. (scanner status = 5) Scanning page 2 scanimage: sane_read: Document feeder jammed Scanned page 2. (scanner status = 6) |
Purtroppo si inceppa subito.
CONCLUSIONI SCANIMAGE
Come si dice in questo thread
http://lists.alioth.debian.org/pipermail/sane-devel/2014-February/032103.html
scanimage non è affidabile su questo scanner. Probabilmente più si alza la qualità, più lo scanner è lento nel digerire le pagine, e meno si inceppa. Quando però lo scanner inizia pescare le pagine velocemente (che è poi il bello di questo scanner) si inceppa inesorabilmente.
XSANE
Usando come gui XSANE invece tutto funziona correttamente e gli inceppamenti svaniscono come per magia.
Configuro xsane in questo modo:
- 3 pagine.
- Tipo di file pnm.
- Una directory e un nome di file, a cui poi verrà aggiunto in automatico il suffisso -000X.pnm.
- ADF - Front per velocizzare un po' le operazioni.
- Qualità 100 -> Circa 2.7MB a file.
XSANE - Multipage project
E' anche possibile creare direttamente un pdf selezionando
- Multipage
Si apre un menù contestuale nel quale si indica una directory in cui verranno salvati i vari file scansionati. Si procede creando il progetto, si effettua la scansione di n pagine, si salva il "multipage file" e verrà creato un pdf con lo stesso nome della directory indicata.
Ecco il risultato: 3 file pnm e il pdf unione.
1 2 3 4 5 6 7 8 9 10 |
utente@client:/home/utente/work/scansionidimmerda]# ll total 8224 -rw-r----- 1 utente utente 2805351 Jun 7 12:02 image-0001.pnm -rw-r----- 1 utente utente 2805351 Jun 7 12:02 image-0002.pnm -rw-r----- 1 utente utente 2805351 Jun 7 12:02 image-0003.pnm -rw-r----- 1 utente utente 92 Jun 7 12:03 xsane-multipage-list utente@client:/home/utente/work/scansionidimmerda]# cd .. utente@client:/home/utente/work]# ll scansionidimmerda.pdf -rw-r----- 1 utente utente 5560352 Jun 7 12:03 scansionidimmerda.pdf |
NOTE VARIE
1) DEBUG
Per avere un po' di debug prima di lanciare scanimage si può digitare
1 |
export SANE_DEBUG_FUJITSU=10 |
2) SCANIMAGE - ELENCO OPZIONI SUPPORTATE
Per vedere tutte le opzioni supportate da scanimage per lo specifico modello di scanner:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
utente@client:]# scanimage -d "fujitsu:ScanSnap iX500:1251809" -A All options specific to device `fujitsu:ScanSnap iX500:1251809': Standard: --source ADF Front|ADF Back|ADF Duplex [ADF Front] Selects the scan source (such as a document-feeder). --mode Lineart|Gray|Color [Lineart] Selects the scan mode (e.g., lineart, monochrome, or color). --resolution 50..600dpi (in steps of 1) [600] Sets the resolution of the scanned image. Geometry: --page-width 0..221.121mm (in steps of 0.0211639) [215.872] Specifies the width of the media. Required for automatic centering of sheet-fed scans. --page-height 0..876.695mm (in steps of 0.0211639) [279.364] Specifies the height of the media. -l 0..215.872mm (in steps of 0.0211639) [0] Top-left x position of scan area. -t 0..279.364mm (in steps of 0.0211639) [0] Top-left y position of scan area. -x 0..215.872mm (in steps of 0.0211639) [215.872] Width of scan-area. -y 0..279.364mm (in steps of 0.0211639) [279.364] Height of scan-area. Enhancement: --brightness -127..127 (in steps of 1) [0] Controls the brightness of the acquired image. --contrast -127..127 (in steps of 1) [0] Controls the contrast of the acquired image. --threshold 0..255 (in steps of 1) [0] Select minimum-brightness to get a white point --rif[=(yes|no)] [no] Reverse image format --ht-type Default|Dither|Diffusion [inactive] Control type of halftone filter --ht-pattern 0..3 (in steps of 1) [inactive] Control pattern of halftone filter --emphasis -128..127 (in steps of 1) [0] Negative to smooth or positive to sharpen image --variance 0..255 (in steps of 1) [0] Set SDTC variance rate (sensitivity), 0 equals 127 Advanced: --ald[=(yes|no)] [no] Scanner detects paper lower edge. May confuse some frontends. --df-action Default|Continue|Stop [Default] Action following double feed error --df-skew[=(yes|no)] [inactive] Enable double feed error due to skew --df-thickness[=(yes|no)] [inactive] Enable double feed error due to paper thickness --df-length[=(yes|no)] [inactive] Enable double feed error due to paper length --df-diff Default|10mm|15mm|20mm [inactive] Difference in page length to trigger double feed error --bgcolor Default|White|Black [Default] Set color of background for scans. May conflict with overscan option --dropoutcolor Default|Red|Green|Blue [Default] One-pass scanners use only one color during gray or binary scanning, useful for colored paper or ink --buffermode Default|Off|On [Off] Request scanner to read pages quickly from ADF into internal memory --prepick Default|Off|On [Default] Request scanner to grab next page from ADF --overscan Default|Off|On [Default] Collect a few mm of background on top side of scan, before paper enters ADF, and increase maximum scan area beyond paper size, to allow collection on remaining sides. May conflict with bgcolor option --sleeptimer 0..60 (in steps of 1) [0] Time in minutes until the internal power supply switches to sleep mode --lowmemory[=(yes|no)] [no] Limit driver memory usage for use in embedded systems. Causes some duplex transfers to alternate sides on each call to sane_read. Value of option 'side' can be used to determine correct image. This option should only be used with custom front-end software. --side[=(yes|no)] [no] [read-only] Tells which side (0=front, 1=back) of a duplex scan the next call to sane_read will return. --swdeskew[=(yes|no)] [no] Request driver to rotate skewed pages digitally. --swdespeck 0..9 (in steps of 1) [0] Maximum diameter of lone dots to remove from scan. --swcrop[=(yes|no)] [no] Request driver to remove border from pages digitally. --swskip 0..100% (in steps of 1.52588e-05) [0] Request driver to discard pages with low percentage of dark pixels Sensors: --top-edge[=(yes|no)] [no] [hardware] Paper is pulled partly into adf --a3-paper[=(yes|no)] [no] [hardware] A3 paper detected --b4-paper[=(yes|no)] [no] [hardware] B4 paper detected --a4-paper[=(yes|no)] [no] [hardware] A4 paper detected --b5-paper[=(yes|no)] [no] [hardware] B5 paper detected --page-loaded[=(yes|no)] [no] [hardware] Page loaded --omr-df[=(yes|no)] [no] [hardware] OMR or double feed detected --cover-open[=(yes|no)] [no] [hardware] Cover open --power-save[=(yes|no)] [no] [hardware] Scanner in power saving mode --email[=(yes|no)] [no] [hardware] Email button --manual-feed[=(yes|no)] [no] [hardware] Manual feed selected --scan[=(yes|no)] [no] [hardware] Scan button --function <int> [0] [hardware] Function character on screen --double-feed[=(yes|no)] [no] [hardware] Double feed detected --error-code <int> [0] [hardware] Hardware error code --skew-angle <int> [0] [hardware] Requires black background for scanning |
3)GIRO DEL FUMO
Per capire quello che io definirei "il giro del fumo" dei driver/backend-frontend-gui si può leggere questa guida un po' datata che spiega BENE come funziona sane:
http://linux-sxs.org/hardware/usbsane.html
Nel caso specifico di questo scanner con Centos 7.3:
/etc/sane.d/dll.conf
c'è la entry "fujitsu"
->
/etc/sane.d/fujitsu.conf
c'è la entry
#ScanSnap iX500
usb 0x04c5 0x132b
->
root@client:/etc/sane.d]# ll /usr/lib64/sane/ |grep fuji
lrwxrwxrwx 1 root root 25 Jun 7 11:09 libsane-fujitsu.so -> libsane-fujitsu.so.1.0.24
lrwxrwxrwx 1 root root 25 Jun 7 11:09 libsane-fujitsu.so.1 -> libsane-fujitsu.so.1.0.24
-rwxr-xr-x 1 root root 189632 Jun 10 2014 libsane-fujitsu.so.1.0.24
Questi dono i driver,
root@client:/etc/sane.d]# rpm -qf /usr/lib64/sane/libsane-fujitsu.so.1.0.24
sane-backends-drivers-scanners-1.0.24-9.el7.x86_64
installati con questo pacchetto rpm.
Questo è il manuale del backend/driver.
1 |
man sane-fujitsu |
Il fatto che quando uso il frontend "scanimage" referenzio lo scanner dicendo -d "fujitsu:ScanSnap iX500:1251809" funziona perchè in
/etc/sane.d/fujitsu.conf c'è scritto
#ScanSnap iX500
usb 0x04c5 0x132b
e uno dei modi per referenziare il driver/backend da parte del frontend è (vedi man sane-fujitsu):
"usb 0x04c5 0x1042" (or other vendor/product ids)
1 2 3 |
Requests backend to search all usb busses in the system for a device which uses that vendor and product id. The device will then be queried to determine if it is a Fujitsu scanner. |