Raspberry Pi and ArchLinux – Install a print server with CUPS and AirPrint
I left a blank ArchLinux configuration. So some packages will be either unnecessary or already installed you if your Raspberry is configured for some time.
Attention : I made many tests with my “former” Raspberry that had only 256 MB. Cannot print a test page. I took the SD card and I put it in a model with 512 MB and presto print of glance !
The problem seems to come from ghostscript which, on the 256 MB model, does not have enough memory to prepare the files to print.
Apple wireless printing functionality will be able to be reproduced through two main components :
- Avahi which allows to know the services via the network
- Cups for drivers to print
For information, my home my printer is an Epson SX218 but no reason that you cannot do the same thing !
- Update distribution
Pacman - Suy
- Install the system initialization scripts to have the script RC.conf Basic
- Install the packages on CUPS and Avahi and some dependencies (430MB to install !). pycups will have a web interface to configure your print server
Pacman - Sy cups cups-pdf gutenprint pycups avahi python2
- Add the following services to the daemons launched at startup
DAEMONS =(hwclock syslog-ng network netfs crond sshd cups cups-pdf avahi-daemon)
- Restart the Raspberry and ensure that cups and avahi are launched
ps - ef | avahi ps - ef grep | grep cups
- It is now necessary to change the configuration of CUPS to take into account the access to our server from any machine on the local network. My home LAN is with type 192.168.1.X IP. Edit the file /etc/cups/cupsd.conf
# Restrict access to the server.... <Rental.> Order allow,deny Allow 192.168.1.0/24 </Rental> # Restrict access to the admin pages.... <Rental/Admin> Order allow,deny Allow 192.168.1.0/24 </Rental>
- Always in the file /etc/cups/cupsd.conf, change the following line
- Always in the file /etc/cups/cupsd.conf, Add the following lines at the beginning of file. ServerAlias is required for AirPrint functionality.
# Log general information in error_log - Exchange "warn" to "debug" # for troubleshooting.... #LogLevel warn LogLevel debug ServerAlias * # Administrator user group.... SystemGroup sys root
- We must now be able to access the web server integrated with CUPS as defined in the http configuration file://<ip_raspberry>:631
- You can now connect your printer on Raspberry Pi if it is not already selected
- Go to the administration tab (required login and password root)
- Click on "find new printer.
- Select the printer you have connected. Home, It's an Epson Stylus SX218
- Change the information if necessary and select the option "Share this printer".
- Choose the brand and click "continue".
- Choose the model of the printer and click on "Add printer".
- Set your default print settings and click on "set default options.. Me for example I changed the paper size setting to default to A4.
- Voilà ! Your printer is installed. If you go to the tab “Printers” It will be in the list.
- You can now print a test page. For this, Click on the printer and then in the drop-down list “Maintenance” choose “Print test page”
- Now let's add the AirPrint support to our small machine. Thanks to TJFontaine, via a python script everything will happen automatically and facilitate the task.Retrieve the script :
wget - No.-check-certificate https://raw.github.com/tjfontaine/airprint-generate/master/airprint-generate.py o /root/airprint-generate.py && chmod 700 /root/airprint - generate.py
- Home, the launch of the script gives the following error :
/usr/bin/env: Python: No. such file or directory
I therefore edited the script and changed the first line by replacing Python by python2
- Run the script by passing as parameter the directory where to install the service for avahi
/root/airprint - generate.py-d/etc/avahi/services
- It is installed ! Now you have in/etc/avahi/services, a file that matches your printer :
- From an iOS device, by clicking on the share button, you have the line to print, you choose the printer that you just installed and you post.
- If you have a device with an iOS version 6.x may not be sufficient. The blog of mmornati explains here How to make.With the user root always, launch the 2 following commands :
urf (0,UNIRAST)" >
.cups-postscript 66 pdftops" >
At home I was able to print from Mac OS using the AirPrint printer. The base printer sending me a message “Obtaining the impossible software”. Side Windows, need to add a network accessible from a URL like IPP printer.
You can play !