CUPS Server

This HowTo provides information on installing and configuring a Common Unix Printing System on OpenWrt.

FIXME This guide is incomplete. Try googeling for help, or try this http://blog.jameslick.com/?p=867

Preparation

Prerequisites

  1. obtain usb.essentials basic USB support or (parport Parallel Port support)
  2. drivers
  3. kernel module for USB printers: opkg install kmod-usb-printer
  4. Firewall: open ports tcp and udp.

CUPS mandatory uses spooling, which means that the entire print job data gets stored in a buffer (on harddisc or in RAM) before the printing is even started. Dependent of what you want to print, your resources are probably that limited that you should not use CUPS. But of course you can add resources to your hardware, like say connect a harddisc per USB.

  1. usb.storage to mount a filesystem or a SWAP partition. This should massively upgrade your endowment.
  2. you cannot mount SWAP over network but you could mount any other filesystem over the network and park the data there, see filesystem

Required Packages

Server (OpenWrt)

Name Version Size in Bytes Description
cups 1.4.4-1 2 217 619 A printer spooling system for devices with USB or LP support.
zlib 1.2.5-1 39 388 Library implementing the deflate compression method
libpthread 0.9.32-65 30 717 POSIX thread library
libpng 1.2.44-1 128 723 A PNG format files handling library
libjpeg 6b-1 61 963 The Independent JPEG Group's JPEG runtime library
libstdcpp 4.3.3+cs-65 232 642 GNU Standard C++ Library v3
cups-bjnp 0.5.4-1 11 293 (optional) Description: CUPS backend for the canon printers using the proprietary USB over IP BJNP protocol. This backend allows Cups to print over the network to a Canon printer. It currently supports Cups 1.2 and Cups 1.3 and is designed by reverse engineering.

Client (your PCs)

On Linux you need FIXME
On Windows you need FIXME

Cups Windows X64 Driver and Installation Notes

On MacOSX you need FIXME

Installation

opkg

opkg install cups
vi /etc/cups.conf
If you have external storage, change the CUPS spool directory so that it resides on this storage:  
vi /etc/cups/cupsd.conf and change- RequestRoot /opt/var/spool/cups
. /etc/init.d/cupsd enable
. /etc/init.d/cupsd start
netstat -a
iptables -I INPUT -j ACCEPT -i eth0.1 -p tcp --port ?????
iptables -I INPUT -j ACCEPT -i eth0.1 -p udp --port ?????

Configuration

CUPSD configuration

Configure /etc/cups/cups.conf according to man cupsd.conf

???

Assuming the daemon is already running, use the command . /etc/init.d/cupsd restart to make your changes take effect immediately.

Client configuration

Linux

FIXME maybe this helps: configure.the.clients.for.printing? or not.

Windows

FIXME

Mac OS X

FIXME

Start on boot

To enable/disable start on boot: /etc/init.d/cupsd enable this simply creates a symlink: /etc/rc.d/S??cupsd → /etc/init.d/cupsd /etc/init.d/cupsd disable this removes the symlink again

Administration

Login to OpenWrt and edit /etc/cups/cups.conf. Restart cupsd.

Log Messages

Check cupsd to lern what they mean.

Troubleshooting

*!!!IMPORTANT!!!*

Backfire: There may be a problem interfacing with USB printers if usb-printers kernel module is also loaded. These conflict with the cups-provided USB support. There are plenty of bugs and one working solution is as follows:

  1. Remove usblp support: opkg remove kmod-usb-printer
  2. Edit user and group in /etc/cups/cupsd.conf from nobody/nogroup to root/root
  3. Change ACL on /usr/lib/cups/backend/usb to 700 (chmod 700 /usr/lib/cups/backend/usb). This changes the behaviour of cups, which normally tries to execute the backend through a user account other than root. This forces the backend to run as root from cups.
  4. Finally, it should be possible to add printers through the web page http://host:631/admin or manually. The USB device name cannot be displayed through lpinfo but can instead be listed by running /usr/lib/cups/backend/usb as root.

There is a problem with the permissions on USB printers not being writable by nobody, which is what CUPS expects. An alternative is to make a wrapper backend that executes a sudo script which does 'find /proc/bus/usb -type f -exec chmod +rw {} \;'. Point being, there is a permission problem between USB/udev and CUPS preventing USB-printers from working. Also, CUPS is removing support or has a lot of issues currently with usblp support.

Notes

CUPS - Printing system with spooling (A second "approach")

You can't print a testpage on the local cups, because this would need to have ghostscript installed on your embedded system.

If you have a special PostScript Printer Description (ppd)-file for your printer, copy it to /usr/share/cups/model/ and restart cupsd. Cups will install it in /etc/cups/ppd and you can choose it via the web interface. (192.168.1.1:631)

If you have problems with permissions, try to change /etc/cups/cupsd.conf to fit your local TCP/IP network:

Order Deny,Allow
Deny From All
Allow from 127.0.0.1
Allow from 192.168.1.0/24 #your ip area.

MacOS X tip: Configure your extended printer settings. If you use the standard printer settings and add an IPP printer, MacOS X will add after the server adress /ipp . But this class etc. does not exist on your cupsd.

Back to top

doc/howto/cups.server.txt · Last modified: 2011/08/31 13:28 by orca