Thursday, July 24, 2014

Linux Driver for Canon ImageClass MF3110/3112

I recently stumbled upon a treasure trove while looking for ways to make my old Canon ImageClass MF3112 all-in-one laser printer work with the latest OS around.

Background of the situation

If you're looking for drivers of this printer at the Canon official website, it only provides drivers to support 32-bit Windows XP, Vista and 7... none for Linux nor MacOS. This is pretty much a bummer especially if you have up-to-date workstations that "need" 64-bit OS (the > 4GB RAM thing). In my case, all my workstations and laptops run a Windows 8.1 and an Ubuntu Gnome 14.04, both 64-bit.

Canon actually published a package to install printer drivers for Linux-based OS, called the "UFR II". However, this is only for their not-so-late models, and apparently the one I need is the one they developed prior to this. The older models seem to be an implementation based on a raster-like format that I have no particular clue how it differs.

After a day of two of digging around the Internet, and exploring the vast "Page 2 and 3" Google search results, I found a guy who made a custom linux driver to support this "rastertocups" print driver thing that Canon has done and left to rot. He has a GitHub repo page which sort of discussed what the driver is and what other canon printer models are supported.

Since there's no HowTo wiki entry to use his codes, I opted to share what I did in order to use and install it (credits to ondrej-zary for the source code).

Pre-work Requirements
  • sudo rights (or root)
  • gcc and compiler (e.g. make, build-essential) is installed
  • cups, libcups2-dev, and libcupsimage2-dev is installed
  • even though it doesn't have the required drivers, I installed the UFR II Canon Linux Drivers because it seems that it is needed for the custom drivers to work
The Steps
  1. Download ondrej-zary's carps-cups source code (there's a zip file download link present)
  2. Extract it on the desired work-area folder (temporary use; mine was inside my home folder)
  3. Using the terminal, go to the location of the unzipped folder and run "make" 
    $ cd ~/carps-cups-master 
    $ make 

  4. If there are errors of missing dependencies, you can try to use "apt-file search " to check which packages you need install before trying to make it.
  5. If things look fine and there's no error, proceed with "sudo make install" (or make install for root users);
$ sudo make install
The Result

I've done this and made my printer work with Ubuntu Gnome 14.04 64-bit (cups 1.7.2) and Debian 7 Wheezy 32-bit (cups 1.5.3). I added printer and selected the compiled driver via the cups web interface (usually running at your linux machine "localhost:631").

Hope this helps somebody out there... and again a huge thanks to ondrej-zary!