# [Canon LBP-7200C] Has anybody been able to use this printer?

## WvR

I recently acquired a Canon Satera LBP7200C printer. First annoying point is that is does not have a network connection. My fault, I should have ordered the 'CN' version. I expected that all printers in this class ( USD 650+ ) had a network connection.

CUPS does not support this printer, so I installed the gutenprint package. This package also does not support this printer, so I downloaded the Canon drivers from the Canon website. Now the issue is that Canon uses a language called CAPT to control their printers. After a bit of trouble, I restarted CUPS and tried to install the printer:

1. from CUPS, add printer

2. printer is found on USB, correct driver is suggested (LBP7200C CAPT EN)

3. printer is added I can set the options

4. printer shows up in list of printers as "printer is now online"

5. If I print a test page, there is no error whatsoever, but there is also no print!

I have gone through /var/log/cups/error.log. I have set CUPS to DEBUG logging, restarted CUPS, and checked the error log. There are several mentions of "pstocapt3", which is the program which formats the information for the printer. CUPS then returns with "no error". I found this discussion, which is basically the same problem as I have:

http://forums.debian.net/viewtopic.php?f=7&t=71425

The problem seems to be that CUPS sends its output to CCPD, but for whatever reason CCPD does not work. I have tried all the steps described in the forum posts, and I can confirm that I have the same problem as described there. I have tried many versions of the CAPT driver package; I have even compiled the driver from the source code (which was not easy, but the way). CUPS indicates no error whatsoever, but still there is nothing being printed.

Does anybody here have more experience with the CAPT drivers and the program called "ccpd"? The source code of the CAPT drivers does not contain the source code for "ccpd". Any tips and tricks are welcome![/url]

----------

## WvR

Time for a bump! I don't know if I will ever get it working, but for the time being I have been able to make a littlebit of progress.

Canon Satera LBP7200C Color Laser printer with duplex (there is also a LBP7200CN, which has a network connection, and in some cases the type number is LBP7200Cd and CNd to indicate duplex). This printer uses the CAPT printer language, which is used on many of Canon's printers. These printers are not supported by CUPS nor by the gutenprint package. CUPS does detect the printer, but it assigns the 'usb:' backend, which is wrong, and CUPS does not have the required PPD file. Canon provides a set of drivers. I found several packages on the internet, which all have the same contents more or less:

- linux_capt_printerdriver32_240

- linux_capt_printerdriver64_240

- Linux_CAPT_PrinterDriver_V240_uk_EN

- linux_capt_sources_240 

The last package provides the source code for most of the drivers. However, this package does not compile very easily on a Gentoo system: the Makefiles and configure scripts rely on (very) outdated versions of several tools (automake, etc). I managed to compile the source in the end, but it was not easy, and probably not necessary. All packages have 2 major parts: a set of CAPT drivers, and a set of plugins for CUPS. The pre-compiled packages are in .tar.gz format; un-tarring gives an RPM; I used rpm2tar to change the file to a tar file and then untarred it. I manually copied the files to their intended locations in /etc and /usr.

The Canon packages contain a cups filter named 'ccp'. This file is in the wrong location for recent version of CUPS. so to get it properly detected, move it to the right location:

```
# ln -s /usr/lib64/cups/backend/ccp /usr/libexec/cups/backend/ccp

# /etc/init.d/cupsd restart

# lpinfo -v
```

You should see a line with 'direct ccp', this is the Canon backend for CUPS. Also, the pstocapt3 script is in the wrong location:

```
# ln -s /usr/lib64/cups/filter/pstocapt3 /usr/libexec/cups/filter/pstocapt3
```

Now it is possible to add the printer to CUPS:

```
# /usr/sbin/lpadmin -p test -m /usr/share/cups/model/CNCUPSLBPxxxxCAPTK.ppd -v ccp://localhost:59687 -E
```

The files CNCUPSLBPxxxxCAPTK.ppd come from the Canon driver package. Replace 'xxxx' with the number appropriate for your printer. The next step is to inform the ccp backend of the printer. In my case, the printer is connected to /dev/usb/lp1:

```
 # /usr/sbin/ccpdadmin -p test -o /dev/usb/lp1

 CUPS_ConfigPath = /etc/cups/

 LOG Path        = None

 UI Port         = 59787

 Entry Num  : Spooler   : Backend       : FIFO path             : Device Path   : Status

 ----------------------------------------------------------------------------

     [0]    : test            : ccp           : //localhost:59687     : /dev/usb/lp1  : New!!
```

Then start the CCPD daemon:

```
# /etc/init.d/ccpd start

# /etc/init.d/ccpd status

/usr/sbin/ccpd: PID1 PID2
```

If there are two numbers, that means that the ccpd is OK.

Now here comes the frustrating part: the previous steps are explained on several pages on the internet. I can use

```
# captstatusui -P test
```

which starts a small utility program (it comes from the Canon driver package). I can use that program and select to do "calibration", and indeed, the printer starts to make some noises. But if I print something from CUPS (test page), CUPS indicates that all is well, but nothing shows up in the status monitor, and nothing is printed. So it seems that CUPS hands the job to the ccpd daemon, but the job is not handled correctly, but there are no error messages. Also:

```
# /usr/sbin/ccpd
```

gives no output - impossible to tell if everything is going well or not. So if siomebody has some ideas....  :Wink: )

----------

## WvR

Again a bump. If I run 

```
# /usr/local/bin/captstatusui -P test
```

then the printer is correctly displayed. If I use the captstatusui program, I can check for the number of prints that have been made (I printed some documents from Windows, and the counters are correctly reported in linux); I can "calibrate" the printer; I can set the paper size in the tray; etc. In other words, it seems that the captstatusui program is successfully communicating with the printer over the USB connection. This tells me that most of the connection is functioning correctly.

However, still I cannot print from CUPS to this printer. Like before, the CUPS log shows no errors. CUPS hands the job to the Canon backend software, and returns with a "successful completion". So apparently the Canon software is not working correctly.

I would like to find out what goes on with the USB signals when I am printing. When CUPS gives the data to the Canon backend, it is interesting to find out if there is any communication on the USB port. If there is, then apparently the wrong data is being sent; if there is no communication to the printer, then apparently the Canon backend does not function or it sends output to the wrong place.

I need advice from more experienced users: what kind of software is there to analyze the data traffic on the USB ports? How can I find out where the Canon backend is sending signals?  (maybe "strace" program? How does that work?)

----------

## WvR

A new week, a new bump. Is there really nobody here who knows more about inspecting data traffic on the USB ports?

OK, Canon Satera LBP7200C - still does not work, reasons are unclear.

- Canon delivers a small utility program with the set of CAPT printer drivers. With this utility program I can see that the printer is connected to the PC, and I can order the printer to do certain tasks, such as calibration.

- Communication between PC and printer is thus OK

- to print a page, the following sequence occurs in CUPS: CUPS -> pstops -> pstocapt3 (to make a CAPT file for the printer) -> ccp backend. The CUPS log file mentions that all these processes are started and finish successfully.

- I've checked the source code of the ccp backend program. There is a point where a stream of data is prepared to be output to the printer. Since the ccp backend returns with zero error code, the data stream is apparently successfully prepared. So, the data stream is either sent to the printer, but the stream is wrong, or it is not sent to the printer and ends up, apparently successfully, in an unknown place

- So, I have re-installed the printer, but this time, on purpose I selected the wrong data port on the USB system. I selected the data port for another printer. And guess what: when I print a test page to the wrong printer, it starts to process the data, and it starts to warm up! This tells me that the ccp backend does send the data to the relevant data port, but somehow, the Canon printer is not satisfied with the stream of data and silently rejects it (on the Canon printer, there is no indication of any activity at all when I send a test page).

- The ccp backend sends data to the CCPD daemon program, which I have in /usr/sbin/ccpd ; this program has no source code.

- Thus: the CCP backend makes a stream of data, and it ends up on the correct data port. But either this stream is malformed (error in ccp backend ?), or it is not handled well by the ccpd program (?).

Any hints are appreciated!

----------

## kimmie

Just a hunch, but I vaguely remember issues with the usblp kernel module and some printers. Probably, I just didn't have it when I got some USB printer going in the distant past, but it seems for some printers you need the module, others don't like it. Take a look at https://wiki.archlinux.org/index.php/CUPS#Blacklisting_usblp

If you want to monitor USB data, you need to build your kernel with CONFIG_USB_MON=Y; from the kernel config help:

```
CONFIG_USB_MON:

  │                                                                         │   

  │ If you select this option, a component which captures the USB traffic   │   

  │ between peripheral-specific drivers and HC drivers will be built.       │   

  │ For more information, see <file:Documentation/usb/usbmon.txt>.          │   

  │                                                                         │   

  │ If unsure, say Y, if allowed, otherwise M.                              │   

  │                                                                         │   

  │ Symbol: USB_MON [=n]                                                    │   

  │ Type  : tristate                                                        │   

  │ Prompt: USB Monitor                                                     │   

  │   Defined at drivers/usb/mon/Kconfig:5                                  │   

  │   Depends on: USB_SUPPORT [=y] && USB [=m]                              │   

  │   Location:                                                             │   

  │     -> Device Drivers                                                   │   

  │       -> USB support (USB_SUPPORT [=y])
```

----------

## WvR

Thanks Kimmie. I checked the ArchLinux information. I don't really know what the Gentoo equivalent of the "usblp module" would be. I built a kernel with 

```
CONFIG_USB_PRINTER=n
```

but that only makes things worse: CUPS shows no USB connectivity whatsoever in this case, and when I run the "captstatusui" program, I get "Communication Error". Also, my other USB printers all become inaccessible.

As indicated in the ArchLinux docs, I have checked the USB connections. Indeed, I have

```

rine50 linux # lsusb

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub

Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub

Bus 001 Device 003: ID 147e:2016 Upek Biometric Touchchip/Touchstrip Fingerprint Sensor

Bus 001 Device 004: ID 17ef:1005 Lenovo 

Bus 001 Device 005: ID 04b8:0017 Seiko Epson Corp. 

Bus 001 Device 006: ID 04a9:26f1 Canon, Inc. 

Bus 001 Device 007: ID 0557:7000 ATEN International Co., Ltd Hub

Bus 001 Device 008: ID 04b3:3108 IBM Corp. 800dpi Optical Mouse w/ Scroll Point

Bus 001 Device 009: ID 04b3:3025 IBM Corp. 

```

and 

```

rine50 linux # ls -la /dev/bus/usb/001/006

crw-rw-r-- 1 root lp 189, 5  2月 28  2012 /dev/bus/usb/001/006

```

udev correctly identifies it as a printer and sets the proper things in /dev/bus/usb. If I set 

```

rine50 linux # ccpdadmin

Usage: 

  ccpdadmin [-p Printer-name -o Printer-dev-path]

  ccpdadmin [-x Remove-Printer-name]

 CUPS_ConfigPath = /etc/cups/

 LOG Path        = /var/log/CCPD/

 UI Port         = 59787

 Entry Num  : Spooler   : Backend   : FIFO path      : Device Path    : Status 

 ----------------------------------------------------------------------------

     [0]    : test    : ccp       : //localhost:59687    : /dev/bus/usb/001/006    : 

```

then I have the same situation as before: with CONFIG_USB_PRINTER=y, the captstatusui program lists the printer and can talk to it, but I cannot print. With CONFIG_USB_PRINTER=n, captstatusui gives "Communication Error".  :Sad: (

----------

## kimmie

Ah, well, that sucks. Wasn't that then. Gentoo uses the usblp module too... when you set CONFIG_USB_PRINTER=m, it builds the usblp.ko kernel module, if you use =Y it's built-in to the kernel rather than a module. There shouldn't be any difference between =M and =Y.

How about the section "If the status monitor works but printing does not," at the end of https://help.ubuntu.com/community/CanonCaptDrv190, have you come across that yet?

Other things I would try would be using CUPS 1.3 instead of 1.4.

But I'm flying blind really, just making random suggestions....

----------

## WvR

Yes, I already read the info from the Ubuntu forum. It refers to an (apparently) older version of the CCPD/CAPT drivers where the communication to the printer was routed through /var/ccpd/fifo0. I have set that fifo (using mkfifo) and tried to connect, but no luck  :Crying or Very sad:  Several other places on the internet mention the same /var/ccpd/fifo0, I have tried to create it and connect through it but it doesn't seem to help.

The most recent version of CCPD/CAPT apparently connects (by default) through port 59687 for the data, and port 59787 for the UI. From /etc/ccpd.conf

```

<Printer test>

DevicePath /dev/usblp1

</Printer>

<Ports>

# Status monitoring socket port.

#  Default 59787

UI_Port  59787

PDATA_Port  59687

</Ports>

```

The /etc/ccpd.conf file also holds a setting for a log file, but although I set it to a valid directory there is no log file anywhere. The settings in /etc/ccpd.conf are set (I suspect) throught /usr/sbin/ccpdadmin. The port numbers also show up in the source code of /usr/libexec/cups/backend/ccp .

The captstatusui communicates through port 59787. When captstatusui sends an instruction to the printer, I wonder if it goes through 59787 or 59687.... Maybe 59687 is somehow special?

Downgrading to CUPS 1.3 could be an option, but only as a last resort...

----------

## WvR

Bump! I still have not been able to get my printer working. I am fiddling around and I noticed the following:

```
# strace -ff /usr/bin/ccpd

 [ Process PID=5150 runs in 32 bit mode. ]

[pid  5150] time(NULL)                  = 1331181753

[pid  5150] time(NULL)                  = 1331181753

[pid  5150] time(NULL)                  = 1331181753

[pid  5150] select(13, [12], [], NULL, {1, 0} <unfinished ...>

[pid  5149] <... setuid resumed> )      = 0

[ Process PID=5149 runs in 64 bit mode. ]

```

The PIDs 5149 and 5150 are started by /etc/init.d/ccpd start. Is it a problem that the two PIDs run in different modes? Is it possible to somehow force both PIDs to run in the same mode? I tried Google but found to relevant answers.

----------

## quezak

I'm also trying to get this printer working, only in my case it's connected by network.

As previous posts mentioned, CCPD works correctly (printed pages number in captstatusui checks correctly).

Netstat shows that CCPD is up and listens on its port: 

```
tcp        0      0 0.0.0.0:59687           0.0.0.0:*               LISTEN      4458/ccpd          

tcp        0      0 0.0.0.0:59787           0.0.0.0:*               LISTEN      4458/ccpd 
```

The printer is shown in ccpdadmin:

```
 Entry Num  : Spooler   : Backend   : FIFO path      : Device Path    : Status 

 ----------------------------------------------------------------------------

     [0]    : canon    : ccp       : //localhost:59687    : net:10.254.128.78    : 
```

And, printer is set up in CUPS as suggested, with URI "ccp://localhost:59687"

CUPS processes documents well, but gives errors when trying to send the result to CCPD, producing the following in /var/log/cups/error_log

```

...

D [15/May/2012:14:51:04 +0200] [Job 61] Wrote 1 pages...

D [15/May/2012:14:51:04 +0200] [Job 61] PID 4807 (pstops) exited with no errors.

D [15/May/2012:14:51:04 +0200] [Job 61] PID 4806 (pdftops) exited with no errors.

D [15/May/2012:14:51:04 +0200] [Job 61] opvpOpenPrinter(463)

D [15/May/2012:14:51:04 +0200] [Job 61] CStubOpenPrinter(397)

D [15/May/2012:14:51:04 +0200] [Job 61] opvpOpenPrinter(463)

D [15/May/2012:14:51:04 +0200] [Job 61] CStubOpenPrinter(397)

D [15/May/2012:14:51:04 +0200] [Job 61] Error Response:ReqNo=2, SeqNo=3,opvpErrorNo=-2

D [15/May/2012:14:51:04 +0200] [Job 61] Error Response:ReqNo=5, SeqNo=4,opvpErrorNo=-2

D [15/May/2012:14:51:04 +0200] [Job 61] Error Response:ReqNo=7, SeqNo=153,opvpErrorNo=-2

D [15/May/2012:14:51:04 +0200] [Job 61] Error Response:ReqNo=8, SeqNo=8006,opvpErrorNo=-2

D [15/May/2012:14:51:04 +0200] [Job 61] GPL Ghostscript 9.04: Unrecoverable error, exit code 1

D [15/May/2012:14:51:04 +0200] [Job 61] Error Response:ReqNo=6, SeqNo=8007,opvpErrorNo=-2

D [15/May/2012:14:51:04 +0200] [Job 61] Error Response:ReqNo=3, SeqNo=8008,opvpErrorNo=-2

D [15/May/2012:14:51:04 +0200] [Job 61] Set job-printer-state-message to "ccp send_data error, exit", current level=ERROR

D [15/May/2012:14:51:04 +0200] [Job 61] Backend returned status 1 (failed)

D [15/May/2012:14:51:04 +0200] [Job 61] Printer stopped due to backend errors; please consult the error_log file for details.

D [15/May/2012:14:51:04 +0200] [Job 61] End of messages

D [15/May/2012:14:51:04 +0200] [Job 61] printer-state=5(stopped)

D [15/May/2012:14:51:04 +0200] [Job 61] printer-state-message="ccp send_data error, exit"

D [15/May/2012:14:51:04 +0200] [Job 61] printer-state-reasons=paused

```

Any clue why cups can't talk to ccpd in my case?

----------

## WvR

 *quezak wrote:*   

> 
> 
> ```
> 
> ...
> ...

 

As indicated in the above message, have you checked the error_log of CUPS ( /var/log/cups/error_log )? From the very last message ( printer-state-reasons=paused ) it seems that the printer was "paused" when CUPS tried to send the data to the CCPD backend. 

It seems you are stuck at the same point where I (still) am: you can talk to the printer with the "captstatusui" program, sending data from CUPS is apparently succesfull, yet nothing is actually printed. Can you confirm that you can do things like "cleaning" and "calibration" from the captstatusui window?

----------

## thecopy

I am glad to report that i have solved the issue, i am now able to print with my LBP6300.

The problem for me was apparently ghostscript. What gave it away was the following in error_log (with verbosity set to debug):

 *Quote:*   

> erik@workstationubuntu:~$ cat /var/log/cups/error_log | grep "21170"
> 
> I [26/May/2012:00:02:13 +0200] [Job 59] Started filter /usr/lib/cups/filter/pstocapt3 (PID 21170)
> 
> D [26/May/2012:00:02:14 +0200] PID 21170 (/usr/lib/cups/filter/pstocapt3) did not catch or ignore signal 13. 

 

I had to install something called the gs-esp transitional package:

http://packages.ubuntu.com/lucid/gs-esp

You can read the whole process here:

http://ubuntuforums.org/showthread.php?t=1983091

The reason it worked to clean from captstatusui was probably that these routines were stored in the printer and the page data didn't need to be transmitted from the computer to the printer, and the ghostscript pdf interpreter  failed when doing something to the personal page data to be transmitted. 

edit: Note that I'm not using Gentoo but Ubuntu, but the process should be the same i guess -- it was a long time since i last tried out Gentoo

----------

## WvR

Thanks for the info. I don't have time right now, but I will remember that you posted this and I will try to fix it in the future.

----------

## quezak

 *WvR wrote:*   

> As indicated in the above message, have you checked the error_log of CUPS ( /var/log/cups/error_log )?

 

the code I pasted IS a part of /var/log/cups/error_log  :Smile: 

 *thecopy wrote:*   

> edit: Note that I'm not using Gentoo but Ubuntu, but the process should be the same i guess -- it was a long time since i last tried out Gentoo

 

The package "gs-esp" contains only some changelogs and a preinst script, which does only this:

```
   # Do away with update-alternative for /usr/bin/gs, we have one

   # grand unified Ghostscript now!

        if dpkg --compare-versions "$2" lt-nl "8.63.dfsg.1-1"; then

            update-alternatives --remove-all gs || true

            update-alternatives --remove-all gs.1 || true

        fi

```

Google says it's some kind of ubuntu's symlink management... On my gentoo have only one 'gs' binary, and only one ghostscript package installed, so I don't think the process is the same.

Any clues what to do now? I'm stuck where WvR is, meaning I can check status, do cleaning/calibration from captstatusui, but CUPS fails at sending data to CCPD...

----------

## omerkh

I have been able to install the LBP2900 using the following:

```
=net-print/cndrvcups-capt-2.00-r2

=net-print/cndrvcups-common-2.00-r2
```

from the "calculate" layman repository. During install, I set USE="cngplp" and followed the instructions at the end of the install. I am reproducing them here for others, maybe it will apply the same to your printer:

```
 * To get your printer working you need to restart cupsd

 * 

 * /etc/init.d/cupsd restart

 * 

 * Now you can add your printer with either the webinterface or lpadmin

 * 

 * /usr/sbin/lpadmin -p LBP3010 -m CNCUPSLBP3050CAPTK.ppd -v ccp:/var/ccpd/fifo0 -E

 * 

 * Replace 3050 with either on of the following printers:

 * 1120 1210 2900 3000 3050 3200 3210 3300 5000

 * 

 * Now you must register the printer in ccpd, if connected with usb

 * 

 * /usr/sbin/ccpdadmin -p LBP3010 -o /dev/usb/lp0

 * 

 * Notice that you can't use LPT port with this driver.

 * If you have a network connection to your printer use -o net:<IP OF PRINTER>

 * instead of -o /dev/usb/lp0

 * See manual for more information,  guide-capt-1.3xE.tar.gz at 

 * http://software.canon-europe.com/software/0023675.asp

 * 

 * Now you can go ahead and start the ccpd daemon

 * 

 * /etc/init.d/ccpd start

 * 

 * If you have more then one printer just create more fifos in

 * /var/ccpd/ , increase the fifo number for more printers

 * 

 * mkfifo -m 600 /var/ccpd/fifo1; chown lp:lp /var/ccpd/fifo1

 * 

 * If you reinstall make sure the fifo is created in /var/ccpd, if not

 * just reinstall again. This is due to bug #136199
```

And yes, a test page printed fine as well. My system is a 64 bit Gentoo.[/code]

----------

## gsra99

Did you solve the printing problem? I have the Canon LBP6200d and I use the cndrvcups-common and cndrvcups-capt from the rpm packages. I also needed to create symlinks to pstocapt, pstocapt2, and pstocapt3. For the driver to work you need the kernel usb printer module, and I have it built as a module. However, I am not sure if it can be built into the kernel or needs to be a module. Finally, if you do use the kernel usb printer module, which obviously you need to for these drivers, you need to remove the cups usb module, i.e. emerge cups without the usb useflag. I suspect this is what may be causing you problems. You can then setup udev rules to automatically start/stop ccpd daemon when you turn the printer on/off.

/etc/udev/rules.d/85-canon-capt.rules

```
KERNEL=="lp*", SUBSYSTEMS=="usb", ACTION=="add", ATTRS{idVendor}=="04a9", RUN+="/bin/bash /etc/init.d/ccpd start"

KERNEL=="lp*", SUBSYSTEMS=="usb", ACTION=="remove", RUN+="/bin/bash /etc/init.d/ccpd stop"
```

----------

