Turn Your Old Printer Wireless with a Raspberry Pi Print Server

Do you have an older USB printer that lacks wireless capabilities? Perhaps, like many, you’ve upgraded your computer and found driver compatibility issues, especially moving away from Windows to macOS or Linux. Instead of relegating that perfectly good printer to storage or enduring inconvenient workarounds, you can breathe new life into it with a Raspberry Pi. This guide will walk you through setting up a Raspberry Pi Print Server, allowing you to print wirelessly from any device on your network, and specifically address making it work seamlessly with Macs, just like the original author’s experience.

This tutorial is tailored for those who want to solve the problem of printing from modern computers to older printers, particularly if you have a Raspberry Pi lying around. While this guide uses an HP DeskJet as an example, the principles can be adapted for various printer models and brands. You might need to tweak driver installations, but the core concept of using CUPS (Common Unix Printing System) on a Raspberry Pi remains the same.

What You’ll Need to Build Your Raspberry Pi Print Server

Before you start, gather these components:

  • An Older USB Printer: This guide is based on an HP DeskJet 1112, but most USB printers should work. Ensure you have the USB cable for connecting to the Raspberry Pi.
  • Raspberry Pi: Almost any Raspberry Pi model will suffice. A Raspberry Pi Zero W, Raspberry Pi 3, or Raspberry Pi 4 are all excellent choices. A Wi-Fi-enabled model (like the Zero W or Pi 3/4 with built-in Wi-Fi) is ideal for a truly wireless setup, but you can also use an Ethernet connection. The author used a Raspberry Pi 3 Model B.
  • Raspberry Pi Power Supply: The official power supply for your Raspberry Pi model is recommended for stable operation.
  • MicroSD Card: At least 8GB, but 16GB or 32GB is better, to install the Raspberry Pi operating system.
  • Ethernet Cable (Optional): If your Raspberry Pi doesn’t have Wi-Fi or you prefer a wired network connection.
  • Computer with Internet Access: To download the Raspberry Pi OS image and configure your Raspberry Pi initially.
  • USB Keyboard and Mouse (Optional, for initial setup): While you can set up a Raspberry Pi in headless mode (without a monitor, keyboard, and mouse), having these peripherals can simplify the initial setup process, especially for beginners. Headless setup via SSH is possible and convenient for ongoing management, as the original author suggests.

Alt text: Physical setup showing a Raspberry Pi connected via USB to an HP DeskJet printer on a wooden desk, illustrating a typical Raspberry Pi print server configuration.

Step-by-Step Guide: Setting Up Your Raspberry Pi Print Server

Follow these steps to transform your Raspberry Pi into a wireless print server:

Step 1: Install Raspberry Pi OS and Enable SSH (Optional but Recommended)

  1. Download Raspberry Pi OS: Go to the official Raspberry Pi website and download the Raspberry Pi OS (formerly Raspbian) image. For a print server, the Raspberry Pi OS Lite version (without a desktop environment) is sufficient and saves resources.
  2. Flash the OS to microSD Card: Use Raspberry Pi Imager or Etcher software to flash the downloaded OS image onto your microSD card.
  3. Enable SSH (for Headless Setup): If you want to access your Raspberry Pi remotely without a monitor, create an empty file named ssh (without any extension) in the root directory of the boot partition of your microSD card after flashing the OS. This enables SSH on boot.
  4. Configure Wi-Fi (for Wireless Setup): If using Wi-Fi, you can pre-configure your Wi-Fi credentials by creating a file named wpa_supplicant.conf in the boot partition and adding your Wi-Fi network details. Refer to the Raspberry Pi documentation for the correct format.
  5. Boot Your Raspberry Pi: Insert the microSD card into your Raspberry Pi and power it on. If you enabled SSH and Wi-Fi, you should be able to access it remotely using SSH after it boots up. Otherwise, connect a monitor, keyboard, and mouse to complete the initial setup.

Step 2: Install and Configure CUPS on Raspberry Pi

CUPS (Common Unix Printing System) is the core of your print server. It’s a modular printing system that allows your Raspberry Pi to act as a print server.

  1. Update Package Lists: Open a terminal on your Raspberry Pi (via SSH or directly) and run the following command to update the package lists:

    sudo apt update
  2. Install CUPS: Install the CUPS software using the following command:

    sudo apt install cups
  3. Add User to lpadmin Group: To manage printers through the CUPS web interface, you need to add your user (typically pi) to the lpadmin group:

    sudo usermod -a -G lpadmin pi
  4. Allow Remote Access to CUPS: By default, CUPS restricts web interface access to the local machine. To access it from other computers on your network, run:

    sudo cupsctl --remote-any
  5. Disable Encryption (Optional but Simplifies Setup): For home networks, disabling encryption for the CUPS web interface can simplify access. Edit the CUPS configuration file:

    sudo nano /etc/cups/cupsd.conf

    Add the line DefaultEncryption Never to this file and save it (Ctrl+X, Y, Enter).

  6. Restart CUPS Service: Apply the changes by restarting the CUPS service:

    sudo systemctl restart cups

Step 3: Install Printer Drivers on Raspberry Pi

CUPS comes with a wide range of drivers, but for older or specific printers, you might need to install additional drivers.

  1. HP Printers (HPLIP): For HP printers, the HP Linux Imaging and Printing (HPLIP) drivers are highly recommended:

    sudo apt install hplip hplip-ppds

    After installation, run the HP setup utility:

    sudo hp-setup -i

    Follow the on-screen prompts. This utility will guide you through printer detection and driver installation.

  2. Other Printers: If you’re using a printer from a different manufacturer, you might need to search for .ppd files (PostScript Printer Description) for your specific model. Often, printer manufacturers provide Linux drivers on their support websites. You can manually install PPD files through the CUPS web interface later.

Step 4: Access CUPS Web Interface and Add Your Printer

  1. Open CUPS Web Interface: From a computer on the same network as your Raspberry Pi, open a web browser and navigate to http://raspberrypi.local:631 or http://<Your-Raspberry-Pi-IP-Address>:631. Replace raspberrypi.local with your Raspberry Pi’s hostname or IP address if needed. Port 631 is the default port for CUPS.

  2. Navigate to “Administration”: Click on the “Administration” tab. You might be prompted for a username and password. Use the username pi and your Raspberry Pi password.

  3. Add Printer: Under the “Printers” section, click “Add Printer.”

  4. Select Detected Printer: CUPS should automatically detect your USB printer connected to the Raspberry Pi. Select your printer from the “Discovered Printers” list.

  5. Provide Printer Information: Follow the prompts to provide a name, description, and location for your printer. Ensure you check the “Share This Printer” box to make it accessible to other devices on your network.

  6. Choose Driver: In the “Model” section, select the manufacturer and model of your printer. If you installed HPLIP for HP printers, you should find specific drivers for your HP DeskJet model. For other printers, you might need to select a generic driver or upload a PPD file if you have one. “HP CUPS” drivers or “hpijs” drivers are good options for many HP printers if specific models aren’t listed.

  7. Complete Setup: Click “Add Printer” to finish the printer setup.

Alt text: Screenshot of the CUPS web interface “Printers” tab, showing a list of configured printers, highlighting the user interface for managing printers in CUPS.

Step 5: Configure Printer Options (Optional)

In the CUPS web interface, click on your newly added printer to manage it. You can:

  • Set Default Options: Change default paper size (e.g., from A4 to Letter for US users), print quality, and other settings under “Set Default Options.”
  • Print Test Page: Print a test page to verify that the printer is working correctly.

Step 6: Add the Network Printer to Your Computer (Mac Example)

Now, connect your Mac (or Windows or Linux computer) to the Raspberry Pi print server.

  1. Open System Preferences (Mac): On your Mac, go to “System Preferences” and then “Printers & Scanners.”

  2. Add Printer: Click the “+” button to add a new printer.

  3. Select IP Tab: In the “Add Printer” window, select the “IP” tab.

  4. Enter Printer Address:

    • Address: Enter raspberrypi.local or your Raspberry Pi’s IP address.
    • Protocol: Choose “Internet Printing Protocol – IPP.”
    • Queue: Enter printers/<Your-Printer-Name>, replacing <Your-Printer-Name> with the name you gave your printer in CUPS. You can usually find the correct queue name by browsing to http://raspberrypi.local:631/printers/ and looking at the printer URL. It’s often just the printer name you set in CUPS. If unsure, /printers/ might also work.
  5. Name and Driver: macOS might automatically detect the driver. If not, you might need to manually select the driver for your printer model. In the “Use” dropdown, choose “Select Software…” and search for your printer model or a compatible driver. You can try the same drivers you considered in CUPS (HP CUPS, hpijs, or generic PPD if necessary).

  6. Add Printer: Click “Add” to add the printer.

  7. Print Test Page (Mac): Print a test page from your Mac to confirm the setup is successful.

Alt text: Screenshot of the macOS “Add Printer” dialog box, IP tab, showing fields for address, protocol, queue, and name, guiding users on how to add an IP printer on macOS.

Enjoy Wireless Printing with Your Raspberry Pi Print Server

Congratulations! You’ve successfully turned your Raspberry Pi into a print server, making your old USB printer wireless and accessible to all devices on your network. You can now print from your Mac, Windows computers, smartphones, and tablets without needing to physically connect to the printer or worry about driver compatibility issues on each device. This project is a great way to repurpose an old Raspberry Pi and extend the life of your existing printer, offering a convenient and cost-effective printing solution for your home or small office.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *