[sane-devel] Canon Pixma MX850 Buttons

Ronald Müller ronald_mueller at gmx.de
Sun May 17 16:48:05 UTC 2015


Hi,

i use Canon Pixma MX850 AiO at home and want to use it as network-scanner.
Its very impressing what is possible till now with SANE and the Canon
maschines, so many thanks to guys who made this possible.

To use the MX850 as network-scanner i use the "scanadf"-tool with
button-controlled turned on and ADF-duplex option in a loop and do some
postprocessing on the scanned images like deskewing, croping and ocr-ing,
finally i produce a pdf from it copy this to my NAS for archiving.

So overall i'm fine with this solution, but there is still space for
improvements:

- sort out the empty pages on one sided documents (ADF simplex option would
help also to speed up)
- better documents "detection" - actually the final image is always ~
2552x4200 px @ 300dpi (which i think is the max. size) and i have to make a
clever crop to have my DIN A4 page available (thanks to imagemagick this is
no magic)

To improve this task it would be nice to evaluate what user has choosen at
scan-dialog on the maschine and take this in to account (if possible). I
don't know other Canon AiO, but if you want to scan something with the
MX850, there is a small wizard: first you have to choose the scan-backend
(USB, PC, ...). In the second step you can choose the source (document on
flatbed, photo an flatbed, ADF simplex, ADF duplex). The third step is to
choose some kind of action (save to PC, save as PDF to PC, send as mail,
open with application).

Till now this information is not available to the frontends like "scanadf".
Or at least i don't know how to do this. It would be nice to have a least
the "source"-option available.
What i found out so far is that, when i pressed the scan-button there is
packet sent from the scanner to the backend which contains this
configuration information in byte 0 and 1 (see debug output below). So my
question: Can i use this information somehow? Or is not implemented yet?

The sane-backend is installed on an fresh debian jessie from standard
repository. The MX850 is connected via network.

root at scanner-server:/# scanimage -V
scanimage (sane-backends) 1.0.24; backend version 1.0.24

root at scanner-server:/# SANE_DEBUG_PIXMA=11 scanimage --resolution 300
--button-controlled > test
[sanei_debug] Setting debug level of pixma to 11.
[pixma] pixma is compiled with pthread support.
[pixma] pixma version 0.17.4
[pixma] Scanner model found: Name MX850(Canon PIXMA MX850) matches MX850
series
[pixma] pixma_collect_devices() found Canon PIXMA MX850 at bjnp://
192.168.2.200
[pixma] pixma_find_scanners() found 1 devices
[pixma] Scanner model found: Name MX850(Canon PIXMA MX850) matches MX850
series
[pixma] pixma_collect_devices() found Canon PIXMA MX850 at bjnp://
192.168.2.200
[pixma] pixma_open(): Canon PIXMA MX850
[pixma] OUT  T=2.516 len=16
[pixma]  00000000:f3 20 00 00 00 00 00 00  00 00 00 00 00 00 00 10
[pixma]
[pixma] IN   T=2.519 len=24
[pixma]  00000000:06 06 00 00 00 00 00 00  03 00 01 00 02 03 00 02
[pixma]  00000010:00 00 00 00 00 00 00 f5
[pixma]
[pixma] Current status: paper=0 cal=0 lamp=2 busy=0
[pixma] Reader task started
[pixma] Reader task id=140543408641792 (threaded)
[pixma] ==== Button-controlled scan mode is enabled.
[pixma] ==== To proceed, press 'SCAN' or 'COLOR' button. To cancel, press
'GRAY' or 'END' button.
[pixma] INTR T=44.622 len=64

The following first two byte contains the wizard-configuration:
byte 0: 11,21,31,41 (source)
byte 1; 01,02,03,...  (action)

[pixma]  00000000:*11 01* 00 00 00 00 00 00  00 00 00 00 00 00 00 00
[pixma]  00000010:00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
[pixma]  00000020:00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
[pixma]  00000030:00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
[pixma]
[pixma]
[pixma] pixma_scan(): start
[pixma]   line_size=7656 image_size=26857248 channels=3 depth=8
[pixma]   dpi=300x300 offset=(0,0) dimension=2552x3508
[pixma]   gamma_table=0x7fd2de75def0 source=0
[pixma]   threshold=127 threshold_curve=0
[pixma]   ADF page count: 0
[pixma] OUT  T=44.629 len=16
[pixma]  00000000:db 20 00 00 00 00 00 00  00 00 00 00 00 00 00 00
[pixma]
[pixma] IN   T=44.640 len=8
[pixma]  00000000:06 06 00 00 00 00 00 00
[pixma]
[...]

Concerning detecting the paper-size i found this in the debug output: 3495
lines is roughly what i would expect for a din a4 page. But i always get
4200 lines ?!
Can i somehow get an cropped image directly from the scanner?

[pixma] WARNING:image size mismatches
[pixma]     32155200 expected (4200 lines) but 26757720 received (*3495*
lines)
[pixma] pixma_read_image(): completed (underrun detected)
[pixma] Reader task terminated

regards

Ronald
-- 
*********************************************
* email ronald_mueller at gmx.de
* mobil +49-177-5633820
* icq  #134663106
* skype ronald_mueller
*********************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20150517/c03c79ce/attachment.html>


More information about the sane-devel mailing list