Canon PIXMA MP is a series of multi-function devices (All-in-one printer). This software supports only the scanning function of the device. MP150, MP170, MP450 and MP500 are currently supported. I'm working on support for MP750 and other devices in the series. (See status) I've contacted Martin Schewe (the author of the driver for MP750/MP780) and started some experiments to integrate the both drivers in one binary. Because I only have MP150, I need your help for testing the software with other models. Currently, the software compiles and runs on Linux. Porting to other OSes that support USB is also possible.
The core driver, on which the SANE backend and stand-alone utility are based, is in an ALPHA stage and will stay in this stage because I've no programming manual or protocol specification for the devices at all. By analyzing USB traffics I could get enough information to write a driver that seems to work. Although many testers and I do our best to test the software, it will not work in every situation.
If you are looking for a Linux printer driver for these devices, have a look at turboprint (commercial software) or printer drivers by Canon in Japan (partially open-source software).
Scanner utility and SANE backend for Canon PIXMA MP series Copyright (C) 2006-2007 Wittawat Yamwong 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
See also detailed status(online).
Model | USB ID | Hardware features | Status and comments | ||||
---|---|---|---|---|---|---|---|
DPI | GR | GT | AD | BT | |||
Protocol 1a: The backend is ready for day-to-day use although some features are missing. | |||||||
MP150 | 4A9:1709 | 1200(1) | Y | Y | - | 1x1 | working |
MP170 | 4A9:170A | 1200(1) | Y | Y | - | 2x1 | working |
MP450 | 4A9:170B | 1200(1) | Y | Y | - | 2x4 | working but making loud noise at 600 DPI |
MP500 | 4A9:170C | 1200(1) | Y | Y | - | 2x4 | working |
MP530 | 4A9:1712 | 1200(1) | Y | Y | Y | 2x1 | working |
MP800 | 4A9:170D | 2400(2) | Y | Y | - | 2x5 | working but no support for film scan |
MP800R | 4A9:170E | 2400(2) | Y | Y | - | 2(?) | working but no support for film scan |
MP830 | 4A9:1713 | 2400(2) | Y | Y | Y | 2x1 | working but no duplex ADF yet |
Protocol 1b | |||||||
MP160 | 4A9:1714 | 600 | ? | Y | - | ? | Full scan @ 75DPI color works. TBD |
MP180 | 4A9:1715(?) | 1200 | ? | ? | - | ? | untested |
MP460 | 4A9:1716 | 1200 | ? | Y | - | ? | Full scan @ 75DPI color works. TBD |
MP510 | 4A9:1717(?) | 1200 | ? | ? | - | ? | untested |
MP600 | 4A9:1718 | 2400 | ? | Y | - | ? | Full scan @ 75DPI color works. TBD |
MP600R | 4A9:? | 2400 | ? | Y | - | ? | untested |
MP810 | 4A9:? | ? | ? | ? | - | ? | untested |
Protocol 2 | |||||||
MP360 | 4A9:263C | 1200 | Y | - | - | ? | The scanner locks up sometimes. |
MP370 | 4A9:? | 1200 | ? | - | - | ? | Please send me output of lsusb. |
MP390 | 4A9:? | 1200 | ? | - | - | ? | Please send me output of lsusb. |
MP700 | 4A9:2630 | 1200 | Y | - | - | 1x1 | working except grayscale @ 1200DPI |
MP730 | 4A9:262F | 1200 | Y(?) | - | ? | 1x1(?) | ADF and grayscale are untested. |
Protocol 3 | |||||||
MP750 | 4A9:1706 | 2400(2) | - | - | Y | 2x1 | Canceling scan in ADF mode doesn't eject the paper! |
MP760 | 4A9:1708 | 2400(2) | - | - | - | 2(?) | The scanner hangs! |
MP780 | 4A9:1707 | 2400(2) | - | - | Y | 2(?) | Both flatbed and ADF work but scanner hangs when cancel during a scan. |
Unknown protocol: These devices don't work with this backend and there is no easy way to add supports because they use a different command set which has to be analyzed first. Co-programmers are welcome! :-) I personally cannot do this because I don't have the devices. | |||||||
MP110 | 4A9:1700 | 1200 | N | N | - | N | unsupported |
MP130 | 4A9:1701 | 1200 | N | N | - | N | unsupported |
|
|
Notes
You will find an up-to-date version here.
The SANE backend is now included in the sane-backends CVS. It can be downloaded from the SANE project homepage. Please follow the download instruction.
Version | Comment |
---|---|
0.13.0 |
|
0.12.2 |
|
0.12.1 |
|
0.12.0 |
|
0.11.3 |
|
0.11.2 |
|
0.11.1 |
|
0.11.0 |
|
Warning - If you grant a group a full permission to access the scanner (by using udev, hotplug, resmgr etc.), every members in the group will have full access rights not only for the scanner part but also for the other parts of the device i.e. printer, memory-card reader and fax. These users can bypass your system's security policy and do everything with the device intentionally and unintentionally. If this is not what you want especially for a workgroup computer, you should consider using saned as a proxy. Then all other user frontends should be able to access the scanner only through saned. (saned is included in the sane-backends package.)
The software has been successfully tested on SUSE Linux 10.0 and 10.1 OSS (i386 and x86_64), kernel 2.6.13 and 2.6.16. It should compile on other Linux distributions as well. You need an ANSI C-Compiler and make, such as GNU gcc and make, and glibc. resmgr and libtiff (3.7.3 or later) are optional. SANE's header files sane.h and saneopts.h are also optional. If they are installed, Makefile will use them. If not, the files that come with the driver are used instead.
Note: For Linux kernel 2.4.x and other OS please download the driver (backend) from the SANE project homepage.
Unpack the package into a directory and compile with
make
The Makefile will automatically detect resmgr and libtiff. If it doesn't compile for some reasons or you don't want to link with them, run
make WITH_RESMGR=no WITH_TIFF=no
resmgr allows normal users to access USB devices through usbfs (if configured properly). Otherwise you have to run the program as root or set the usbfs permission accordingly e.g. by using a hotplug script or udev rules. By default the driver looks for USB devices in /dev/bus/usb then in /proc/bus/usb. Please consult the administration handbook of your OS (keywords: udev hotplug scanner sane) for how to grant a user an access to the scanner. (You need read and write permission.)
To install, typesudo make install
If the automatic installation doesn't work, you can manually install the SANE backend:
The device name is in the form "pixma:xxxxyyyy_zzzzzz" where x, y and z are vendor ID, product ID and serial number respectively. Example: pixma:04A91709_123456 is a MP150. Admitted, the device naming is not human-friendly but you can define an aliase with a human-friendly name (e.g. "MP150") in the config file dll.aliases. See also man sane-dll.
Because the SANE backend doesn't use any header files from sane-backends package (sanei_backend.h and friends), there could be compatibility and portability problems. Anyway, as far as I can test, there is no problem on SUSE Linux yet.
You must have read and write permissions for the USB device node of your scanner. Otherwise, you have to run scan and SANE frontends as root.
./scan output.pnm
will scan the whole area at 75 DPI in color mode and save the output to output.pnm. Press the "scan" button on the device to begin. Running scan without parameters will show all available options.
./scan -LLprints all supported models. Experimental subdrivers are disabled by default. scan will tell you how to enable them.
See sane-pixma man page and your frontend user manual.
Archive color documents in a PDF file.
Requirement: libtiff and tiff2pdf distributed in TIFF package.
Turn to your computer's keyboard and type
./scan -r 150 -f tiff -m color /tmp/scan.tif
Now you can go to your MP. Lay the first page in the scanner and press a scan button. (For MP150, there is only one "scan" button. For other models, there are 2 buttons, "Color" and "Gray". It makes no difference which button you press.) Then the next page and so on. Repeat this step until you've scanned all documents.
Go back to your computer. Press Ctrl-C and run
tiff2pdf -f -o YourDocumentName.pdf /tmp/scan.tif
You may want to check the PDF file with your favorite PDF viewer.
Scan a photo and correct color to sRGB.
Requirement: libtiff, tifficc in lcms package and ICC profile of your scanner. You may find the ICC profile in Windows XP under %WINDIR%\system32\spool\drivers\color. For MP150, its name is CNFMP15R.ICC.
I assume that the size of your photo is 15cm x 10cm. Lay a photo in the scanner and run
./scan -r 600 -w 150 -h 100 -m color -1 -f tiff /tmp/scan.tif tifficc -i YourScanner.ICC /tmp/scan.tif newphoto-sRGB.tif
Launch a program when you press a scanner button.
BUTTON=`./scan -B` case "$BUTTON" in 1??) Button1_pressed ;; 2??) Button2_pressed ;; *) echo "No button pressed" ;; esac
The tables below show the button codes.
Action (for MP450, MP500 and MP800) | Button | |
---|---|---|
Color | Gray | |
Save at PC | 101 | 201 |
Save as PDF | 102 | 202 |
Attach to e-mail | 103 | 203 |
Open with application | 104 | 204 |
Scan and save film | 105 | 205 |
Model | Button | |
---|---|---|
Color | Gray | |
MP150 (has only one "SCAN" button) | 100 | - |
MP170, MP530, MP750, MP760, MP780 | 100 | 200 |
MP830 | 101 | 201 |
Your exercise: write a script that monitors the button state. When a user presses a scanner button, launch a program that automatically scans a document, converts to PDF and then saves it in $HOME/Documents. ;-)
./scan -1 -d 10 -w 30 -h 20 test.pnm 2> test.log
If there are errors, set the debug level to 10.
./scan -d 10 [your-options] output.pnm 2> test.log
or if you are using a SANE frontend
export SANE_DEBUG_PIXMA=10 export PIXMA_EXPERIMENT=1 xsane 2> test.log
Replace xsane
with your frontend.
This will dump a short version of USB traffics to test.log but it still can be very long. The most relevant part is normally the first 100 lines and a few lines at the end. Compare the output with your log generated on Windows.
Any comments, feedbacks, questions etc. are welcome. Don't hesitate to contact me. :-) For bug reports, you should also attach (gzipped) debugging output. (But please don't send me any attachments bigger than 50kB. Upload logs or anything ≥ 50kB somewhere in the Internet and send me just the link.)
Install doxygen, if not yet installed, and run
make doc
You will find the API reference in doc/html/index.html.
To compile scan_sim:
make scan_sim
scan_sim checks IO traffics against a log file produced by usbsnoop. The tool helps developers who don't own the hardware for which they want to write a subdriver. I could rapidly prototype subdrivers for MP730 and MP750 because of this tool. More information on request.
I would like to thank:
For the SANE backend: sane-devel mailing list and bug tracking system.
Or mail to Wittawat Yamwong <wittawat@web.de>. The subject line should contain the word "pixma". (for example "PIXMA MP830: ADF doesn't work!") If the size of log files are more than 50kB, put them on the web and send me just the link. (Prefered languages: Thai, German and English)
Wittawat Yamwong