Header Shadow Image


Linux Pixma Printer Configuration: Canon Pixma iP4000 / iP4100

INTRO

Printing, can become one of those nagging things if you don't have it going yet.  This is especially true on Linux.  Though it's 2009 at this time, Linux is still lagging in printer support though that margin between Linux and Windows is shrinking rapidly. 

Having been already logged into my Linux partition I thought I should be able to setup a printer again without too many problems now that I took my system and upgraded from FC1 to Fedora 10+ (using steps you can find on this blog. Search: upgrade) and it should have the latest support for everything + the kitchen sink.  Previously, I setup my Canon PIXMA ip4000 using the below steps to print without too many issues, despite information from Canon US/Canada that NO drivers are available for my printer on Linux.  As mentioned I took my Linux distro through some upgrades earlier and, in addition, my second PC where the printer is actually installed had the printer configuration changed rendering my SMB installation useless on top of the fact that the local installations were also unconfigured as well due to the upgrade.

So absolutely nothing printed and off I went trying to figure out what broke.

TABLE OF CONTENTS

  1. Overview
  2. Setup the Windows Drivers (For use with SMB)
  3. Setup the printer drivers on Linux
  4. PRINTER SETUP: Linux SAMBA printer connected to LPT1 port on Win PC (Canon_ip4000_SMB_LPT1)
  5. PRINTER SETUP: Linux SAMBA printer connected to USB port on Win PC (Canon_ip4000_SMB_USB)
  6. PRINTER SETUP: Local Linux USB Connection (Canon_IP4000_LOCAL_USB)
  7. PRINTER SETUP: Local Linux LPT1 Connection (Canon_IP4000_LOCAL_LPT1)
  8. TESTING
  9. POST INSTALLATION CHECKS
  10. OTHER ERRORS AND PROBLEMS

 

OVERVIEW

I have a dual boot setup on my PC. Windows and Linux. On my other PC there's only Windows. The lot is networked by Ethernet through a Linksys WRT54GL router. The printer is connected through the scanner to my second PC by a parallel cable. The Canon PIXMA has two connectors, through a printer cable and USB.  Here is what the printer looks like:

Canon PIXMA iP4000 / 4100

Unfortunately most PC's come with only one parallel port however the CanoScan N640P I have has one PC Parallel port and one Printer Parallel Port to allow you to connect another parallel device should you need to and is exactly what I did: CanoScan N640P Rear View

I'll be connecting to the printer in either of four ways:

  1. On my PC's Linux installation using SMB to the Windows PC where the Printer is connected using Parallel Cables (LPT1) through the scanner, which in turn is connected to that Windows PC.  We will call this config Canon_ip4000_SMB_LPT1
  2. On my PC's Linux installation using SMB to the Windows PC where the Printer is connected directly using USB.  We will call this config Canon_ip4000_SMB_USB
  3. Directly from my Linux Distribution using the USB port of the printer.  We will call this setup Canon_IP4000_LOCAL_USB (Default Printer)
  4. Directly from my Linux Distribution ussing the LPT1 (Parallel port) and cable of the printer (Temporarily connected directly to the PC for).  This one we will call Canon_IP4000_LOCAL_LPT1

Either way is ideal for me since the printer sits between the first and second PC and is within reach by USB / Parallel cable of either PC.

 

SETUP THE WINDOWS DRIVERS (For use with SMB)

Since I will be connecting to the Windows printer through SMB I need to ensure my printers on the Windows PC are working correctly there and are shared on the network (You should follow the available CD and instructions on how to setup your printer on Windows)

Here's is how I opted to share them on my network:

Windows USB/LPT1 Canon Pixma iP4000 setup

 

SETUP THE PRINTER DRIVERS ON LINUX

You may skip this step if you already found your driver or are satisfied with the postscript setting above. You may also use these steps as a starting point for finding your own drivers for your printer.  As Linux distributions mature, older previously unsupported printers such as the PIXMA line of printers are now supported well in Fedora 10.

Again by default the PIXMA models may not appear in CUPS Make/Manufacturer list on older systems and you may need to install third party ones otherwise you will need to select the postscript printer as the model as mentioned earlier.  Canon.com itself has been notoriously bad at supporting Linux however Canon has made some strides in recent years to fix this problem.  In my case I could have used either rpm.pbone.net or rpmfind.net to get the files to install however opted to get the files off the Canon Japan FTP site at ftp://download.canon.jp/pub/driver/bj/linux/

NOTE: There is also a foundation called http://openprinting.org that can tell you if your printer is supported or not and where to find a driver for it. One of the sites for the ip4000 for example is http://gimp-print.sourceforge.net/ however from available documentation on the site at the time of this writing, the driver support is only experimental for Canon PIXMA iP4000 / iP4100 though it did work well in this case.

I downloaded the following files off the Canon Japan FTP site:

bjfilter-pixusip4100-2.50-2.i386.rpm
bjfilter-common-2.50-2.i386.rpm
bjfilter-pixusip4100-lprng-2.50-2.i386.rpm

Once you have the above files, install them using rpm -ivh <FILE.rpm> commands as follows:

$ cd /Files/Canon/bjfilter-rpm-files/
$ rpm -ivh bjfilter-common-2.50-2.i386.rpm
$ rpm -ivh bjfilter-pixusip4100-2.50-2.i386.rpm
$ rpm -ivh bjfilter-pixusip4100-lprng-2.50-2.i386.rpm

NOTE: You will need to install any missing dependencies. The one you will need most likely is libcups libraries off the Fedora Core CD/DVD you have or off the ISO image. In my case this was under /mnt/cdrom/Fedora/RPMS but may use /media instead of /mnt in your case. The package will be called something like cups-libs-*. Run below command replacing the .rpm file name below with your actual file name.

$ rpm -i –nodeps –force cups-libs-1.2.8-1.fc5.i386.rpm

NOTE FOR X64 SYSTEMS:

There are a couple of additional steps you may need to take in this case for X64 systems (My latest version of libxml2 is 2.6.23 but you should use your latest one available to you at the time).

$ cd /usr/lib $ ln -s libxml2.so.2.6.23 libxml2.so.2
$ Copy files from /usr/lib/cups/backend/ to /usr/lib64/cups/backend/ OR symlink files in /usr/lib/cups/backend/ to /usr/lib64/cups/backend/

Repeat above step for folder /usr/lib/cups/filter/ folder as you did above for …/backend folder

Once you setup bjfilter and create appropriate links as outlined above, you need to run service cups restart for the changes to take effect.  At this point the CUPS Make/Manufacturer page should contain your printer listed as one of the choices for the manufacturer you indicated earlier.

 

 

PRINTER SETUP: Linux SAMBA printer connected to LPT1 port on Win PC (Canon_ip4000_SMB_LPT1)

We will look at the first case initially since it's rare the printer will be within reach of two PC's and is the way I initially had to set it up since the other three means were not available to me at the time without a print server.

Now that you have the printer setup in Windows, you can check if your network and Windows configuration will allow you to see the printers you have in Windows. From Linux, run 'smbclient -L <REMOTE PC IP/HOSTNAME>' using the Windows PC IP to see a list of shares on that host. In my case the result was as follows showing that the devices were visible from my Linux distribution:

$ smbclient -L 192.168.0.3
Password:
Domain=[PCTWO] OS=[Windows …. ] Server=[Windows …. ]

Sharename Type Comment
——— —- ——-
CPIX_USB Printer Canon PIXMA iP4000 USB
CPIX_LPT1 Printer Canon PIXMA iP4000 LPT1

Server Comment
——— ——-

Workgroup Master
——— ——-
$

If the above doesn't show anything meaningful, check your runlevel and ensure the SMB service/daemon is running in your runlevel:

$ chkconfig –list smb smb
0:off 1:off 2:off 3:off 4:off 5:on 6:off
$ runlevel N 5
$ netstat -aeepn|grep smb
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 0 29790 4628/smbd
tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN 0 29789 4628/smbd
$

In case SMB is not running start it up with 'service smb start' or 'service smb restart' on Fedora Linux distributions. Other then this, you can enable SMB daemon in a run level using:

$ chkconfig –level 345 smb on
$

on run levels 3, 4 and 5. Your windows printers should then be visible to you in Linux. You may run into a couple of issues with SMB when you start working with it namely:

timeout connecting to 192.168.0.3:445
session request to 192.168.0.3 failed (Called name not present)

In my case this was the issue due to the port 445 being blocked on my Windows PC firewall (Added it to firewall rules there) and also an issue with my Linux box blocking it.  On my Linux box I added the rule by editing /etc/sysconfig/iptables inserting this line:

-A INPUT -d 192.168.0.0/16 -s 192.168.0.0/16 -p udp -m multiport –dports 445 -j ACCEPT

then restarting iptables using:

$ service iptables restart

Once the port is unblocked you can test by issuing:

# telnet 192.168.0.3 445
Trying 192.168.0.3…
Connected to 192.168.0.3.
Escape character is '^]'.
^]
telnet> quit
Connection closed.
#

Which should show Connected as above indicating the port is now open.  This solved another issue, likely related, where the printer light just blinks sending to SMB printer but nothing interesting beyond that happens.

We now need to setup the printer on your Linux distribution. In this case we will use CUPS which stands for Common Unix Printing System. This is one of the latest tools available to you on Linux systems and is available through your browser (By typing http://localhost:631/ in your browser – CUPS daemon runs on port 631) or through a fat client:

$ kcmshell printers

To configure CUPS daemon itself you can use the KDE CUPS GUI cupsdconf. In this case we can use the one available through our browser as I tend to find it more informative.

In any browser type http://localhost:631/ which should bring you to the CUPS configuration menu.  In case you receive a 404 Not Found error when using http://localhost:631/ , please follow these instructions for resolving it.  You should see several tabs including Home, Administration, Classes, Documentation/Help, Jobs, and Printers. Click the 'Add Printer' button under the 'Home' tab:

Add New Printer Page Link

A new page will appear. In my case I needed to fill in the following:

Printer Driver: Canon PIXMA iP4100 – CUPS+Gutenprint v5.2.3

 

Name: Canon_ip4000_SMB_LPT1
Location: smb://PCTWO/CPIX_LPT1
Description: Canon Pixma ip4000 SMB LPT1

Add New Printer Page

Click Continue at the bottom of the page to go to the Device configuration page. There you need to select Windows Printer via SAMBA option:

Device Selection Page

Click Continue again to bring you to the Device URI configuration page. There enter in the SMB path to the Windows printer:

Device URI: smb://PCTWO/CPIX_LPT1

Device URI Selection

Click Continue again to take you to the Make/Manufacturer page so you may select your model. Select the model you have from the list. In my case when I still had an older Fedora release, the list did not contain the correct model and type of printer I had so I had to search for the correct driver to install (See above section for third party BJ Japan drivers I used) or use the postscript driver. Ultimately, due to limitations of the SAMBA driver, I used postscript instead, which was fine even for graphical printing on older Fedora Linux distributions. 

Alternately, on Fedora Linux 10+ with the latest CUPS 1.3.9 the following driver worked well with the SMB / CUPS configuration above:

Printer Driver: Canon PIXMA iP4100 – CUPS+Gutenprint v5.0.2

The above configuration will be saved to a file /etc/cups/printers.conf.  In case you wish to change the configuration manually such as the Device URI it's fairly easy to do editing the above printers.conf file directly.

Select the closest matching driver to your printer from the Make/Manufacturer page. At this point click on Add Printer to save the settings. This should bring you to the first page. The Pros of this method is that I can print regardless of where the second PC is located. Proceed to the TESTING section in this HowTo to continue.

An issue that I ran into while setting up the printer through SMB was the:

ERRDOS – ERRbadaccess (Invalid open mode.) opening remote spool Test Page

when trying to print from Cups in Linux to a Windows machine through SMB.

It turned out that I had to uncheck "Print directly to the printer" in Windows and click Apply then try to print from the second machine using CUPS.  Instead, use "Spool print documents so program finishes printing faster" instead or another Spooling option.

After it's all said and done, your printer configuration should look similar to the below:

Canon_ip4000_SMB_LPT1
Description: Canon Pixma ip4000 SMB LPT1
Location: smb://PCTWO/CPIX_LPT1
Printer Driver: Canon PIXMA iP4100 – CUPS+Gutenprint v5.2.3
Printer State: idle, accepting jobs, published.
Device URI: smb://PCTWO/CPIX_LPT1

 

PRINTER SETUP: Linux SAMBA printer connected to USB port on Win PC (Canon_ip4000_SMB_USB)

This method is identical to the first one. The one exception is that you will need to replace CPIX_LPT1 as the share name and use CPIX_USB instead. From the Linux installation, we will still need to use SMB for this installation so our configuration will not change above in this regard.  Likewise, this printer configuration appeared as follows:

Canon_ip4000_SMB_USB
Description: Canon Pixma ip4000 SMB USB
Location: smb://PCTWO/CPIX_USB
Printer Driver: Canon PIXMA iP4100 – CUPS+Gutenprint v5.2.3
Printer State: idle, accepting jobs, published.
Device URI: smb://PCTWO/CPIX_USB

 

PRINTER SETUP: Local Linux USB Connection (Canon_IP4000_LOCAL_USB)

One of the other ways we can setup this printer is directly through USB. The page http://localhost:631/ has an auto detect feature under the Administration tab where it lists New Printers Found or Find New Printers depending on the version of CUPS you are using. Checking /var/log/messages I find:

Dec 28 20:29:55 lhs kernel: usb 1-1: configuration #1 chosen from 1 choice
Dec 28 20:29:55 lhs kernel: drivers/usb/class/usblp.c: usblp0: USB Bidirectional printer dev 12 if 0 alt 0 proto 2 vid 0x04A9 pid 0x1093

Which confirms that the system sees my printer.  Running lsusb confirmed a Canon device is connected. (In my case it's the only Canon device)

$ lsusb
Bus 004 Device 001: ID 0000:0000
Bus 005 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 012: ID 04a9:1093 Canon, Inc.
Bus 001 Device 001: ID 0000:0000
$

Having the device number I could now run:

$ lsusb -v -D /proc/bus/usb/001/012
Device: ID 04a9:1093 Canon, Inc. PIXMA iP4000                                                                                                                                      
Device Descriptor:                                                                                                                                                                 
  bLength                18                                                                                                                                                        
  bDescriptorType         1                                                                                                                                                        
  bcdUSB               1.10                                                                                                                                                        
  bDeviceClass            0 (Defined at Interface level)                                                                                                                           
  bDeviceSubClass         0                                                                                                                                                        
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x04a9 Canon, Inc.
  idProduct          0x1093 PIXMA iP4000
  bcdDevice            1.06
  iManufacturer           1 Canon
  iProduct                2 iP4000
  iSerial                 3 204BAA
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xc0
      Self Powered
    MaxPower                2mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         7 Printer
      bInterfaceSubClass      1 Printer
      bInterfaceProtocol      2 Bidirectional
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
Device Status:     0x0001
  Self Powered
$
 

Which confirmed all the details of my Canon iP4000 printer on USB Device 012. This also confirmed the Kernel itself can see the device and I could start setting it up using CUPS as a secondary printer. Under older CUPS versions, I clicked Add This Printer next to Canon iP4000 (Canon iP4000 USB #1) that CUPS detected:

New Printer Found Wizard

On the subsequent page, I again selected Make/Manufacturer as Canon PIXUS iP4100 Ver.2.50 (en) as I did for the SMB client. That's was it!

Under newer versions of CUPS (1.3.9 in this case on Fedora 10), the process was slightly different and resembled the SMB installation earlier.  The only difference is that insttead of Windows printer via SAMBA option I had the option:

Device for Canon_IP4000_LOCAL_USB
Device: Gutenprint USB Printer #1 (Canon iP4000)

CUPS also presented me with the option USB Printer #1 with status redback for Canon BJ(Canon iP4000) but I haven't tried that one at the time.  In case you believe CUPS isn't presenting you with the correct drivers or you check and see that USB isn't there whereas with lsusb you see that your printer is there, simply restart cups using:

$ service cups restart

and see if CUPS picks up your printer second time around.

At some point when configuring local USB connection with CUPS 1.3.9 I got

Bad device-uri "canon_usb:/dev/usb/lp0"!

I checked then to see if /dev/usb/lp0 was there and sure enough it was:

2771961 lrwxrwxrwx 1 root root        7 Feb 19 00:23 /dev/usblp0 -> usb/lp0
2771953 crw-rw—- 1 root lp 180, 0 Feb 19 00:23 /dev/usb/lp0

To resolve the Bad device-uri error above, I did a combination of restarting the CUPS service using

$ service cups restart

and editing /etc/cups/printers.conf then changing the DeviceURI canon:/dev/usb/lp0 to DeviceURI /dev/usb/lp0 then clicking Start Printer button for this Canon_IP4000_LOCAL_USB printer from the http://localhost:631/printers/ tab.  I then reverted to using canon:/dev/usb/lp0 and it then could start/stop the printer fine without any further errors.  Looks like canon or canon_usb before the URI confuses CUPS during setup and the setup can't continue.  The final configuration looked like this:

Canon_IP4000_LOCAL_USB (Default Printer)
Description: Canon Pixma IP4000 (USB)
Location: Canon Pixma IP4000 (USB)
Printer Driver: Canon PIXMA iP4100 – CUPS+Gutenprint v5.2.3
Printer State: idle, accepting jobs, published.
Device URI: usb:/dev/usb/lp0

The new printer was installed and I tested it by printing another test page.  The Pros of this method is that I can print even if the second PC is turned off. You should now proceed to TESTING below.

 

 

PRINTER SETUP: Local Linux LPT1 Connection (Canon_IP4000_LOCAL_LPT1)

Next came the attempt to configure using LPT1 (Parallel Port).  This setup was identical to the above LOCAL USB connection setup.  The only difference was which device we chose from the available options from the listed Devices.

I choose the Parallel Port #1 with status readback for Canon BJ Device that was autodetected but got this further along when selecting the driver.

Bad device-uri "canon_parallel:/dev/par0"!
Bad device-uri "canon_parallel:/dev/unknown-parallel0"!

So, again, I edited /etc/cups/printers.conf and changed the DeviceURI line from canon_parallel:/dev/unknown-parallel0 to parallel:/dev/lp0 which then produced:

Canon_IP4000_LOCAL_LPT1
Description: Canon Pixma IP4000 (LPT1)
Location: Canon Pixma IP4000 (LPT1)
Printer Driver: Canon PIXMA iP4100 – CUPS+Gutenprint v5.2.3
Printer State: idle, accepting jobs, published.
Device URI: parallel:/dev/lp0
 

TESTING

The Printers tab of the CUPS configuration page, where you will return to once setup is complete, will now contain the printer properties for your printer. Try printing a test page by clicking the Print Test Page button/link on the page. During my installation I found that I also needed to configure the Paper Feed: option under Set Printer Options button as well to that of Cassette to have the printer take paper from the bottom tray instead of the top tray.

POST INSTALLATION CHECKS

You can optionally check on a running PID by using strace command:

$ strace -o /path/tracefile.dat -f -p <PROCESS PID>

In this case the process would be cupsd. In a new window, print the contents of some a test document by using something like cat file.xyz | lp (If you have flagged your newly installed printer as a default printer) to print, CTRL-C the strace process and look though the tracefile.dat for missing libraries and/or filters.

Hope you found this helpful.  Be sure to leave a comment, to let me know how things went on your end.

 

 

OTHER ERRORS AND PROBLEMS

E1: At some point during the configuration CUPS UI at http://localhost:631 started to become somewhat unresponsive and my drive light was constantly on.  Turned out my CUPS log file was 3.7GB while CUPS was still doing some processing on it.

The solution here was to clear large files in /var/log/cups.  Some error_log files were 3.7 GB.  Use the below to empty the log (NOTE: This is destructive as it destroys the file contents.) :

$ > /var/log/cups/error_log.0

which cleared the huge log file out.  Of course, I opted to do this since I did not find any use for the old messages however your case may differ.  You'll have to decide.

E2: This error essentially prevented all four options above to print at all and appeared to be a configuration issue in CUPS rather then anything else.  The error was:

Unable to open device file "/dev/lp0": Permission denied

OR

Unable to open device file "/dev/usb/lp0": Permission denied

as the case may be. Checking I see that the device exists fine for both files:

3545563 crw-rw—- 1 root lp 180, 0 Feb 21 00:14 /dev/usb/lp0
809 crw-rw—- 1 root lp 6, 0 Feb 19 22:31 /dev/lp0

So what could be the problem?  Initially setting the device nodes above to owner and group as lp using:

$ chown lp /dev/lp0

which resolved the issue temporarily and printing could continue.  However, when CUPS was restarted, the ownership and access was again reset to root and lp again preventing the printer from printing.  It turned out that a quick glance through my /var/log/message logs hinted at the real permanent solution to this issue:

N [19/Feb/2009:23:04:54 -0500] Group and SystemGroup cannot use the same groups!
I [19/Feb/2009:23:04:54 -0500] Resetting Group to "nobody"…

Checking further I see the goup was sys and group nobody has no access to the device above which was owned by root and group lp.  I then edited /etc/cups/cupsd.conf and changed Group sys to Group lp

$ vi /etc/cups/cupsd.conf +525
.
.
# Group sys
Group lp
.
.

This finally resolved this pesky permission issue once I again restarted the CUPS service.
 

E3: You get The PPD version (156794146) is not compatible with Gutenprint 5.2.5.

Simply reinstall the printer using one of the ways above.  This resolved the issue in this case.

2 Responses to “Linux Pixma Printer Configuration: Canon Pixma iP4000 / iP4100”

  1. […] to restart the cups service.  Then try again using http://localhost:631/ as it should now fix your issue.  You can optionally leave the debug option enabled to catch any other errors that might pop up.  The alternative is to uninstall the cups application using either yum for a less involved process or using rpm for a more involved process.  As an alternate, you could you could check yours against my working version on Fedora 9 below.  For details on Linux printer configuration, please have a look at this handy primer: Linux Pixma Printer Configuration: Canon Pixma iP4000 / iP4100 […]

  2. […] PostsLinux Pixma Printer Configuration: Canon Pixma iP4000 / iP4100Linux / Windows: Error code: 0×80070035 cannot access and Error […]

Leave a Reply

You must be logged in to post a comment.


     
  Copyright © 2003 - 2013 Tom Kacperski (microdevsys.com). All rights reserved.

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License