Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wireless USB Printer with Raspberry Pi Zero 2 W

Give a USB printer a place on your local Wi-Fi using a Raspberry Pi Zero 2 W, CUPS and Avahi.

Built with: Raspberry Pi Zero 2 W + HP LaserJet Professional P1108.
Author: Dr. Anantha Raman Lakshmipathi
Documented: 19 September 2026

The printer connects to the Pi by USB. Your computer sends jobs to the Pi over Wi-Fi, and the Pi runs the printer driver. The printer itself remains a USB printer.

This project records a working installation, including the investigation that made delayed prints respond promptly. It also provides a repeatable guide for other people to try with compatible hardware.

What has actually been verified?

Capability Status
Raspberry Pi Zero 2 W with HP P1108 Hardware confirmed by the project author
Printing locally from the Pi Working
Printing from a Mac over the local network Working
Temporary colord workaround for the observed delay Applied; author reported quick, near-immediate response afterward
Persistent workaround and printing after reboot Follow-up verification required
Windows, Android and iPhone printing Guidance included; not tested in this installation
Printing over the internet with Tailscale Optional procedure; not tested in this installation
Other printer models Require their own driver and physical-print tests
Repository helper scripts Newly written helpers; syntax and isolated checks only, not run on the physical Pi

The working installation used HPLIP 3.22.10 and the queue HP_P1108. Its exact OS release, OS architecture and final Mac driver selection were not recorded. Do not infer them from that HPLIP version or treat it as a required version pin.

How it works

flowchart TD
    A["Mac / PC"] -->|"IPP over local Wi-Fi"| B["Pi Zero 2 W: CUPS"]
    C["Compatible phone print service"] -->|"IPP after client validation"| B
    B --> D["HPLIP + matching HP plug-in"]
    D -->|"USB through OTG adapter"| E["HP LaserJet P1108"]
Loading

CUPS manages jobs, HPLIP converts them for this HP printer, and Avahi advertises the queue on the LAN. A working internet connection is needed to download software. Normal local printing does not need internet access afterward. Keep the Pi, printer and router powered on.

Hardware

Item Notes
Raspberry Pi Zero 2 W 512MB RAM; built-in 2.4GHz Wi-Fi
microSD card 16GB or larger is a practical starting point
Reliable micro-USB power supply Suitable for the Pi Zero 2 W; use a good 5V supply and cable
Micro-USB OTG host adapter Micro-USB male to USB-A female, with data support
USB printer cable USB-A to USB-B for the P1108
HP LaserJet P1108 Powered separately from mains; load paper and check toner
Wi-Fi router Pi and clients must be able to reach one another on the LAN

Connect the OTG adapter to the Pi port labelled USB. Connect the power supply to PWR IN. A charging-only cable is not a printer data connection. No GPIO wiring, soldering, monitor or keyboard is required when using SSH.

Clients can use a router's 5GHz band while the Pi uses 2.4GHz, provided both bands belong to the same reachable LAN. Guest/client isolation can prevent printing.

1. Prepare Raspberry Pi OS and SSH

  1. Download Raspberry Pi Imager.
  2. Select Raspberry Pi Zero 2 W, a compatible Raspberry Pi OS Lite image, and your microSD card. Writing erases the selected card.
  3. Configure a hostname such as printpi, your normal administrator account, Wi-Fi credentials, Wi-Fi country and timezone. Enable SSH, preferably using your SSH key.
  4. Write and verify the image, insert the card, and power on the Pi. Allow first boot to finish.
  5. From your computer, connect using the account you created:
ssh printadmin@printpi.local

printadmin is an example, not a built-in account. Substitute your username throughout this guide. If .local fails, find the Pi's address in your router and use that address. Reserve its IP in the router's DHCP settings.

On the Pi:

sudo apt update
sudo apt full-upgrade
sudo reboot

Reconnect after reboot. Record the actual environment:

cat /proc/device-tree/model
cat /etc/os-release
dpkg --print-architecture
uname -m

Use a supported OS image with working HPLIP plug-in support for its architecture. The 32-bit and 64-bit userspaces are different; do not assume a successful download means the plug-in can run. This guide targets Debian-based systems with systemd and CUPS 2.x.

2. Install CUPS and the HP driver

On the Pi:

sudo apt install -y cups cups-client cups-filters avahi-daemon avahi-utils \
  usbutils hplip printer-driver-hpcups
sudo usermod -aG lpadmin printadmin
sudo systemctl enable --now cups avahi-daemon

Replace printadmin with your account. Log out and reconnect so group membership takes effect.

Alternatively, after downloading this repository onto the Pi, the package installation helper performs this stage:

sudo bash scripts/install-packages.sh printadmin

Use either the manual commands or the helper. The helper does not install the proprietary plug-in, accept its licence, create a queue, change Wi-Fi settings, or apply the delay workaround.

The P1108 requires HP's binary plug-in for printing. Install the version matching the installed HPLIP release:

sudo hp-plugin -i

Review HP's licence and follow the interactive prompts. Stop and resolve installation, signature, dependency or architecture errors before continuing. Do not bypass verification or download replacement binaries from an unknown source. The plug-in is not redistributed in this repository. See HP's model requirements.

3. Connect the printer and create its queue

Connect and power on the printer. On the Pi:

lsusb
sudo hp-setup -i --printer=HP_P1108

Choose USB, the detected P1108 and its matching driver. Let setup discover this printer's own USB URI. Do not copy another printer's serial-specific URI. Request one test page.

sudo lpadmin -d HP_P1108
lpstat -t

Wait for a physical page. A job ID or the status printing only means CUPS accepted or is processing the job. Avoid submitting repeated copies while troubleshooting.

From the repository directory on the Pi, you can also try:

lp -d HP_P1108 examples/test-page.txt

If text conversion fails, use the built-in CUPS test page or a small PDF; the file-format filter path can vary with the distribution.

4. Share the printer on your local network

After the local test succeeds and no jobs are pending, run on the Pi:

sudo cupsctl --share-printers
sudo cupsctl BrowseDNSSDSubTypes=_cups,_print
sudo lpadmin -p HP_P1108 -o printer-is-shared=true
sudo systemctl restart cups avahi-daemon

Or use the sharing helper, which checks for a real queue and pending jobs and keeps a private configuration backup:

sudo bash scripts/share-printer.sh HP_P1108

The client queue address is:

ipp://printpi.local:631/printers/HP_P1108

CUPS shares with clients on the same subnet by default. Avahi discovery also depends on multicast being available. Routers with multiple isolated networks need additional network configuration. The helper deliberately leaves any existing custom access policies intact; review them on a reused machine.

For browser administration from your trusted LAN, optionally enable:

sudo cupsctl --remote-admin

Then open http://printpi.local:631, choose Printers → HP_P1108, and use your Pi account in the lpadmin group for administration. CUPS may redirect administrative actions to HTTPS with a local certificate. Remote browser administration is not required for ordinary printing. Disable it later with sudo cupsctl --no-remote-admin if no longer needed.

If a firewall is active, permit TCP 631 from the trusted LAN and mDNS on UDP 5353 for discovery. Preserve SSH access. Do not forward port 631 from your router to the public internet. See CUPS sharing.

5. Add the printer on a Mac

Open System Settings → Printers & Scanners → Add Printer. Select the queue advertised by printpi and choose AirPrint if offered.

During this build, the Mac initially showed only Generic PostScript Printer. The following IPP queue command was supplied during troubleshooting; Mac printing subsequently succeeded. The exact final driver choice was not captured separately.

Run in a local Mac Terminal, not the Pi SSH session:

sudo lpadmin -p HP_P1108_WiFi \
  -D "HP P1108 via Raspberry Pi" \
  -E -v ipp://printpi.local:631/printers/HP_P1108 \
  -m everywhere

This queries the Pi's IPP capabilities. The real HP driver remains on the Pi. If discovery or capability negotiation fails, retain the exact error and see client setup. Do not use -m everywhere with the P1108's physical hp:/usb/ URI.

Print a one-page PDF from Preview. If hostname resolution fails, substitute the Pi's reserved LAN IP. A generic-driver label alone does not establish compatibility.

For Windows, Android and iPhone, see client setup. Those clients require separate validation; this project does not claim universal AirPrint or Mopria support.

6. If printing is unusually slow

Our printer eventually printed, but there were repeated delays. Logs showed colour-management D-Bus timeouts and repeated colord activations with roughly 25-second gaps. A temporary workaround followed by a CUPS restart made printing respond promptly in this installation.

Apply only if your logs show the matching problem, after pending jobs finish:

sudo systemctl mask --runtime --now colord.service
sudo cupsctl --no-debug-logging
sudo systemctl restart cups

This disables colord activation until reboot and affects system colour-profile management. It is a targeted workaround for this monochrome server, not a required CUPS installation step. It does not prove the underlying colord fault was repaired.

See troubleshooting for evidence, persistence, reversal and other causes of delay. Do not disable colour management on another setup without checking its role there.

7. Optional: print while away from home

Tailscale remote printing describes private access to the Pi and printing an uploaded PDF over SSH. It also explains the extra requirements for an IPP queue over Tailscale.

This extension has not been tested in this build. Internet access, authorized remote access and powered-on home equipment are required. Tailscale does not automatically carry LAN AirPrint discovery.

Reuse this project with another printer

Keep the Pi/Wi-Fi/CUPS structure, but check the exact model's Linux ARM driver support. HP software is not a universal printer driver. For a second P1108, run setup again to discover its own USB identity. For another brand, use its supported driver or driverless path and a distinct queue name. Confirm a local page before sharing.

Do not copy this SD card onto a second live Pi without handling duplicated hostname, SSH host keys and remote-access identity. A fresh install is easier to reproduce safely.

Files in this repository

Path Purpose
scripts/install-packages.sh Install packages and configure a normal CUPS administrator
scripts/share-printer.sh Share an existing queue and save private configuration backups
scripts/diagnose.sh Read-only diagnostics; logs and identifiers remain private by default
docs/CLIENTS.md Mac, Windows and mobile setup notes
docs/TROUBLESHOOTING.md Delay investigation, temporary/persistent fixes and rollback
docs/REMOTE_PRINTING.md Optional Tailscale extension
docs/VALIDATION.md Original evidence boundary and checklist for a new installation
docs/PUBLISHING.md Upload this project to a new GitHub repository
examples/test-page.txt Simple physical print check
examples/installation-record.md Blank reproducibility record
.github/workflows/shell-checks.yml Bash syntax and ShellCheck checks on GitHub
LICENSE MIT licence for this project's original material only

Before declaring success

  • A page prints from the Pi.
  • A page prints from the intended client over Wi-Fi.
  • First-print and warm-print delays are acceptable.
  • Printing works after restarting the Pi.
  • Printing works after switching the printer off and on.
  • Only intended local/remote clients can reach the queue.
  • Your OS, architecture, package versions and tested clients are recorded privately.

For reproducible issue reports, include model, OS, architecture, relevant versions and sanitized errors. Do not upload printer serials, document names, credentials, full spool files or private configuration backups.

References and licence

Original documentation and helper scripts are under the MIT License. Raspberry Pi OS, CUPS, HPLIP, Avahi, Tailscale and HP's proprietary plug-in retain their respective licences. No vendor endorsement is implied.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages