Posts tagged CUPS
So what exactly can you do with the $35 Raspberry Pi?
Well it turns out you can do lots of things! We’ll have more posts to follow, but the Raspberry Pi mini-computer is a low-power ARM-based microcomputer that can run alot of cool stuff through a linux distribution, including today’s project — an AirPrint Print Server.
So you have an Ipad, an Iphone, etc… and you noticed that ‘share’ option that says print — awesome right? Print right from my phone?
One catch, you don’t have an AirPrint compatibile printer and you like your current printer… no need to go out and buy an AirPrint printer.. Just turn you Raspberry Pi into an AirPrint Print server to relay your print jobs from Apple Ipad or iPhone to your existing printer.
Huge shout-out to Rohan for his original tutorial (http://rohankapoor.com/2012/06/configuring-the-raspberry-pi-as-an-airprint-server/) and tjfontaigne (https://github.com/tjfontaine/airprint-generate) for the python script that makes it possible for noobs.
Since that tutorial was made, the process of turning your Raspberry Pi into a AirPrint printer go between has become even easier. The latest versions of CUPS has added mDNS support that makes the process more streamlined.
The basic process goes like this:
1) Obtain a Raspberry Pi and a spare SD Card
2) Download WinImager32 (or your favorite image writer) and the raspbian linux distribution (http://www.raspberrypi.org/)
3) Write the linux image to your SD card and insert into your Pi. Boot and follow configuration menu… recommended to expand storage to fill card and change thee memory split to favor cpu usage ( GPU: 16Mb)
4) Update/upgrade your packages… you can do this by typing ‘sudo apt-get update’ and then ‘sudo apt-get upgrade’ — if you experience failures to any updates simply repeat until all installs are successful
5) Install CUPS (‘sudo apt-get install cups cups-pdf python-cups’); Then add your username to the lpadmin group to give access to manage the CUPS administration (‘sudo usermod -aG lpadmin yourusername’)
6) Next edit the configuration to allow yourself to manage CUPS from computers on your network outside of the Pi. (‘sudo nano /etc/cups/cupsd.conf’ will open it in an editor– Change “Listen localhost:631” –> “Port 631”; Add ‘ServerAlias *’ on the line following ‘DefaultAuthType Basic’; Add ‘Allow @Local’ under the server, admin and config files sections; Save changes.)
7) Add your printer using the CUPS web interface at the ip address of your Pi on port 631 – e.g. http://192.168.1.102:631 – Be sure to enable the option to share the printer you are adding.
8) Now that the Pi is configured to utilize your printer, it’s time to make it accessible as an Airprint server so your iOS devices will be able to print to your printer. Create a new directory /opt/airprint/; change to this directory (‘cd /opt/airprint/’) and download the script– ‘sudo wget -O airprint-generate.py –no-check-certificate https://raw.github.com/tjfontaine/airprint-generate/master/airprint-generate.py’ –then run the script: ‘sudo python airprint-generate.py’ — This should have created a new file with the name of your printer some random characters and ending ‘.service’ – If this file was generated correctly you should be all set.
9) On your iOS device, go to share on any page you want to print and select ‘print’ then select printer, your device should detect an airprint printer on your raspberry pi. Your Raspberry Pi will relay the print job directly form your iPhone as an AirPrint printer.