Raspberry Pi Zero W Cloud Printer

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:

  • Update the Pi

sudo apt-get update
sudo apt-get upgrade

  • Install printer software

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.

Making with a Raspberry Pi

Pi as a Time Machine via TechRadar
Pi as a Time Machine via TechRadar

I have always had a fondness for the Raspberry Pi microcomputer for maker type projects. For example, two years ago I made an Apple Time Machine to wirelessly backup two Macbooks in our home using the original Raspberry Pi and a 1TB hard drive. I wrote a “how-to” blog post about it on a website that has been retired. Since then, there have been 2 major revisions to the Raspberry Pi and a Raspian upgrade (the Raspberry Pi version of Linux). After a quick search I found that there were some really well written instructions out there, so there was no need to create a new “how-to”. Personally I like the one from TechRadar.

The Time Machine backup device is in a closet in the basement and is only accessible via my home network. In order to keep the software patched and up-to-date, I use SSH (secure shell) to log into the Raspberry Pi. On a Mac you can use the terminal to access the Pi but I also use a Chromebook. To access the Pi via the Chromebook I use Secure Shell from the Chrome Web Store. I also use it to access the server for this site and run this “Update and Clean” script:

echo "Update and Clean" &&
sudo apt-get update &&
sudo apt-get -y upgrade &&
sudo apt-get -f install &&
sudo apt-get autoremove &&
sudo apt-get -y autoclean &&
sudo apt-get -y clean

However, since the Pi is sitting in the closet without a monitor or keyboard, I have no way to use it for its intended purpose, to learn about coding. I found that I could install VNC (Virtual Network Computing) onto the Raspberry Pi and use the desktop interface remotely. I followed the instructions from Adafruit about how to install VNC on the Pi and how to make it autostart after a reboot. I can now use a VNC client to access the desktop of the Pi. There is even a Chromebook VNC client so I can use the Pi from my Chromebook.

Pi Desktop via adafruit
Pi Desktop via adafruit

Because we never stop learning, today I learned that there is already a VNC client in my Macbook. I followed these instructions, here and here, to create a “share screen” button that now appears in the Finder of my Macbook and it allows me to remotely access the desktop of my Pi.

Now my Pi is serving a dual purpose. I am using it back up my Macbook and I am also remotely accessing it to learn about Linux and explore the coding apps found on the Raspberry Pi.

One more thing, Adafruit is one of my favourite “go-to” sites for everything Raspberry Pi and Limor “Ladyada” Fried at Adafruit is a fascinating role model for coding and building.