CUPS AirPrint Install How To: Items to Watch For

This forum is for Marvell Kirkwood devices such as the GoFlex Home/Net, PogoPlug v1/v2, SheevaPlug, and ZyXEL devices.

CUPS AirPrint Install How To: Items to Watch For

Postby toocanad » Thu Dec 29, 2011 3:43 pm

I have just come through setting up the PogoPlug as a CUPS AirPrint server for an iPad that just arrived in the house. I was not that familiar with CUPS before starting, but I am much better now.

The how to is great, though I suspect there have been some updates and changes to the packages since it was written. Kudos to the author, never would have got the thing going without the guide.

My changes are highlighted in the appropriate sections below.

Note: I upgraded to the latest release of pacman and updated all packages first. The CUPS 1.5 is the installed version. I am also running Samba on the PogoPlug and needed to install the udev-automount package at the end to get my usb Samba shares to show up once again.

Comments are appreciated.

TC

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

CUPS with Apple AirPrint

The following guide will install CUPS for printer support, Webmin for easy printer management, and an Apple AirPrint server. You'll be able to print to a shared printer from Windows, Mac OS X, Linux, and even iOS devices like the iPhone, iPod Touch, and iPad.

Installation
1. Install required packages:
pacman -Sy cups cups-pdf gutenprint pycups avahi python2
$this->bbcode_second_pass_quote('', 'a')dd "dbus" required for avahi-daemon - should read "pacman -Sy cups cups-pdf gutenprint pycups avahi python2 dbus"


2. Add "cups", "cups-pdf" and "avahi-daemon" to the daemons line in /etc/rc.conf, after "sshd".
$this->bbcode_second_pass_quote('', 'c')hange cups to "cupsd" and I did not include cups-pdf in the line (couldn't find it in the directory rc.d), also added "dbus" which needs to come before avahi-daemon. Comment: It would seem if any of the services fail to start at boot up, the services listed after the one that fails do not start either.


3. Plug a USB printer in to your device.

4. Start cups to generate some files that we will be editing later.
/etc/rc.d/cups start
$this->bbcode_second_pass_quote('', 'T')his should read "/etc/rc.d/cupsd start"


5. Download and install Webmin. We will be using Webmin to enable USB printing, but it has a variety of other roles.
pacman -Sy webmin

6. Go to the Webmin configuration file to allow access from network computers.
nano /etc/webmin/miniserv.conf

7. Change the last line to allow computers on your home network.
allow=127.0.0.1 192.168.1.0

8. Start Webmin and access its web interface in a browser by going to http://your.arch.arm.ip:10000". Log in as the root user. Click the left-hand "Hardware" link and then click "Printer Administration".
/etc/rc.d/webmin start

9. Click on "Add a New Printer" and go through the steps to add a name and description.

10. In "Print Destination" select "USB Printer 1" then click "Create" at the bottom of the window, this will allow you to log onto the CUPS web interface when it is appropriate.

11. Now, shut down CUPS and go to the printer configuration file.
/etc/rc.d/cups stop
nano /etc/printers.conf
$this->bbcode_second_pass_quote('', ' ')should be " nano /etc/cups/printers.conf"


12. Change this line:
DeviceURI usb:/dev/usblp0
to:
DeviceURI file:/dev/usblp0
$this->bbcode_second_pass_quote('', 'I') changed mine to "DeviceURI file:/dev/usb/lp0" based on what was showing in the CUPS web client


Use CTRL-X and then Y to save these changes.

13. Go into the CUPS configuration file:
nano /etc/cups/cupsd.conf

Allow the IP address of the administrative computer and the IPs of all the computers you want to have access to the print server:
# Restrict access to the server to your local network: <Location /> Order allow,deny allow 192.168.0.1 192.168.0.* 192.168.0.*** </Location>
$this->bbcode_second_pass_quote('', 'c')hanged to Allow all

# Restrict access to the admin pages... <Location /admin> Order allow,deny allow 192.168.0.* </Location>
$this->bbcode_second_pass_quote('', 'c')hanged to Allow all

14. The "cupsd.conf" file will give you a lot of great information, but really you don't need to change much, except who has access to your printers. Add the following important text to allow printing to a "file" location on the server as well as enabling other CUPS add-on features such as AirPrint by adding a ServerAlias line anywhere within the conf file after you have altered the various lines:
FileDevice Yes ServerAlias *

Press CTRL-X then Y to save changes.

Start the CUPS server and log into the web interface on "http://your.ip.address:631".
/etc/rc.d/cups start
$this->bbcode_second_pass_quote('', ' ')changed to /etc/rc.d/cupsd start
15. Click on the "Printers" tab on the far right and click on the name that you had entered for your printer in Webmin. Click on the drop-down script that reads "Administration" within the "Printers" tab and select "Modify Printer". The selection will read something like:
"Connection: file:/dev/usblp0"
$this->bbcode_second_pass_quote('', 'r')eads "Connection: file:/dev/usb/lp0"

Click "Next" and select all the information showing how your printer will show up on your network and input the appropriate information for Gutenprint to assign a driver for your printer.

16. Click "Create" at the end of these options and take note of the location of the printer. This is very important for allowing your Linux/Mac OS X/Windows computers to access the print server. It will probably be something like:

"http://your.ip.address:631/printers/nameofprinter"

17. That's it! Print a test page and add a network printer by following the instructions based on your OS. As long as you add a network printer via the IP, the address you took note of earlier should suffice to allow the computer to connect.

Apple AirPrint for iOS
You can easily enable Apple AirPrint for iOS devices by following these steps.

1. Start "avahi-daemon" and add "avahi-daemon" to the /etc/rc.conf file's DAEMONs.
/etc/rc.d/avahi-daemon start

nano /etc/rc.conf

2. Download the python script for the AirPrint configuration.
mkdir /opt/airprint cd /opt/airprint wget -O airprint-generate.py --no-check-certificate https://raw.github.com/tjfontaine/airpr ... enerate.py

The file is mirrored at "http://Arch Linux ARM.com/mirror/other/airprint-generate.py".

3. Since we are running python2, we need to change a line so that our script will function.
nano /opt/airprint/airprint-generate.py

Change the line from:
#!/usr/bin/env python

to:
#!/usr/bin/env python2

4. Use CTRL-X and Y to save the file. Then run the downloaded script and move the service file to the Avahi "services" directory:
chmod 755 airprint-generate.py ./airprint-generate.py mv AirPrint-SomePrinter.service /etc/avahi/services

and then,
./airprint-generate.py -d /etc/avahi/services

5. Restart the server (remember to unplug all USB drives except the flash drive with Arch Linux ARM). Once the server has restarted, all Linux, Windows, Mac OS X, and iOS devices should be able to print wirelessly to the printer. Good luck and feel free to ask questions in the Forum.
$this->bbcode_second_pass_quote('', ' ')Note my usb Samba shares went away after all this. I followed this thread viewtopic.php?f=7&t=1484&start=10 and reinstalled udev-automount "pacman -S udev-automount" and all was good.
toocanad
 
Posts: 4
Joined: Tue Dec 27, 2011 10:11 pm
Top

Return to Marvell Kirkwood

Who is online

Users browsing this forum: No registered users and 19 guests