Wireless Printing Using Raspberry Pi

, , Leave a comment

Many might think why am I even making this tutorial. I can just buy a new wireless printer. Well, a new printer will be quite expensive and I have been using my printer for the past 8-9 years without any issue except for the fact that the ink drains rapidly. But thats fine as I print just about 20 pages a month which is less than a page a day. I would like to increase the longevity of the printer by making it wireless using Raspberry Pi. It will simply make my task of printing simpler and wire free. So let’s begin.

Steps To Success

  1. Make sure the Raspberry Pi is connected to the local Wi-fi network. If not then click here.
  2. SSH into your Raspberry Pi using Terminal on Mac/Linux and Putty on Windows
  3. ssh pi@x.x.x.x
    password: raspberry

  4. Update and Upgrade the packages!
  5. sudo apt-get update
    sudo apt-get upgrade
    This can take around 15 minutes. So get a good cup of coffee!

  6. Its time for some file sharing. So we will install the Open Source file sharing service named samba.
  7. sudo apt-get install samba

  8. Now we will install CUPS. CUPS is a printing service for Apple devices and devices running UNIX. And as Linux derives, number of things from Linux, it should work on Raspberry Pi.
  9. sudo apt-get install cups

  10. We will select the default admin for printing using the following command.
  11. sudo usermod -a -G lpadmin pi

  12. Connect your printer to Raspberry Pi. Now let’s check the devices connected to the Raspberry Pi via USB.
  13. lsusb

    Devices Connected To RPi Via USB

    Devices Connected To RPi Via USB

  14. It’s time to disconnect from SSH. Reboot Raspberry Pi and connect to a display using HDMI. Open web browser on the Raspberry Pi and visit local loopback address i.e.
  15. CUPS Local Server

    CUPS Local Server

  16. Click on Administrator and then click on Advanced Settings. Modify it to the settings given in image below. Click on Change Settings.
  17. CUPS Advance Settings

    CUPS Advance Settings

  18. Reboot Raspberry Pi and perform SSH using Terminal on Mac/Linux and Putty on Windows.
  19. Open web browser on your Mac or Windows and visit x.x.x.x:631 where x.x.x.x is the IP of your Raspberry Pi. The CUPS local servers web interface will now be wirelessly accessible.
  20. Go to Administrator tab and click on Add Printer. Select the local printer. Give it a good name, description and location. Click on Continue.
  21. Selecting Printer In CUPS

    Selecting Printer In CUPS

    Printer Metadata In CUPS

    Printer Metadata In CUPS

  22. A list of drivers will be populated based on your Printer’s make and model. This may take some time. Select the appropriate driver and click on Add Printer.
  23. Printer Make & Model In CUPS

    Printer Make & Model In CUPS

  24. CUPS will load the default options for your printer which you just added. Set the default preferences and click on Set Default Options.
  25. Set Default Options In CUPS

    Set Default Options In CUPS

  26. You can try printing a test page in Maintenance section to test your Printer.

Mac Specific Steps

  • Open System Preferences->Printers & Scanners
  • Click on Add button and select the nearby printer. Mac will obtain the software. This will take around 2-7 minutes.
  • Printer Setup On Mac

    Printer Setup On Mac

  • Now you can go ahead and print from anywhere in your Mac using your new Wireless Printer.
  • It’s extremely simple on Mac because CUPS is developed by Apple.

    Windows Specific Steps

    1. Open SSH connection with Raspberry Pi and edit the Samba configuration file.
    2. sudo nano /etc/samba/smb.conf
      Go to the bottom of the file and paste the following code,
      # CUPS printing. See also the cupsaddsmb(8) manpage in the
      # cupsys-client package.
      printing = cups
      printcap name = cups
      comment = All Printers
      browseable = no
      path = /var/spool/samba
      printable = yes
      guest ok = yes
      read only = yes
      create mask = 0700

      # Windows clients look for this share name as a source of downloadable
      # printer drivers
      comment = Printer Drivers
      path = /usr/share/cups/drivers
      browseable = yes
      read only = yes
      guest ok = no

    3. Next press Ctrl+W and search for Workgroup. Change your workgroup depending on the workgroup to which your Windows Machine is connected to. Usually it is WORKGROUP itself.
    4. Just below WORKGROUP, uncomment wins support and make it yes.
    5. wins support = yes

      Samba Configuration

      Samba Configuration

    6. Press Ctrl+X and press Y. Then press Enter.
    7. Now restart samba!
    8. sudo /etc/init.d/samba restart

    9. Exit SSH and open Windows Control Panel. Navigate to Hardware & Sound and select Advanced Printer Setup.
    10. Windows will look for wireless printers. Select the one connected to Raspberry Pi. It may say no driver found and will ask you to select the driver from drop down menu. However if the driver is not visible in dropdown menu then download the driver by directly connecting the printer to Windows Machine via USB or from vendors website and then perform this step again. The driver will now show and select it.
    11. Windows will configure the printer and now you can print anything you want wirelessly from your Windows Machine.
    12. Printer Setup Windows

      Printer Setup Windows


    Leave a Reply

    You must be login to post a comment. Log in now