Difference between revisions of "Canon CAPT"

From ArchWiki
Jump to: navigation, search
m (Marked as "out of date" according to http://archlinux.org.ru/forum/topic/10861/?page=1#post-100201)
m (add ja link)
 
(16 intermediate revisions by 9 users not shown)
Line 1: Line 1:
 
[[Category:Printers]]
 
[[Category:Printers]]
{{out of date}}
+
[[ja:Canon CAPT]]
=Introduction=
+
{{Related articles start}}
This is a brief manual about how to make '''Canon i-sensys LBP2900''' (LBP2900) to work with arch. This manual can be also applied on folowing printer models:
+
{{Related|CUPS}}
LBP3010/LBP3018/LBP3050, LBP3100/LBP3108/LBP3150, LBP3250, LBP3310, LBP5100, LBP5300, LBP3500, LBP3300, LBP5000, LBP3210, LBP3000, LBP2900, LBP3200, LBP-1120, LBP-1210
+
{{Related|CUPS/Printer-specific problems}}
 +
{{Related articles end}}
  
'''Note: if you can find your printer model on the list use this manual, and switch [printer model] with your printer model'''
+
{{Note|See [[CUPS]] for the main article, and [[CUPS/Printer-specific problems]] for information on non-CAPT Canon printers}}
=Requirements=
+
*cups
+
*ghostscript
+
*gsfonts
+
*rpmextract.sh
+
*system-config-printer (system-config-printer-gnome/kdeadmin-system-config-printer-kde)
+
Install with:
+
# pacman -S cups ghostscript gsfonts rpmextract system-config-printer
+
  
== Additional requirements on Arch64 ==
+
CAPT is Canon's proprietary Canon Advanced Printing Technology (CAPT) driver, supporting the '''Canon i-Sensys''' series of laser printers. For more information, see [https://help.ubuntu.com/community/CanonCaptDrv190 Setting up CAPT printers on Ubuntu].
  
*lib32-libcups
+
== Configuration ==
*(old packages: lib32-cups)
+
*lib32-heimdal
+
*lib32-libxml2
+
*lib32-popt [https://aur.archlinux.org/packages.php?ID=19535 from aur version 1.16-5]
+
  
Install with:
+
{{Note|Installing CAPT printers via the CUPS web interface may not work. [http://askubuntu.com/a/464334] Instead, use the manual method described below.}}
# pacman -S lib32-libcups lib32-heimdal lib32-libxml2
+
  
And build the aur package using [[ABS]].
+
Register the printer with CUPS using ''lpadmin'':
  
=Driver=
+
# lpadmin -p ''printer_model'' -m ''printer_ppd_file'' -v ccp://localhost:59687 -E
*http://gdlp01.c-wss.com/gds/4/0900007724/11/Linux_CAPT_PrinterDriver_V230_uk_EN.tar.gz
+
Also you can search in http://software.canon-europe.com/ for your printer driver, newest version is v240 at least for the lbp-3200 (checked april 2012).
+
  
For information about setting up cups, refer to [[CUPS]].
+
Find the right PPD inside {{ic|/usr/share/cups/model}}. For the printer model, use the ''ShortNickName'' found inside the PPD, or take it directly from the file name, for example {{ic|CNCUPS'''LBP6310'''CAPTK.ppd}}.
  
=Installation=
+
Alternatively, check the table provided on the [https://help.ubuntu.com/community/CanonCaptDrv190 Ubuntu help page], which matches each supported printer with its corresponding PPD.
Download the driver and extract it:
+
# wget http://gdlp01.c-wss.com/gds/4/0900007724/11/Linux_CAPT_PrinterDriver_V230_uk_EN.tar.gz
+
# tar -xvf Linux_CAPT_PrinterDriver_V230_uk_EN.tar.gz
+
# cd Linux_CAPT_PrinterDriver_V230_uk_EN/32-bit_Driver/RPM
+
or: # cd Linux_CAPT_PrinterDriver_V230_uk_EN/64-bit_Driver/RPM (on Arch 64-bit)
+
# rpmextract.sh *
+
The last command above will extract all rpm-s and merge all directories that were stored in them. So basically you'll get two directories: '''etc''' and '''usr'''. Next thing you need to do is to open '''etc''' directory and change '''init.d''' to '''rc.d'''. You can also do it by command:
+
# mv etc/init.d etc/rc.d
+
Now you can remove rpm-s:
+
# rm *.rpm
+
and execute the next command which will merge '''etc''' and '''usr''' directories with appropriate ones in '''/''' directory:
+
# cp -var * /
+
  
=Restart cups=
+
{{Note|1=Some models have multiple PPDs, where the last letter indicates the regional model (J = Japan, K = United Kingdom, S = United States)}}
# /etc/rc.d/cupsd restart
+
=Add cups daemon in '''/etc/rc.conf'''=
+
Open /etc/rc.conf with a text editor of your choice (e.g. nano), and put cups in the list of daemons:
+
DAEMONS=(... @bluetooth cupsd gdm)
+
  
=Make folowing directories and fifo0=
+
For example, for the Canon LBP6310dn (UK model), run:
  # mkdir /var/ccpd /var/captmon
+
 
  # mkfifo /var/ccpd/fifo0
+
  # lpadmin -p LBP6310 -m CNCUPSLBP6310CAPTK.ppd -v ccp://localhost:59687 -E
Make fifo0 accessable to everyone:
+
 
  # chmod 777 /var/ccpd/fifo0
+
Next, register the printer with the CAPT driver itself via ''ccpdadmin''. Replace {{ic|''printer_model''}} with the model you found earlier (e.g. {{ic|LBP6310}}), and {{ic|''printer_address''}} with either the USB port (e.g. {{ic|/dev/usb/lp0}}) in case of a local printer, or the IP address, prefixed by {{ic|net:}} (e.g. {{ic|net:192.168.1.100}}) in case of a network printer:
Change the owner of fifo0 into root:
+
 
  # chown root /var/ccpd/fifo0
+
  # ccpdadmin -p ''printer_model'' -o ''printer_address''
=Register printer=
+
 
Register the printer driver with the print spooler with the following command, replacing [printer model] with your printer model and [printer driver file] with your driver file:
+
For example, for a USB printer:
# /usr/sbin/lpadmin -p [printer model] -m [printer driver file] -v ccp://localhost:59787 -E
+
 
 +
  # ccpdadmin -p LBP6310 -o /dev/usb/lp0
 +
 
 +
Or for a network printer:
 +
 
 +
  # ccpdadmin -p LBP6310 -o net:192.168.1.100
 +
 
 +
[[Start]]/[[enable]] the CAPT daemon with {{ic|ccpd.service}}.
 +
 
 +
==CAPT status monitor==
 +
 
 +
===Local CUPS===
 +
The driver includes a status monitor which can be launched with
 +
 
 +
$ captstatusui -P ''printer_model''
 +
 
 +
e.g.
 +
 
 +
$ captstatusui -P LBP6310
 +
 
 +
If you only want the status monitor to pop up when a problem occurs, simply append the {{ic|-e}} switch:
 +
 
 +
$ captstatusui -P LBP6310 -e
 +
 
 +
===Remote CUPS===
 +
 
 +
Unfortunately, a local installation of captstatusui will not detect CAPT printers on a remote CUPS server.
 +
 
 +
Remote print monitoring can be achieved, however, using [[SSH]] and [[Secure_Shell#X11_forwarding|X11 forwarding]].
 +
 
 +
{{Warning|X11 forwarding has important security implications, especially when using the {{ic|-Y}} switch (''ForwardX11Trusted'', required for the CAPT status monitor to work via X11 Forwarding). See [[Secure_Shell#X11_forwarding|X11 forwarding]] for further information.}}
 
   
 
   
(old method - now wrong: # /usr/sbin/lpadmin -p [printer model] -m [printer driver file] -v ccp:/var/ccpd/fifo0 -E)
+
{{Note|There are many ways to set up X11 forwarding. For security reasons, this example is based on public key authentication, a dedicated SSH user account, and SSH running on the CUPS server. Adapt these instructions to your specific configuration.}}
for this manual it would be
+
 
  # /usr/sbin/lpadmin -p LBP2900 -m CNCUPSLBP2900CAPTK.ppd -v ccp://localhost:59787 -E
+
====Client configuration====
   
+
* create a new [[SSH keys|SSH key]] {{ic|~/.ssh/capt}} and [[SSH_keys#Copying_the_public_key_to_the_remote_server|copy the public key to the remote server ]]
(old method - now wrong: # /usr/sbin/lpadmin -p LBP2900 -m CNCUPSLBP2900CAPTK.ppd -v ccp:/var/ccpd/fifo0 -E)
+
* create a file {{ic|captstatusui.sh}} with the following content, make it executable and place it in your [[autostart]] folder:
Register the printer with ccpd daemon, once again replace [printer model] with your printer model:
+
 
# /usr/sbin/ccpdadmin -p [printer model] -o /dev/usb/lp0
+
  #!/bin/sh
in this case it is:
+
  ssh -T -Y -i ~/.ssh/capt ''remote_server_hostname_or_IP_address'' < /dev/null
  # /usr/sbin/ccpdadmin -p LBP2900 -o /dev/usb/lp0
+
 
 +
====Server configuration====
 +
 
 +
* create a new user {{ic|capt}}
 +
* append the following section to {{ic|/etc/ssh/sshd_config}} and [[restart]] the SSH daemon or socket
 +
 
 +
...
 +
Match User capt
 +
        X11Forwarding yes
 +
        PermitTTY no
 +
        ForceCommand captstatusui -P ''printer_model'' -e
 +
        AuthenticationMethods publickey
 +
 
 +
e.g.
 +
 
 +
  ...
 +
Match User capt
 +
        X11Forwarding yes
 +
        PermitTTY no
 +
        ForceCommand captstatusui -P LBP6310 -e
 +
        AuthenticationMethods publickey
  
=Make udev rule for your printer=
+
This can be extended to include multiple users (using a single, shared SSH key or each with a unique SSH key) by adding each user to a {{ic|capt}} group, then using a Match Group rule:
Create an udev rule so when you turn the printer on, printer daemon (ccpd) will start:
+
# echo -e '#Own udev rule for Canon-CAPT\nSUBSYSTEM=="usb", KERNEL=="lp*", RUN+="/etc/rc.d/ccpd restart"' <no line break>
+
> /etc/udev/rules.d/85-canon-capt.rules
+
Reload Rules:
+
# udevadm control --reload-rules
+
More about udev rules you can see here: http://reactivated.net/writing_udev_rules.html
+
  
=Start printer daemon and print=
+
  ...
  # /etc/rc.d/ccpd start
+
Match Group capt
The printer should now be installed. You could test it by pressing the Print Test Page button.  
+
        X11Forwarding yes
=Turboprint=
+
        PermitTTY no
{{stub}}
+
        ForceCommand captstatusui -P LBP6310 -e
=Related Links/Additional Information=
+
        AuthenticationMethods publickey
https://help.ubuntu.com/community/HardwareSupportComponentsPrinters/CanonPrinters/Canon_LBP_2900 - A guide for setting up the printer on ubuntu
+

Latest revision as of 11:29, 17 February 2016

Note: See CUPS for the main article, and CUPS/Printer-specific problems for information on non-CAPT Canon printers

CAPT is Canon's proprietary Canon Advanced Printing Technology (CAPT) driver, supporting the Canon i-Sensys series of laser printers. For more information, see Setting up CAPT printers on Ubuntu.

Configuration

Note: Installing CAPT printers via the CUPS web interface may not work. [1] Instead, use the manual method described below.

Register the printer with CUPS using lpadmin:

# lpadmin -p printer_model -m printer_ppd_file -v ccp://localhost:59687 -E

Find the right PPD inside /usr/share/cups/model. For the printer model, use the ShortNickName found inside the PPD, or take it directly from the file name, for example CNCUPSLBP6310CAPTK.ppd.

Alternatively, check the table provided on the Ubuntu help page, which matches each supported printer with its corresponding PPD.

Note: Some models have multiple PPDs, where the last letter indicates the regional model (J = Japan, K = United Kingdom, S = United States)

For example, for the Canon LBP6310dn (UK model), run:

# lpadmin -p LBP6310 -m CNCUPSLBP6310CAPTK.ppd -v ccp://localhost:59687 -E

Next, register the printer with the CAPT driver itself via ccpdadmin. Replace printer_model with the model you found earlier (e.g. LBP6310), and printer_address with either the USB port (e.g. /dev/usb/lp0) in case of a local printer, or the IP address, prefixed by net: (e.g. net:192.168.1.100) in case of a network printer:

# ccpdadmin -p printer_model -o printer_address

For example, for a USB printer:

# ccpdadmin -p LBP6310 -o /dev/usb/lp0

Or for a network printer:

# ccpdadmin -p LBP6310 -o net:192.168.1.100

Start/enable the CAPT daemon with ccpd.service.

CAPT status monitor

Local CUPS

The driver includes a status monitor which can be launched with

$ captstatusui -P printer_model

e.g.

$ captstatusui -P LBP6310

If you only want the status monitor to pop up when a problem occurs, simply append the -e switch:

$ captstatusui -P LBP6310 -e

Remote CUPS

Unfortunately, a local installation of captstatusui will not detect CAPT printers on a remote CUPS server.

Remote print monitoring can be achieved, however, using SSH and X11 forwarding.

Warning: X11 forwarding has important security implications, especially when using the -Y switch (ForwardX11Trusted, required for the CAPT status monitor to work via X11 Forwarding). See X11 forwarding for further information.
Note: There are many ways to set up X11 forwarding. For security reasons, this example is based on public key authentication, a dedicated SSH user account, and SSH running on the CUPS server. Adapt these instructions to your specific configuration.

Client configuration

#!/bin/sh
ssh -T -Y -i ~/.ssh/capt remote_server_hostname_or_IP_address < /dev/null

Server configuration

  • create a new user capt
  • append the following section to /etc/ssh/sshd_config and restart the SSH daemon or socket
...
Match User capt
       X11Forwarding yes
       PermitTTY no
       ForceCommand captstatusui -P printer_model -e
       AuthenticationMethods publickey

e.g.

...
Match User capt
       X11Forwarding yes
       PermitTTY no
       ForceCommand captstatusui -P LBP6310 -e
       AuthenticationMethods publickey

This can be extended to include multiple users (using a single, shared SSH key or each with a unique SSH key) by adding each user to a capt group, then using a Match Group rule:

...
Match Group capt
       X11Forwarding yes
       PermitTTY no
       ForceCommand captstatusui -P LBP6310 -e
       AuthenticationMethods publickey