<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>RASPBERRYPI on DecipherMiddleware</title><link>https://blog.deciphermiddleware.in/tags/raspberrypi/</link><description>Recent content in RASPBERRYPI on DecipherMiddleware</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Fri, 10 Jul 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://blog.deciphermiddleware.in/tags/raspberrypi/index.xml" rel="self" type="application/rss+xml"/><item><title>Turning an Old Printer into a Wireless Print Server with a Raspberry Pi</title><link>https://blog.deciphermiddleware.in/posts/raspberrypi-print-server/</link><pubDate>Fri, 10 Jul 2026 00:00:00 +0000</pubDate><guid>https://blog.deciphermiddleware.in/posts/raspberrypi-print-server/</guid><description>&lt;p&gt;&lt;a href="https://blog.deciphermiddleware.in/images/header/raspberry_pi_print_server.svg"&gt;&lt;img src="https://blog.deciphermiddleware.in/images/header/raspberry_pi_print_server.svg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Imagine having an old HP LaserJet gathering dust on the table. Why? I upgraded my laptop but not the printer. Does that mean I have to go buy a new one? Absolutely not! But what should I do?&lt;/p&gt;
&lt;p&gt;&lt;i class="fa-solid fa-lightbulb"&gt;&lt;/i&gt; I opened my drawer and found my Raspberry Pi 2 from college days, along with a Wi-Fi dongle.&lt;/p&gt;
&lt;p&gt;&lt;i class="fa-solid fa-book-open"&gt;&lt;/i&gt; I reached out to my friend &lt;code&gt;Claude&lt;/code&gt; to seek guidance.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Claude&lt;/code&gt; said, &amp;ldquo;Absolutely, my friend — let&amp;rsquo;s build a print server on the Raspberry Pi 2.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;What followed wasn&amp;rsquo;t quite the smooth ride either of us expected — stuck print jobs, mismatched drivers, and a little bit of debugging to get things running. But we got there, and this post is the trail we left behind so you don&amp;rsquo;t have to retrace our steps.&lt;/p&gt;
&lt;div class="mermaid"&gt;flowchart LR
A(Laptop) &lt;--&gt; |WiFi Network| C(RaspberryPi)
C --&gt; D(Printer)&lt;/div&gt;
&lt;hr&gt;
&lt;h2 id="the-hardware"&gt;&lt;i class="fa-brands fa-raspberry-pi"&gt;&lt;/i&gt; The Hardware &lt;a href="#the-hardware" class="anchor"&gt;&lt;i class="fa-solid fa-anchor"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;A Raspberry Pi with SD card (Pi2 I used for this)&lt;/li&gt;
&lt;li&gt;An old printer (HP LaserJet 1018)&lt;/li&gt;
&lt;li&gt;USB cable to connect the printer to the Pi&lt;/li&gt;
&lt;li&gt;Wi-Fi dongle&lt;/li&gt;
&lt;li&gt;Local Network&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="step-1-flash-os-on-microsd-card"&gt;Step 1: Flash OS on microSD card &lt;a href="#step-1-flash-os-on-microsd-card" class="anchor"&gt;&lt;i class="fa-solid fa-anchor"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Use official &lt;a href="https://www.raspberrypi.com/software/"&gt;Raspberrypi Imager&lt;/a&gt; to install Raspberry Pi OS to microSD card.&lt;/li&gt;
&lt;li&gt;Connect microSD card to the laptop/device from where you want to run the imager.&lt;/li&gt;
&lt;li&gt;Configure the details as requested in Raspberry Pi Imager.
&lt;ul&gt;
&lt;li&gt;Select Raspberry Pi OS Lite 32-bit under OS section.&lt;/li&gt;
&lt;li&gt;Select the microSD card under storage.&lt;/li&gt;
&lt;li&gt;Enable SSH to enable remote connection from any other system.&lt;/li&gt;
&lt;li&gt;Configure the WiFi details with SSID, username, and password.&lt;/li&gt;
&lt;li&gt;Configure the hostname or leave default hostname as &lt;code&gt;raspberrypi&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Finally let the imager write the files to the SD card.&lt;/li&gt;
&lt;li&gt;After the image is written and verified, Imager shows the Done tab. Select Finish to exit Imager.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="step-2-boot-the-raspberry-pi--and-update"&gt;Step 2: Boot the Raspberry Pi &lt;i class="fa-brands fa-raspberry-pi"&gt;&lt;/i&gt; and update &lt;a href="#step-2-boot-the-raspberry-pi--and-update" class="anchor"&gt;&lt;i class="fa-solid fa-anchor"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Install the microSD card into the Raspberry Pi and boot the Pi.&lt;/li&gt;
&lt;li&gt;SSH into the Raspberry Pi from another system.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ssh &amp;lt;username&amp;gt;@raspberrypi
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;Enter the password when prompted.&lt;/li&gt;
&lt;li&gt;Update the Pi by running the command below.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo apt update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; sudo apt upgrade -y
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="step-3-install-cups-the-print-server-software"&gt;Step 3: Install CUPS (the print server software) &lt;a href="#step-3-install-cups-the-print-server-software" class="anchor"&gt;&lt;i class="fa-solid fa-anchor"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo apt install cups -y
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo usermod -aG lpadmin pi
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;lpadmin&lt;/code&gt; group membership lets your user manage printers without needing full root access every time.&lt;/p&gt;
&lt;h2 id="step-4-install-the-hp-driver-suite-hplip"&gt;Step 4: Install the HP Driver Suite (HPLIP) &lt;a href="#step-4-install-the-hp-driver-suite-hplip" class="anchor"&gt;&lt;i class="fa-solid fa-anchor"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;I initially looked at a third-party driver package (&lt;code&gt;foo2zjs&lt;/code&gt;) for this, as suggested by Claude, since it&amp;rsquo;s commonly recommended for the 1018/1020 family.&lt;/p&gt;
&lt;p&gt;But it didn&amp;rsquo;t work. I did some research with my friend and Google. Then I figured out I should use &lt;strong&gt;HPLIP&lt;/strong&gt; instead.&lt;/p&gt;
&lt;p&gt;In practice, &lt;strong&gt;HPLIP ended up being what actually worked&lt;/strong&gt; on this setup:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo apt install hplip -y
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo hp-setup
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Follow the prompts in &lt;code&gt;hp-setup&lt;/code&gt; to detect and configure the connected printer.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; If you go looking for &lt;code&gt;foo2zjs&lt;/code&gt;, be aware it&amp;rsquo;s not available as an apt package on newer Raspberry Pi OS versions.&lt;/p&gt;&lt;/blockquote&gt;
&lt;h2 id="step-5-open-up-cups-for-remote-web-admin"&gt;Step 5: Open Up CUPS for Remote Web Admin &lt;a href="#step-5-open-up-cups-for-remote-web-admin" class="anchor"&gt;&lt;i class="fa-solid fa-anchor"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;By default, CUPS only listens on &lt;code&gt;localhost&lt;/code&gt;, and its admin pages are locked down. To manage it from any browser on your network, edit the config:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo nano /etc/cups/cupsd.conf
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Make the following changes:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;Port 631
ServerAlias *
WebInterface Yes
DefaultEncryption IfRequested
Browsing On
BrowseLocalProtocols dnssd
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And under each of &lt;code&gt;&amp;lt;Location /&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;Location /admin&amp;gt;&lt;/code&gt;, and &lt;code&gt;&amp;lt;Location /jobs&amp;gt;&lt;/code&gt;, add:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;Allow @LOCAL
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;so each block looks like:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;&amp;lt;Location /admin&amp;gt;
Order allow,deny
Allow @LOCAL
&amp;lt;/Location&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Restart CUPS to apply:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo systemctl restart cups
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For Mac/Bonjour auto-discovery, install Avahi:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo apt install avahi-daemon avahi-utils -y
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo systemctl &lt;span class="nb"&gt;enable&lt;/span&gt; --now avahi-daemon
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="step-6-add-the-printer-via-the-cups-web-interface"&gt;Step 6: Add the Printer via the CUPS Web Interface &lt;a href="#step-6-add-the-printer-via-the-cups-web-interface" class="anchor"&gt;&lt;i class="fa-solid fa-anchor"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;From any browser on your network:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://raspberrypi.local:631"&gt;https://raspberrypi.local:631&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;(Accept the self-signed certificate warning — this is normal for local CUPS installs.)&lt;/p&gt;&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Go to &lt;strong&gt;Administration → Add Printer&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Log in with your Pi&amp;rsquo;s username/password&lt;/li&gt;
&lt;li&gt;Select the LaserJet 1018 (should appear as a local USB device)&lt;/li&gt;
&lt;li&gt;Choose the matching driver from the list&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Finally, make sure &lt;strong&gt;&amp;ldquo;Share This Printer&amp;rdquo;&lt;/strong&gt; is checked on the printer&amp;rsquo;s settings page in the CUPS web interface.&lt;/p&gt;
&lt;h2 id="connecting-client-devices"&gt;Connecting Client Devices &lt;a href="#connecting-client-devices" class="anchor"&gt;&lt;i class="fa-solid fa-anchor"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h2&gt;&lt;h3 id="macos"&gt;macOS &lt;a href="#macos" class="anchor"&gt;&lt;i class="fa-solid fa-anchor"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;System Settings → Printers &amp;amp; Scanners → Add Printer. It should auto-discover via Bonjour, thanks to Avahi.&lt;/p&gt;
&lt;h3 id="windows"&gt;Windows &lt;a href="#windows" class="anchor"&gt;&lt;i class="fa-solid fa-anchor"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Add Printer → &amp;ldquo;The printer that I want isn&amp;rsquo;t listed&amp;rdquo; → add via URL:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;http://raspberrypi.local:631/printers/HP_LaserJet_1018
&lt;/code&gt;&lt;/pre&gt;&lt;hr&gt;
&lt;h2 id="final-thoughts"&gt;Final Thoughts &lt;a href="#final-thoughts" class="anchor"&gt;&lt;i class="fa-solid fa-anchor"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Getting an old &amp;ldquo;incompatible&amp;rdquo; printer working again through a Raspberry Pi is very achievable, but the actual driver that ends up working may not be the one most commonly recommended online (foo2zjs, in my case) — HPLIP&amp;rsquo;s own &lt;code&gt;hpcups&lt;/code&gt; driver did the job here instead. Always verify what&amp;rsquo;s actually active in your PPD file rather than assuming.&lt;/p&gt;
&lt;p&gt;The end result: an old, college-era IoT device — the &lt;strong&gt;Raspberry Pi 2&lt;/strong&gt; — keeping a perfectly good LaserJet alive for years to come, printable from every device in the house.&lt;/p&gt;
&lt;p&gt;The Pi brought old and new devices together with a legacy printer.&lt;/p&gt;</description></item></channel></rss>