Valid HTML 4.01 Transitional

Canon PIXMA MP495 Printer - Scanner - Copier

James F. Carter <jimc@math.ucla.edu>, 2011-04-11

My old printer died. It was manufactured in 2006-2007, the height of the rash of bad capacitors, and I'll bet if I tore it apart I might find green slime oozing over the motherboard. (In reality, a capacitor with the end seal bulging out.) The symptom was that it would function mostly normally, including copying, and it would be recognized on the USB bus, but occasionally when you try to print it would make the data transfer hang. This would persist for hours or days, then mysteriously self-heal coincident with the intervention du jour. When the outage extended to a week and the time approached to file taxes, I bought a new printer.

Requirements

Printing

Scanning and Copying

Printer Selection

The first step was to qualify vendors. We prefer orders fulfilled by Amazon, and they sell Brother, Canon, Epson, HP, Lexmark, Samsung, and a very few items from other vendors. My judgment on these vendors went like this:

Conclusion: start by looking at Canon printers supported on Linux.

Openprinting.org has a list of printers supported by Gutenprint and/or Foomatic (the old name). Of the printers sold on Amazon I found entries for:

Of these, the Canon MP495 looks to be the most promising, if the driver issue can be dealt with.

Canon PIXMA MP495

Characteristics of this printer:

I found this HOWTO: Get the Canon PIXMA MP495 Working in Ubuntu 10.10 (dated 2010-10-21 by Modsybus). Topics in this HOWTO:

  1. How to get it to connect wirelessly. We aren't doing wireless.

  2. http://support-au.canon.com.au/contents/AU/EN/0100301501.html, Canon Australia's download page for the Debian version of the driver, cnijfilter-mp495series-3.40-1-deb.tar.gz They also have RPMs and manuals.

  3. Driver includes an install script. Configure for network or USB, not both.

  4. Hand-edit /etc/cups/ppd/Canon-MP495.ppd which is set for 600dpi. Make same changes in /usr/share/ppd/canonmp495.ppd Resolution choice list: 600x600, 1200x1200, 2400x2400, 2400x4800, 2400x9600 He sets the default to 4800. Jimc says: this is going to put the host CPU to a lot of work, and the wireless net will have to transfer all those bytes. This resolution should only be used for the highest quality photos.

  5. http://support-au.canon.com.au/contents/AU/EN/0100302801.html to snarf scangearmp-mp495series-1.60-1-deb.tar.gz This is the scanner driver. You need to execute scangearmp to use the scanner (a daemon?)

So I ordered the Canon PIXMA MP495.

Treasure Hunt: Obtaining the Driver

On the Canon Australia site I found the advertised Debian packages but I could not find RPM packages for the MP495, so I installed the RPMs for the MP490. Big mistake: the software knows the model number for which it was compiled, and will not recognize the existence of other models. When I eventually uninstalled, a lingering item gave me a lot of grief -- CUPS copies the PPD file into /etc/cups/ppd under the name of the print queue. The package manager does not know to remove this file, and I forgot that it would have to be replaced.

On the Canon USA site there is no Linux support at all (for this printer). Hiss, boo! It looks like Firefox is required on this site; Opera's Javascript got stuck.

Trying on the European Union site: Canon Europe. Having seen what the MP490 driver did, I expected to have to hack the spec file and compile the driver myself. Here is the path through the maze to obtain the packages:

  1. Open the Canon Europe front page.

  2. Go to Download Software (shortcut in left nav bar) - "For You" / Country = United Kingdom; Product = Multifunction; Model = MP495 / Go.

  3. This is the product page for the MP495. Click on Downloads / Software (list of software opens up, Javascript required).

  4. Operating System = Linux ; Language = English / Search.

  5. This is the download page. Download both the Linux IJ scanner and printer. I did download both the package and source for each, but I did not actually use the precompiled packages, which were for Red Hat, so I could have omitted them.

  6. For each of them, click on the link, accept the license terms, and hit download.

Compiling the Printer Driver (Hacking)

This printer driver gives Linux support for a product family including the ip4800 mg5100 mg5200 mg6100 mg8100 mp250 mp280 mp495 . Model names are specified in lower case. The procedure should be essentially identical for any of these, but the resulting program is fixated on the model number for which it was compiled and will not touch any other one.

While the precompiled RPMs for Red Hat should be fairly broadly applicable, there are issues specific to OpenSuSE 11.2 and to my particular configuration, so I needed to hack the spec file. In theory you don't need to un-tar the sources; the rpmbuild command will take care of that. However, you do need to see the README file and to work on the spec file, so pick a containing directory (I created /home/src/canon-printer), rename the downloaded tar file (because otherwise you would overwrite it later) and do (adjust version numbers according to possible future improvements):


tar xzf cnijfilter-source-3.40-1.tar.gz.orig
cd cnijfilter-source-3.40-1

Now look in the README file for the table of model names and model IDs. The mp495 is represented by ID 369.

I also needed these hacks in the spec file, cnijfilter-common.spec in the toplevel directory. Download my patch to alter the spec file.

My Bahasa Indonesia is kind of rusty but I was able to fix a message translation file that wouldn't compile. Here's the patch to fix this, called id.po.pat . Apply it with the same command line as the previous one, being in the toplevel source directory as before.

Now to compile the package, change to the containing directory, create a tar file with the hacked files, and use rpmbuild to compile it. Change version numbers to match the actual version that you downloaded. Specify the model and model number for the printer you actually have. You will probably want to capture the output, which is rather long; I have included a suitable redirection using Bourne shell syntax (modify if you use C-shell). On my Koolu (AMD Geode at 500MHz, serving streaming media at the time) the compilation took 50 minutes; it would go a lot faster on an Intel desktop power pig, but this program is large. In the rpmbuild command your web browser will probably wrap it; don't be faked out; it belongs on one line.


cd ..
tar czf cnijfilter-source-3.40-1.tar.gz cnijfilter-source-3.40-1
rpmbuild -tb cnijfilter-source-3.40-1.tar.gz --define="MODEL mp495" --define="MODEL_NUM 369" --with build_common_package > /tmp/cnijfilter.make.log 2>&1

The result ends up in:

Install the packages by this RPM command line, or use your particular package management method:

rpm -U -v /usr/src/packages/RPMS/i586/cnijfilter-mp495series-3.40-1.i586.rpm /usr/src/packages/RPMS/i586/cnijfilter-common-3.40-1.i586.rpm

A short list showing where it installs files:

Configuring CUPS

The source directory (and the precompiled packages) includes an installation script: scripts/install.sh . I executed it to register the printer with CUPS, but it was not able to recognize the printer, probably because of Australian MP490 files. Give it a try, but here is the procedure I actually followed.

Operating Characteristics (Printer)

There is one confusing feature: after a minute or two of non-use, the printer enters nap state, with only the power button's lamp on. This saves a lot of power, and the printer will wake automatically when the host sends a print job. But pressing the power button wakes the printer. If you want to turn off power, you need to wake it first,, then press the power button again, and it will turn off in a few seconds. Similarly, if you want to make an autonomous copy you need to wake it first.

How much power does the printer draw?

Watts Status
0 Power off
7 - 14 Initialization
5 Ready (not printing)
14 Printing
0 Nap

It takes 21 seconds for power-on initialization. My test page, which was pretty minimal, took 10 seconds to print. The advertised speed of 8.8 pages per minute corresponds to 7 seconds per page, but this was at 600 DPI, and the CPU (Koolu, AMD Geode at 500MHz) could have been the bottleneck.

As for resolution, I compared the same document printed at 300 DPI and 600 DPI. I could just barely see that the glyphs were slightly crisper and curved edges were slightly less ragged at the higher resolution. If you have the CPU power (and most non-tree-huggers will), it's probably worthwhile to go with the default 600 DPI, but 300 DPI is perfectly readable and is completely satisfactory for printing tax forms and the like. For photo printing, on the other hand, you will certainly want to invest in the higher resolution, or even 1200 DPI.

Scanner Software

I'm using the SANE package for scanning. Many (possibly all?) of the Canon PIXMA scanners are served by the pixma backend found as /usr/lib/sane/libsane-pixma.so.1.0.22 . While other backends can be induced to work with an arbitrary product by a line such as usb 0x04a9 0x1747 (USB vendor and product codes for MP495) in the configuration file (here, /etc/sane.d/pixma.conf), the pixma backend only looks for wireless network printers here and only if the normal broadcast scan is ineffective. Therefore I had to recompile the backend.

I obtained the source RPM for the sane-backends package from the SuSE Build Service. At this writing the version for OpenSuSE 11.2 is sane-backends-1.0.22-10.2.src.rpm . It should be possible to hack contained files and reassemble an acceptable (but unsigned) source RPM, but I used a hybrid approach of installing the source RPM, unpacking the source tar file, generating a new patch, and hacking the spec file to apply it. Adjust version numbers according to what you actually have.

In the backend directory look for pixma* . There are three device-specific files: pixma_mp150.c pixma_mp730.c pixma_mp750.c . The first of these serves the most product variants. Since the MP495 is an upgraded version of the MP480, I picked the file mentioning the MP480: pixma_mp150.c . Make a copy of it now called pixma_mp150.c.orig . You will need it to create a patch file. I have a pre-made patch file to add the MP495, which goes in /usr/src/packages/SOURCES/add-mp495.patch , but you will have to use the procedure below if you are adding a different printer-scanner model.

Near the beginning of the file you will find PID codes defined; these are the USB product codes as integers (invariably hex literals). Use lsusb to discover the code for your scanner. The vendor code is always 0x04a9 for Canon. Insert this new one:

#define MP495_PID 0x1747

At the end you will find a table of type pixma_config_t. The rows are macros like this, which is what you insert for the MP495 (with ending comma):

DEVICE ("Canon PIXMA MP495", "MP495", MP495_PID, 1200, 638, 877, PIXMA_CAP_CIS),

The fields are:

Finally, create the patch file. You need to be in the toplevel directory.


cd ..
diff -u backend/pixma_mp150.c.orig backend/pixma_mp150.c > /usr/src/packages/SOURCES/add-mp495.patch

Now hack the spec file, /usr/src/packages/SPECS/sane-backends.spec Here is my complete spec file for version 1.0.22-10.2 (incrementing version to 1.0.22-10.3), but beware, the versions must match exactly and if you have a different version you should hack the spec file that came with your source RPM.

To build the package:

rpmbuild -bb /usr/src/packages/SPECS/sane-backends.spec> /tmp/make.log 2>&1

Be very patient; it thrashes for a long time building a description file for the HP scanners that you don't have. The package comes out in /usr/src/packages/RPMS/i586/sane-backends-1.0.22-10.3.i586.rpm (or substitute x86_64, 2 places, if that's your architecture). Check the log file; almost at the end it gives the filename(s) where it's writing the RPMs. Install the package by

rpm -U -v /usr/src/packages/RPMS/i586/sane-backends-1.0.22-10.3.i586.rpm
(-U means to remove the unhacked version, if installed. The reason you increment the eentsy version number is to make rpm prefer your newer version.)

Scanner Setup

On the server you need the sane-backends package, and xsane (plus sane-backends) on the client, which could be the same or a different host. KDE's kooka, and xscanimage, can also use a SANE server. I'm describing a network connection for the client, even if on localhost, to keep the description simpler. You first need to set up the infrastructure for SANE:

The official way to set up a new scanner on SANE goes like this. The programs mentioned are from the sane-backends package.

Using xsane

This is a very quick overview of scanning with xsane. There are lots of features not covered, but this will get you started.