I have always wished I could print things from anywhere. Last week my wish came true. I received an email from buyapi.ca that Raspberry Pi Zero W’s were back in stock. This little $14 computer was going to be the heart of my remote printing solution.
Here are the steps I followed to set up a Google Cloud Printer using a Raspberry Pi Zero W.
My Setup:
- Raspberry Pi Zero W
- 32GB Class 10 SD card
- Raspbian Jessie with PIXEL (full install)
- SSH and VNC turned on in Pi Settings
- raspberry icon top left > preferences > raspberry pi configuration
- Assigned IP address to Pi in router
- Connected to home network via WiFi
- Change default pi password in Pi settings (it will be online so it is a good idea to change this)
- raspberry icon top left > preferences > raspberry pi configuration
Steps:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install cups cups-client "foomatic-db"
- Add user ‘pi’ to printer users
sudo usermod -a -G lpadmin pi
- Configure to print remotely
sudo nano /etc/cups/cupsd.conf
- Change config to the following
# Only listen for connections from the local machine
# Listen localhost:631
Port 631
< Location / >
# Restrict access to the server...
Order allow,deny
Allow @local
< /Location >
< Location /admin >
# Restrict access to the admin pages...
Order allow,deny
Allow @local
< /Location >
< Location /admin/conf >
AuthType Default
Require user @SYSTEM
# Restrict access to the configuration files...
Order allow,deny
Allow @local
< /Location >
Reboot the Pi.
- Add printer to the system.
- Use the Chromium browser to set up the printer
- Go to 192.168.x.x:631
- click Administration
- click Add Printer (ignore warning)
- log in using your pi username and password
- Look for your printer under ‘Local Printers’
- Select the printer driver and test to see if it prints
- Remember that printing is one of the most challenging parts of Linux. I had the best luck with the Foomatic drivers.
- Add a location and add check box to sharing.
- Go to Chromium setting and scroll to the bottom and check ‘show advanced settings’
- click ‘Manage’ under Google Cloud Print
- login to your Google Account
- click ‘add classic printer’
- select your printer
- once added, click the share button and share to other Google Accounts
- everyone you shared with will now have this cloud printer to print from.
It took me a little while to tweak things to get my printer to work. After a bit of Googleing it now works like a charm and I can print to my home printer from anywhere.
Good luck and a special thanks to Jason Fitzpatrick who’s blog post helped me fix my printer woes.