====== Canon iP3600 Inkjet Printer ====== In order to supplement the existing color laser printer by a device that can print decent quality photos, a Canon iP3600 has been acquired. The device is relatively cheap (about EUR 80 by 2011-08), the per-photo costs are only slightly above the photo costs when printing them in one of the public kiosk devices (about EUR 0.30 vs. EUR 0.23 for a 10 cm x 15 cm photo), and the magazine reviews praise a fairly good photo printout quality, so it seemed to be a good complement to the laser printer. The iP3600 is really just a printer only, rather than a multifunction device that includes a scanner or any kind of other gimmick. It doesn't feature any kind of operating menu or such, just a power button, a suspend/resume button, two LEDs, and a USB connector. ===== (Non-)Support for FreeBSD ===== Unfortunately, the device does not use any of the common printer languages (%%PostScript%%®, ESC/P2, PCL) but some proprietary language. It is officially supported for Windows and %%MacOS%%, and essentially also supported for Linux. Inspecting the Linux package (before buying the device) gave a sufficient confidence it could eventually also be made to run on %%FreeBSD%% (i386); there is even one ''%%#ifdef FreeBSD%%'' in there. Part of the Linux package provided by Canon ships as source code, but some portions of the code are only available as binary libraries to link against. Consequently, the Linuxulator is needed in order to really operate this printer on %%FreeBSD%%, restricting it to the i386 and amd64 architectures. Device support is designed to work as part of the [[http://www.cups.org/|CUPS]] printer system. Supporting it in other spooling systems might be possible, but is likely going to be even more work. ===== How to make it work on FreeBSD ===== ==== Device detection, device permissions ==== Provided the ''%%ulpt%%'' module is present in the kernel, or has been loaded manually, attaching the printer should result in a message like ulpt0: on usbus1 ulpt0: using bi-directional mode on the console. In order to grant the CUPS system access to the printer device, place the following snippet into a file named ''%%/usr/local/etc/devd/printer.conf%%'', and restart ''%%devd%%'': notify 100 { match "cdev" "ulpt[0-9]+"; match "system" "DEVFS"; match "subsystem" "CDEV"; match "type" "CREATE"; action "chmod 0600 /dev/$cdev; chown cups /dev/$cdev; logger $cdev arrived"; }; notify 100 { match "cdev" "unlpt[0-9]+"; match "system" "DEVFS"; match "subsystem" "CDEV"; match "type" "CREATE"; action "chmod 0600 /dev/$cdev; chown cups /dev/$cdev; logger $cdev arrived"; }; Now, attaching the printer to the USB should result in two device nodes accessible to the CUPS system: $ ls -l /dev/u*lpt* crw------- 1 cups operator 1, 16 Aug 14 23:48 /dev/ulpt0 crw------- 1 cups operator 1, 17 Aug 14 23:48 /dev/unlpt0 ==== Canon software ==== Canon operates a [[http://software.canon-europe.com/|software download page]] on their web servers. Select "Linux" as the operating system, it will result in two packages titled "RPM Linux". Actually, only one of them is actually "RPM", the other one is a Debian Linux package. Pick whatever you could handle. RPM files can easily be handled by the ''%%rpm2cpio%%'' tool. The actual file downloaded is a ''%%tar%%'' file, containing (for example) the following files: cnijfilter-ip3600series-3.00-1.i386.rpm cnijfilter-common-3.00-1.i386.rpm cnijfilter-common-3.00-1.tar.gz Extract them into a directory of its own. The "ip3600series" RPM and the ''%%.tar.gz%%'' file (which contains the source code) are needed for our purpose. ==== Binary RPM ==== Within your specific directory, run rpm2cpio cnijfilter-ip3600series-3.00-1.i386.rpm | cpio -ivd to extract the archive. (Adapt the name appropriately for a different version.) The actual binary filter program needed is called ''%%cif%%''//model// (thus ''%%cifip3600%%'' for this printer model), located within the ''%%/usr/local/bin%%'' directory. Move that file to the ''%%/usr/local/bin/%%'' directory of your system. Move the files located in the extracted ''%%/usr/lib%%'' (including the subdirectory ''%%/usr/lib/bjlib/%%'') into your ''%%/compat/linux/usr/lib/%%'' directory. Start a Linux shell as ''%%/compat/linux/bin/bash%%'', and run ''%%ldconfig%%'' there, to make the newly added libraries known. In addition to this, the filter somehow wants to execute the Ghostscript interpreter as ''%%/usr/bin/gs%%''. As the %%FreeBSD%% ports install it under ''%%/usr/local/bin%%'', provide a symlink from there to ''%%/usr/bin/gs%%''. ==== Compiling (parts of) the source ==== Extract the ''%%cnijfilter-common-*.tar.gz%%'' file. It contains a number of source code subdirectories, as well as the model-dependant binary blurb (subdirectory ''%%333%%'' for the ip3600). Each of the source code subdirectories has a file named ''%%autogen.sh%%'', which will run the autoconf/automake tools, and the generated ''%%configure%%'' script in turn. First, the ''%%libs/%%'' directory must be compiled that way. Someone has to tell the Canon engineers that ''%%malloc()%%'' has been part of ''%%%%'' since ANSI C89. They still think ''%%%%'' is needed, so remove that line from the file ''%%libs/paramlist/paramlist.c%%''. Next, the ''%%pstocanonij%%'' filter has to be compiled that way. ''%%make install%%'' will install it into ''%%/usr/local/lib/cups/filter/%%''. ==== Make the printer known to CUPS ==== The source distribution contains a ''%%ppd/%%'' subdirectory. The PPD file is needed as the glue for CUPS. The PPD file for the printer chosen contains a filter line like *cupsFilter: "application/vnd.cups-postscript 0 pstocanonij" For whatever reason, the %%FreeBSD%% CUPS didn't search that directory, so this had to be changed into an absolute path name: *cupsFilter: "application/vnd.cups-postscript 0 /usr/local/lib/cups/filter/pstocanonij" Then, point the browser to the local CUPS admin URL, and add a new printer. When being prompted for the device, pick USB Printer #1 from the list. (At this point, my CUPS stalled, resulting in a 100 % CPU load caused by a Perl script. Killing the Perl script eventually made it proceed.) Then, select "Or Provide a PPD File", and pick the PPD file mentioned above. Completing this, it should be possible to print the CUPS test page. ===== Quirks ===== When adding the device to GIMP/Gutenprint, the device options (like selection of the paper slot) were ignored. Only help so far is to pre-select the desired options already in CUPS. When printing to photo paper in GIMP, don't select the photo paper format itself, but rather select the plain paper format (like A4), position the image at the top center, and print it. ---- {{tag>HowTo}}