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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
|
Plustek-USB.txt (2005-08-08) Gerhard Jäger <gerhard@gjaeger.de>
===============================================================
NOTE:
-----
ALL YOU NEED TO RUN YOUR USB SCANNER IS ALREADY INCLUDED. THERE'S
NO NEED TO INSTALL THE KERNEL MODULE pt_drv. THIS ONE IS ONLY NEEDED
FOR THE PLUSTEK PARALLELPORT SCANNER.
List of all currently implemented devices
-----------------------------------------
Quite a lot of them are not tested or even identified. Please send me the ids
of your device...
PLUSTEK
=======
Vendor ID: 0x07B3
Product ID Device-description and status
0x0005 not identified yet
0x0007 not identified yet
0x000F not identified yet
0x0010 U12 - working
0x0011 U24 (LM9831) - working
0x0012 not identified yet
0x0013 UT12 (LM9831) - working
0x0014 not identified yet
0x0015 U24 (LM9832) - working
0x0016 not identified yet
0x0017 UT12 - working, UT16 - working, UT24 - working
MUSTEK
======
BearPaw vendor ID: 0x0400 (They use the NationalSemiconductors ID!!!)
Product ID Device-description and status
0x1000 BearPaw 1200 (LM9831) - working
0x1001 BearPaw 1200 (LM9832) - not tested
0x1001 BearPaw 2400 (LM9832) - mostly working
KYE (Genius)
============
Vendor ID: 0x0458
Product ID Device-description and status
0x2007 ColorPage-HR6 V2 - working
0x2008 ColorPage-HR6 V2 - not tested
0x2009 ColorPage-HR6A - not tested
0x2013 ColorPage-HR7 - working
0x2015 ColorPage-HR7LE - not tested
0x2016 ColorPage-HR6X - not tested
Hewlett Packard
===============
Vendor ID: 0x03F0
Product ID Device-description and status
0x0505 HP Scanjet 2100c - working
0x0605 HP Scanjet 2200c - working
EPSON
=====
Vendor ID: 0x04b8
Product ID Device-description and status
0x010F EPSON Perfection 1250/Photo - working
0x011D EPSON Perfection 1260/Photo - working
UMAX
====
Vendor ID: 0x1606
Product ID Device-description and status
0x0050 UMAX 3400 - working
0x0060 UMAX 3400/3450 - working
0x0160 UMAX 5400 - working
COMPAQ
======
Vendor ID: 0x049F
Product ID Device-description and status
0x001A S4-100 - working, identical with UMAX 3400
CANON
=====
Vendor ID: 0x04A9
Product ID Device-description and status
0x???? FB620U - not integrated
0x2206 N650U - working
0x2207 N1220U - working
0x2208 D660U - working
0x220D N670U/LiDE20 - working
0x2220 LiDE25 - working
0x220E N1240U/LiDE30 - working
How to use and configure the Plustek USB backend
------------------------------------------------
Please note, that the following is only needed, if you need to upgrade
a SANE version...
Preparations
------------
What do we need ?
a SANE backends archive (i.e. sane-backends-1.0.9.tar.gz)
a driver archive (i.e. plustek-sane-0.45-1.tar.gz)
The latest SANE archive can be obtained at:
http://www.sane-project.org
and the latest backend at:
http://www.gjaeger.de/scanner/plustek.html
Assumptions
-----------
Our starting point is your home-directory:
:~>
The packages (here sane-backends-1.0.9.tar.gz und plustek-sane-0.45-1.tar.gz)
are in the /tmp directory.
Let's go:
---------
Change to your home directory and create a sane directory
cd ~
mkdir sane
unpack your sane tar-ball (here "sane-backends-1.0.9.tar.gz")
to this "sane" directory
cd sane
tar xvzf /tmp/sane-backends-1.0.9.tar.gz
Now unpack your plustek-sane tarball (here "plustek-sane-0.45-1.tar.gz")
to the backends directory:
cd sane-backends-1.0.9
tar xvzf /tmp/plustek-sane-0.45-1.tar.gz
Now do the ./configure step...
Especially for SuSE with a preinstalled SANE-RPM:
./configure --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man --infodir=/usr/share/info
Then do the make step and after that as root user perform the make install
step.
That's all!
Before using, make sure that the USB scanner device driver is loaded:
modprobe scanner
or
modprobe scanner vendor=0x7b3 product=0x17
You might need to add the following line to /etc/modules.conf, if the scanner is not
supported directly - vendor and product must match your device!
options scanner vendor=0x7b3 product=0x17
If you're not sure about the vendor and product id of your device, simply load
the USB subsystem and plug in your scanner. Then do a
cat /proc/bus/usb/devices
and look for the scanner
Now you have to configure the backend. Edit the file /etc/sane.d/plustek.conf
and fill in the appropriate vendor and product id (see there for examples)
This is it...
Autoloading scanner.o
---------------------
To perform an automatic load of the scanner module, you might add the modprobe
line to your boot.local file.
i.e. on SuSE system > 7.x
/etc/init.d/boot.local
An alternative way is to use the hotplug utilities.
Using hotplug utilities and libusb
----------------------------------
When using libusb with SANE, then you should also use the hotplug utilities to
automatically setup your device nodes (at least the permissions) and prevent
scanner.o from loading.
Assuming, that these utilities are properly installed on your box, you have
to tweak and add some files.
In directory (where of course the config files reside):
/etc/hotplug
Append the line
scanner
to file
blacklist
This prevents the scanner module from the usb-subsystem to be loaded.
Next thing is to add a new line in
usb.usermap:
usbscanner 0x0003 0x1606 0x0160 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00 000000
The example line shows the vendor ID of UMAX 0x1606 and the product ID of the 5400
0x0160 - these values must match the ones of your scanner.
Last step is adding a script in
/etc/hotplug/usb/
It is called "usbscanner" (don't forget the executable rights)
-------------------------------------------------
# !/bin/bash
if [ "${ACTION}" = add ] && [ -f "${DEVICE}" ]
then
chgrp users "${DEVICE}"
chmod ug+rw "${DEVICE}"
fi
-------------------------------------------------
This script will correct the access right to your scanner device when the device
is plugged in.
Debugging your USB scanner (written by Kev Green)
-------------------------------------------------
Firstly, are you running the latest version of SANE, and the Plustek USB driver?
Double check at http://www.gjaeger.de/scanner/plustek.html
(Plustek USB driver) and http://www.sane-project.org (SANE Suite) to
make sure you are.
Now, in order to test and utilise your scanner with the Scanner Access Now Easy
(SANE) system, there are basically two programs that you will need to use from
the sane-frontends (versions post 1.0.3) or sane (versions pre 1.0.3) packages.
Firstly, the sane-find-scanner program will allow you to locate your scanner,
and help you work out if sane knows where it is. This is not definite however,
as (you'll see this too when using sane-find-scanner) it will find all the
scanners on your USB and SCSI bus, whereas sane will only work when you have
the relevant sane backend installed and configured correctly for the relevant
scanner.
So, if sane-find-scanner can find your scanner, but scanimage doesn't work,
then you need to check, double check, and even triple-check your SANE
configuration file for plustek scanners (plustek.conf, usually in
/etc/sane.d
or maybe in /usr/local/sane/ or somewhere, a "find" will be able to tell you
where. It may take a while though!).
If sane-find-scanner doesn't find your scanner, then you should check to see if
the kernel recognises it at all, which you can do with the following command,
as mentioned above:
cat /proc/bus/usb/devices
If your scanner doesn't appear in there, then the kernel has not recognised it.
There may however be a crypic-looking entry in there which doesn't name itself
as plustek, in which case it is recognised as being there by the kernel, but is
not know to the kernel's USB device database, in which case this should be
mentioned on the plustek list (<plustek@linuxhacker.org>), from where
the "powers that be" will deal with it.
If that file does not exist in the /proc filesystem, then you don't have the
"Preliminary USB filesystem" option set in your kernel, and you will need to
recompile your kernel to allow you to do this step in debugging. If it
exists, but is empty, you will have to make sure (use the kernel configure
help information and the details of your motherboard to ascertain this!)
you have the right one of UHCI or OHCI USB modules installed or compiled into
your kernel.
Once you've established that the kernel has recognised your scanner, you can
start pointing the finger at SANE, or simply the "scanner" module. You will
need to have selected the "USB Scanner" option in your kernel compilation as
a module, or compiled into the kernel. If you have done neither, then SANE will
simply not be able to recognise your scanner. Rectify that, if you are missing
it.
If you have carried out all of the above steps, then sane-find-scanner should
be able to recognise your scanner correctly.
sane-find-scanner probes all of the devices on the SCSI and USB buses, and
so you may find that it outputs "unable to get minor data" errors or similar
to your terminal, or to your error logs, you can safely ignore these as long
as it does that, and has recognised your scanner.
Once you have found your scanner okay using sane-find-scanner, then you are
ready to start messing around with the actual scanimage program to attempt
to scan an image in.
Obviously (although this may turn out to be premature) you should now have
something in your scanner ready to scan for verification.
At this stage, you should begin to be warey, because while the USB stuff for
Plustek scanners is in development it may (like any kernel/module related software)
crash your system with a kernel panic, or simply just segfault, so for your own sake,
close down all the applications you are running and ONLY use text console, rather
than X-Windows at this point, as you will certainly want to avoid any
potential filesystem corruption.
At this point it's probably also good to ensure that you have selected the
"Magic SysRq Key" option in the kernel hacking section of the kernel config,
and done:
echo 1 > /proc/sys/kernel/sysrq
And of course read the readme for that in /usr/src/linux/Documentation, as that
should allow you to avoid filesystem corruption during any crashes that might
happen.
Now, before running scanimage, you should enable the maximum levels of
debugging possible in both the SANE core and in the Plustek scanner
backend.
To do this you should do:
export SANE_DEBUG_PLUSTEK=12
export SANE_DEBUG_DLL=12
Now, if you run scanimage, you should be able to see the maximum debugging
messages.
If those messages don't tell you what is wrong, then take note of your scanner
type, the contents of /proc/bus/usb/devices, and the contents of your error
log, as well as (where possible) the output of the scanimage command (if
you can't capture it directly, an as-accurate-as-possible description is
MUCH better than nothing!), and try and get all of the activity that
your scanner did as well (light
came on? didn't? motors came on? etc?) and email that to the plustek list
(<plustek@linuxhacker.org>).
For the particularly adventurous only...
You might want to try running the scanimage program through strace or
gdb to see if you can go some or all of the way to debugging the problem
yourself, and post the relevant (ie. last!) parts of those utilities
output to the plustek-help list. If you don't know what strace or gdb
are, then you should probably not try that.
It's probably safe to run your scanner in a normal operating environment
under Linux once you have got it working once in a text console.
How to add a new LM9831/2 based device description
--------------------------------------------------
If you have a LM9831 or LM9832 based scanner and your vendor and product id did
not appear in the list above and you're willing to do some experiments, then
simply add your device to the file plustek-devs.c at the end of the list.
See the list at the end of the file how this works...
Thanx guys for helping:
-----------------------
Henning Meier-Geinitz henning@meier-geinitz.de for Mustek Bearpaw testing, ideas and patches
Stefan Nilsen stefan.nilsen@telia.com for HP2200c testing and patches
Kev Green kyrian@ore.org for Documentation, UT12 testing and RPMS.
Holger Bischof bischof@cs.tu-berlin.de for OpticPro U12 testing
Abhijit Sovakar a.sovakar@gmx.de for OpticPro UT24 testing
Peter Koellner peter@mezzo.net for OpticPro U24 testing
Gene Heskett gene_heskett@iolinc.net for EPSON 1250 testing and patches
Tasnim Ahmed tasnim_ahmed@yahoo.com for KYE Colorpage HR6 testing
Reinhard Max max@suse.de for EPSON 1250 testing and patches
Allan N. Hessenflow allan@kallisti.com for UMAX 3400 testing and patches
Craig Smoothey craig@smoothey.org for HP2100c testing and patches
Till Kamppeter till.kamppeter@gmx.net for EPSON1260 testing
Christopher Montgomery monty@xiph.org for CanoScan calibration works
Olaf Leidinger leidola@newcon.de for CanoScan LiDE25 testing
and a lot of other guys not named here...
Some equations which are used to calculate some stuff
-----------------------------------------------------
The stuff is used in plustek_usbscan.c to get the correct register settings
out of the hardware descriptions:
Crystalfrequency is 48MHz
Pixel Period (seconds/pixel)
----------------------------
MCLK_DIV x 8 x CM
PixelPeriod = -----------------
48MHz
Integration Time (seconds)
--------------------------
Tint = PixelPeriod X LineLength
MCLK_DIV x 8 x CM X LineLength
Tint = ------------------------------
48MHz
Ideal MCLK Divider
------------------
48MHz (DataPixelsEnd - DataPixelStart)
MCLK_DIV = --------------------------- x --------------------------------
HostIORate x 8 x LineLength HDPI_ADJ x PP
48MHz (DataPixelsEnd - DataPixelStart) CM
= ------------------------------- x -------------------------------- x ----
BytesPerSecond x 8 x LineLength HDPI_ADJ x PP CM
48MHz 1
= --------------------------- x Tint x ---------
8 x LineLength CM
48MHz (Tint * 1000)
= ----------------------- x --------------------
1000 x 8 x LineLength CM
Ideal Scan Speed (inches/second)
1 1 1
ScanSpeed = ----------- x -------- x --------
PixelPeriod FSPI x 4 StepSize
48MHz 1 1
ScanSpeed = ----------------- x -------- x --------
MCLK_DIV x 8 x CM FSPI x 4 StepSize
48MHz
MCLK_DIV = ------------------------------------------
ScanSpeed x 8 x CM x FSPI x 4 x StepSize
----------------
Symbols:
CM - Color Mode (unitless), 3 for channel pixel rate color, else 1
-------------------------
|