Revive an Old Printer with Claude Code
Use Claude Code to test legacy printer paths and monitor supplies.
Introduction
30 Second Summary
An old printer can still produce perfect pages after its setup software disappears. The machine ends up idle because your computer no longer knows how to work with it.
In this project, you will use Claude Code to build a printer-rescue toolkit covering discovery through supply reporting. Your toolkit leaves behind evidence for a modern printing path or a compatible legacy fallback on macOS or Windows.
What You'll Build
You will show someone a physical page or saved practice artifact from your rescued print path before running a checker that reports the supplies exposed by the target.
By the end of this project, you'll have:
- A printer-notes.md evidence record showing the target name, model, address or queue, supported path, and exact test result.
- A verified print path that produces a physical page, retained Mac practice job, or saved Windows PDF.
- A reusable supply checker that displays toner, ink, drum, or another response exposed through SNMP or practice IPP.
- Secret Mission: Extend the checker into a printable status report containing supply readings plus the printer's lifetime page counter.
What do I need before starting?
You need a supported Mac or Windows computer, an administrator password, internet access, and an eligible paid Claude plan or Console account. A physical network printer is optional because the project includes a practice route for each platform.
Before We Start
Before the hands-on work begins, lock in the route you are taking and the old-printer problem you want to diagnose. This gives your investigation a clear target before you set up any tools.
Install Claude Code
Claude Code gives you one guided terminal workspace for the entire printer rescue.
You will install it in macOS Terminal or Windows PowerShell. Then you will start it from a new printer-rescue folder so your future diagnostic evidence stays together.
In this step, get ready to:
- Open macOS Terminal or Windows PowerShell for your selected route.
- Install Claude Code. Its version command returns a version number.
- Create the printer-rescue workspace. Claude Code runs there after browser sign-in.
Open your platform terminal
Your terminal is where you install Claude Code and launch the printer-rescue workspace. Use the terminal for your selected operating system.
macOS
- Press Cmd+Space to open Spotlight.
- Type Terminal.
- Press Enter.
You should see a Terminal window with a command prompt.
Windows
- Press the Windows key to open Start.
- Type PowerShell.
- Press Enter.
You should see a PowerShell window with a command prompt.
Install and verify Claude Code
The native installer adds Claude Code to your system. A fresh terminal window lets your shell find the new command.
macOS
- Install Claude Code by running this command:
curl -fsSL https://claude.ai/install.sh | bash
What does this command do?
- The curl command downloads the official macOS installer.
- The | bash portion passes that installer to your shell so it can run.
You should see the installer finish without reporting a failure.
- Close the current Terminal window.
- Open a fresh Terminal window.
- Press Cmd+Space to open Spotlight.
- Type Terminal.
- Press Enter.
Windows
Use a standard PowerShell window. Administrator access is not needed for this installer.
- Install Claude Code by running this command:
irm https://claude.ai/install.ps1 | iex
What does this command do?
- The irm command downloads the official Windows installer.
- The | iex portion passes that installer to PowerShell so it can run.
You should see the installer finish without reporting a failure.
- Close the current PowerShell window.
- Open a fresh PowerShell window.
- Press the Windows key to open Start.
- Type PowerShell.
- Press Enter.
Before you check, do you expect the new terminal window to recognize the Claude Code command?
- Verify the installation by running this command:
claude --version
What does this command do?
The --version option asks Claude Code to print its installed version. A version number confirms that your terminal can find the installation.
You should see the installed Claude Code version number.
Version command not working?
- Close every terminal window to clear the old shell session.
- Open a fresh terminal window for your operating system.
- Rerun the installer if it stopped before completion.
Help me diagnose why Claude Code is not available after installation.
Create the workspace and sign in
A dedicated workspace gives Claude Code a clear boundary for the project. Starting it from printer-rescue keeps your future notes and scripts in one place.
- Move to your Desktop by running this command:
cd ~/Desktop
What does this command do?
The cd command changes your terminal's current location. This puts the new workspace in the Desktop folder where you can find it easily.
- Create your project folder and move into it by running these commands:
mkdir printer-rescue
cd printer-rescue
What do these commands do?
- The mkdir command creates the printer-rescue folder on your Desktop.
- The second command changes your terminal's current location to that new folder.
The first launch opens a browser sign-in prompt. An eligible paid Claude plan or Console account provides access.
Before you launch Claude Code, which folder do you expect it to use as its workspace?
- Start Claude Code from printer-rescue by running this command:
claude
What does this command do?
The claude command starts an interactive Claude Code session in the terminal's current folder.
- Complete the browser sign-in prompt with your eligible account.
That is the setup hurdle cleared: Claude Code is running inside printer-rescue.
Your guided workspace is ready. Next, you will identify the printer and record evidence without assuming its print path works.
Find the Printer and Record Evidence
Your Claude Code workspace is ready inside printer-rescue. Now you can give it a printer target to investigate.
This step captures discovery evidence while deliberately leaving the working print path as untested because discovery cannot prove successful printing.
In this step, get ready to:
- Prepare a physical or practice printer with an identifiable address or queue.
- Probe the target until you have IPP or queue evidence.
- Create printer-notes.md with observed evidence while its working print path remains untested.
Prepare your printer target
Your target can be a physical network printer or a practice queue. Follow the route you selected before starting the project.
Physical Printer on macOS
- Power on the network printer.
- Connect the printer to the same network as your Mac.
You should see the printer report an active network connection through its display or network indicator.
Physical Printer on Windows
Finding the network page can be fiddly because every printer uses different controls. Look for a network status or configuration option on the printer itself.
- Power on the network printer.
- Print its network-configuration page using the printer's controls.
- Record the listed IP address here: your printer IP address.
- Record the listed model here: your exact printer model.
You should have a configuration page showing the printer's IP address and exact model.
No Physical Printer
macOS
A local ippeveprinter process gives CUPS a practice target that can receive print jobs. First, check whether the executable is available on your Mac.
- Check for ippeveprinter by running this command:
command -v ippeveprinter
What does this command do?
The command asks your shell to locate the ippeveprinter executable. A returned path confirms that you can run the practice printer.
You should see the executable path if ippeveprinter is available.
- Record the missing executable if the command returns no output.
- Use macOS Save as PDF as your later test artifact if the executable is missing.
- Create a retained-job folder if the command returned a path by running:
mkdir -p ~/fake-printer
What does this command do?
The command creates ~/fake-printer inside your home folder. The practice printer uses this folder to retain received jobs.
You should now have a fake-printer folder inside your home folder.
- Open a second Terminal window while leaving Claude Code running in the first window.
- Start the practice printer in the second Terminal window by running:
ippeveprinter -r off -p 8631 -k -d ~/fake-printer -f application/pdf,image/pwg-raster "Practice Printer"
What does this command do?
- The command creates a practice printer called Practice Printer.
- It listens on port 8631.
- It accepts PDF or PWG Raster jobs.
- It retains received jobs under ~/fake-printer.
Keep the second Terminal window running. Your practice printer is now available at ipp://localhost:8631/ipp/print.
Windows
The built-in Microsoft Print to PDF queue provides a practice path without network hardware. It produces a saved PDF in place of a physical page.
- Confirm the practice queue from the PowerShell window you already have open by running:
Get-Printer -Name "Microsoft Print to PDF"
What does this command do?
The command looks up the named print queue. Its output provides the queue name plus the installed driver.
You should see a row for Microsoft Print to PDF.
- Record the listed driver here: your exact Windows printer driver name.
- Record the missing optional feature if no queue is returned.
Discover and probe your target
A discovery or probe result gives you evidence about the target's identity or reachability. A failed result is still useful when you preserve it exactly.
Physical Printer on macOS
- Ask Claude Code to search for nearby IPP services by running:
ippfind -T 5
What does this command do?
The command searches for IPP services for five seconds. It prints each service URI that it finds.
You should see a service URI if the printer advertises itself on your network.
- Ask Claude Code to list printer device URIs discovered through DNS service discovery by running:
lpinfo --include-schemes dnssd -v
What does this command do?
The command asks CUPS for devices discovered through DNS service discovery. Its output gives you another URI to compare with the first search.
You should see a device URI when CUPS can discover the printer.
- Record the matching printer URI here: your discovered printer URI.
- Replace {PRINTER_URI} with the discovered URI before running this probe:
ipptool -tv {PRINTER_URI} get-printer-attributes.test
What does this command do?
The command requests the printer's advertised attributes. The response can identify the model plus the document formats it accepts.
You should see a verbose attribute report if the printer answers.
- Record the reported model here: your exact printer model.
- Record the advertised formats here: your observed driverless formats.
- Preserve the exact failure result if the request does not succeed.
Physical Printer on Windows
Windows can test whether the target answers on the standard IPP port. This provides network evidence without claiming that printing works.
- Replace {IP} with your printer IP address before asking Claude Code to run this probe:
Test-NetConnection -ComputerName {IP} -Port 631
What does this command do?
The command tests a TCP connection to the printer on port 631. The result provides evidence about IPP reachability.
You should see whether the connection to port 631 succeeded.
- Record the observed port result here: your IPP port result.
- Preserve the exact failure result if the printer does not answer.
No Physical Printer
macOS
- Ask Claude Code to probe the running practice printer by running:
ipptool -tv ipp://localhost:8631/ipp/print get-printer-attributes.test
What does this command do?
The command requests attributes from the local practice printer. The fixed URI points to the server running in your second Terminal window.
You should see an attribute report for Practice Printer.
- Record the advertised formats here: your observed driverless formats.
- Record that the local IPP practice target was unavailable if ippeveprinter was missing.
Windows
- Use Microsoft Print to PDF as the observed target name.
- Use your exact Windows printer driver name as the class-driver evidence.
- Mark the IPP port check as not applicable.
Your evidence should identify the built-in queue without claiming that a network IPP port was tested.
Target not responding?
- Confirm that a physical printer is powered on before repeating its route-specific probe.
- Confirm that the Mac practice-printer process is still running before repeating the local IPP probe.
- Record the failed command plus its exact result if the target remains unreachable.
Help me interpret my printer discovery result.
Record the evidence in printer-notes.md
The brlaser project supports listed Brother monochrome laser models. Compatibility depends on an exact model match.
The Brother HL-2270DW is the motivating case study. Your own printer remains the source of truth.
- Open the brlaser supported-printer list if you are using a physical printer.
- Record yes only when your exact model appears in the supported-printer list.
- Record no when your physical printer does not appear in the list.
- Record not applicable when you are using a practice target.
- Have Claude Code create printer-notes.md from the template below while replacing each prompt with your observed fact:
# Printer Rescue Notes
- Route: Mac | Windows | No printer
- Target name: replace-with-observed-name
- Model: replace-with-observed-model-or-practice-queue
- Address or queue: replace-with-observed-uri-ip-or-queue
- IPP port check: pass | fail | not applicable
- Driverless attributes: replace-with-observed-formats-or-not-supported
- brlaser model match: yes | no | not applicable
- Windows class-driver candidate: replace-with-exact-Get-PrinterDriver-name-or-not-applicable
- Working print path: untested
- Test result: not run
- Supply protocol: SNMP | IPP practice | demo SNMP | untested
- Notes: Record exact errors and do not infer unsupported features.
What does this file record?
The file keeps target identity and protocol evidence in one checklist. It also separates discovered capabilities from successful printing.
Keep Working print path: untested plus Test result: not run unchanged. The next step tests the printing path.
- Use untested for the supply protocol because this step does not read supplies.
- Ask Claude Code to save printer-notes.md inside the existing printer-rescue folder.
Before you review the file, predict whether its print-path and test-result lines should show completed results.
- Ask Claude Code to display printer-notes.md so you can verify every recorded field.
You should see your target evidence alongside Working print path: untested plus Test result: not run.
Your evidence file is ready. It identifies the target without claiming that a print job has succeeded.
✔️ I've recorded my evidence
Great work. Your printer investigation now has a repeatable evidence trail.
ⓧ I'd like to double check the full code
Compare the field order and fixed status values with this complete template.
# Printer Rescue Notes
- Route: Mac | Windows | No printer
- Target name: replace-with-observed-name
- Model: replace-with-observed-model-or-practice-queue
- Address or queue: replace-with-observed-uri-ip-or-queue
- IPP port check: pass | fail | not applicable
- Driverless attributes: replace-with-observed-formats-or-not-supported
- brlaser model match: yes | no | not applicable
- Windows class-driver candidate: replace-with-exact-Get-PrinterDriver-name-or-not-applicable
- Working print path: untested
- Test result: not run
- Supply protocol: SNMP | IPP practice | demo SNMP | untested
- Notes: Record exact errors and do not infer unsupported features.
Your printer now has an evidence record. Next, you will create a real printing path and test its output.
Test Driverless Printing
Your evidence file now identifies the target you plan to rescue. Its print path still has no real test behind it.
A real test job proves whether the discovered target's IPP Everywhere path can carry print data.
In this step, get ready to:
- Create or confirm a driverless print queue. Its status command lists the selected queue.
- Create a test page in test-page.txt.
- Test the selected driverless path. A physical page, retained Mac job, saved Windows PDF, or reproducible failure proves the result.
Add and check the driverless queue
A print queue connects a local queue name to the target you discovered. Checking that queue first separates setup problems from print-job problems.
macOS
- Press Cmd+Space to open Spotlight.
- Type Terminal in Spotlight.
- Press Enter to open a separate Terminal window.
The queue command may ask for your administrator password. That password stays in your separate Terminal window and never enters Claude Code.
Physical Printer
- Create the OldPrinter queue with your discovered printer URI by running this command:
sudo lpadmin -p OldPrinter -E -v [[PRINTER_URI="your discovered printer URI"]] -m everywhere
What does this command do?
- The lpadmin command asks CUPS to create a print queue.
- The -p OldPrinter option names the local queue.
- The -v option connects the queue to your discovered printer URI.
- The -m everywhere option requests the driverless IPP Everywhere path.
Practice Printer
- Create the OldPrinter queue for the practice target by running this command:
sudo lpadmin -p OldPrinter -E -v ipp://localhost:8631/ipp/print -m everywhere
What does this command do?
- The command creates a local queue named OldPrinter.
- The -v option points the queue at the running practice target.
- The -m everywhere option selects driverless printing.
- Check the OldPrinter queue by running this command:
lpstat -p OldPrinter
What does this command do?
The command asks CUPS to report the current status of the queue named OldPrinter.
You should see a status line for OldPrinter.
Windows
Administrator Windows PowerShell gives the queue command permission to change Windows printing. The target remains the address you already verified.
- Press the Windows key to open Windows search.
- Search for PowerShell.
- Choose the option that opens Windows PowerShell with administrator privileges.
- Approve the Windows permission request.
Physical Printer
- Create the OldPrinter queue with your printer IP address by running this command:
Add-Printer -Name "OldPrinter" -IppURL "http://[[PRINTER_IP="your printer IP address"]]/ipp/print"
What does this command do?
- The Add-Printer command creates a Windows print queue.
- The -Name option names the queue OldPrinter.
- The -IppURL option points Windows at the printer's IPP endpoint.
- Check the new queue by running this command:
Get-Printer -Name "OldPrinter"
What does this command do?
The command retrieves the Windows print queue named OldPrinter.
You should see OldPrinter in the returned queue details.
Practice Printer
- Confirm the built-in Microsoft Print to PDF queue by running this command:
Get-Printer -Name "Microsoft Print to PDF"
What does this command do?
The command retrieves the existing Microsoft Print to PDF queue without creating a network printer.
You should see the Microsoft Print to PDF queue in the returned details.
Create the printer test page
A small text file gives every route the same input. Its final line also defines the visible evidence each route should produce.
- Switch back to Claude Code in the printer-rescue folder.
- Create test-page.txt inside printer-rescue with this exact content:
Printer Rescue Test Page
Target: replace-with-your-printer-or-practice-queue
Date: replace-with-todays-date
Result expected: one physical page, one retained Mac practice job, or one Windows PDF
What does this file do?
- The heading makes the test artifact easy to identify.
- The Target line identifies the printer or practice queue.
- The Date line records when the test happened.
- The final line describes the valid result for each route.
- Ask Claude Code to show the saved contents of test-page.txt.
You should see the four lines from the supplied template in test-page.txt.
Use these tabs to compare the two project files before sending the test job.
✔️ Awesome, I've got everything!
Your evidence file remains unchanged. Your new test page is ready to print.
ⓧ I'd like to double check the full code
Your unchanged evidence file should match this version.
# Printer Rescue Notes
- Route: Mac | Windows | No printer
- Target name: replace-with-observed-name
- Model: replace-with-observed-model-or-practice-queue
- Address or queue: replace-with-observed-uri-ip-or-queue
- IPP port check: pass | fail | not applicable
- Driverless attributes: replace-with-observed-formats-or-not-supported
- brlaser model match: yes | no | not applicable
- Windows class-driver candidate: replace-with-exact-Get-PrinterDriver-name-or-not-applicable
- Working print path: untested
- Test result: not run
- Supply protocol: SNMP | IPP practice | demo SNMP | untested
- Notes: Record exact errors and do not infer unsupported features.
Your test file should match this version.
Printer Rescue Test Page
Target: replace-with-your-printer-or-practice-queue
Date: replace-with-todays-date
Result expected: one physical page, one retained Mac practice job, or one Windows PDF
Print and inspect the result
The queue exists and the input file is ready. This final test reveals whether the driverless path produces usable output.
macOS
Before you run the print command, do you expect your route to produce a physical page or a retained practice job?
- Send test-page.txt to OldPrinter by running this command in the separate Terminal window:
lp -d OldPrinter test-page.txt
What does this command do?
- The lp command submits a file for printing.
- The -d OldPrinter option selects the queue you created.
- The final argument selects test-page.txt as the print job.
Physical Printer
You should see one physical test page from the selected printer.
Practice Printer
You should see a new retained practice job under ~/fake-printer.
Windows
Physical Printer
Before you run the test-page command, do you expect the OldPrinter queue to produce a physical page?
- Send the Windows test page to OldPrinter by running this command in administrator PowerShell:
rundll32 printui.dll,PrintUIEntry /k /n "OldPrinter"
What does this command do?
- The command opens the Windows printer interface.
- The /k option requests a test page.
- The /n "OldPrinter" option selects your driverless queue.
You should see one physical Windows test page from the selected printer.
Practice Printer
Before you print the file, do you expect Microsoft Print to PDF to produce a paper page or a saved PDF?
- Open test-page.txt from the printer-rescue folder.
- Use the Windows file browser to return to the printer-rescue folder.
- Double-click test-page.txt.
You should see the four-line test page in the associated text editor.
- Start printing from the text editor.
- Use the text editor's print option to open the system print controls.
You should see the available Windows print queues.
- Select Microsoft Print to PDF as the printer.
- Choose Microsoft Print to PDF from the printer list.
You should see Microsoft Print to PDF selected for the job.
- Save the output as test-page.pdf inside printer-rescue.
- Choose the printer-rescue folder when Windows asks where to save the PDF.
- Enter test-page.pdf as the file name.
You should see test-page.pdf inside printer-rescue.
Driverless test did not produce the expected artifact?
- Confirm that the queue name in your print action matches the queue shown by your earlier status check.
- Keep the complete output visible if a physical printer rejects the job. The exact result becomes evidence for the fallback step.
- Confirm that Microsoft Print to PDF was selected if test-page.pdf is missing.
Help me diagnose why my driverless print test did not produce the expected artifact.
You now have concrete evidence from the driverless path. A successful artifact proves the queue can print, while an exact failure gives the fallback step a reproducible starting point.
Your driverless test is complete. Next, you'll prepare a legacy fallback without assuming that every old printer accepts the same driver.
Prepare a Legacy Driver Fallback
Your driverless test gave you a working print path or a reproducible failure. That evidence now guides the fallback you prepare with Claude Code.
This step prepares a compatible translation layer for a printer that rejected driverless IPP while keeping a successful driverless queue unchanged.
In this step, get ready to:
- Prepare the platform tools required by the fallback.
- Install an evidence-matched legacy fallback safely.
- Verify the available fallback while preserving the working print path.
Prepare the platform-specific fallback
The Mac route needs compiler tools plus CMake before it can build a driver. The Windows route begins with the exact class-driver names already installed on the computer.
macOS
The Xcode Command Line Tools provide the compiler used to build the Mac fallback.
The installation can take a few minutes while macOS downloads the tools. A quiet installer during that time is expected.
- Switch to a separate Terminal window from the one running Claude Code.
- Start the Command Line Tools installation when the tools are absent by running:
xcode-select --install
What does this command do?
This command starts Apple's Command Line Tools installation flow. macOS reports that the tools are already installed when no installation is needed.
- Complete the macOS installation flow if an installer opens.
You can continue when the installation finishes or macOS confirms that the tools are already present.
- Check the available CMake version by running:
cmake --version
What does this command do?
CMake converts the brlaser project definition into build instructions for your Mac. This command shows whether the required release is available.
- Download the macOS 12 or later universal package for CMake 4.5.1 from the official CMake download page if the command is missing or shows an older version.
- Install the downloaded CMake package.
- Use the installer window to complete the default installation.
- Repeat the CMake version check after the installation.
cmake --version
What does this command do?
This second check confirms that Terminal can find the installed CMake release. The first output line identifies its version.
You should see CMake version 4.5.1 in the output.
✔️ I see version 4.5.1
CMake is ready to configure the brlaser build.
ⓧ I see an older version
- Return to the official CMake download page.
- Download the macOS 12 or later universal package for version 4.5.1.
- Install the downloaded package.
- Return to the Terminal window from earlier.
- Repeat the version check.
ⓧ Command not found
- Download the macOS 12 or later universal package for version 4.5.1 from the official CMake download page.
- Install the downloaded package.
- Open a new Terminal window after the installation.
- Repeat the version check.
Windows
Windows can reuse an installed class driver when the printer documentation confirms a compatible print language. The exact driver name comes from PowerShell.
- List the installed printer drivers by running this command in the PowerShell window from earlier:
Get-PrinterDriver -Name *
What does this command do?
- Get-PrinterDriver reads the printer drivers installed on Windows.
- The Name column gives you the exact value required by a class-driver queue.
You should see one or more driver records with an exact name for each installed driver.
- Compare the installed PCL candidates with the print languages documented for your physical printer.
- Compare the installed PCL6 candidates with the same printer documentation.
- Compare the installed PostScript candidates with the same printer documentation.
- Copy the exact compatible driver name from the Name column.
- Record that exact name on the Windows class-driver candidate line in printer-notes.md.
- Record a candidate without creating a hardware queue when you are following the no-printer route.
Your notes now preserve an evidence-based driver candidate. The no-printer route remains an inventory check.
Install the fallback safely
Each platform uses a different fallback path. Follow the tab for your selected route.
macOS
brlaser supports listed Brother monochrome laser models. This installation keeps its files within locations permitted by System Integrity Protection.
Why use the SIP-safe sequence?
The sequence installs the filter at /usr/libexec/cups/filter/rastertobrlaser. It places generated PPD files under /Library/Printers/PPDs/Contents/Resources.
The upstream installation also targets the SIP-protected /usr/share/cups location. The manual sequence leaves that location untouched.
- Ask Claude Code to download brlaser version 6.2.8 from the verified tag archive into the current printer-rescue folder.
You should see the downloaded archive inside printer-rescue.
- Ask Claude Code to calculate the SHA-256 checksum of the downloaded archive.
The calculated checksum should be 16dae855aa7fff0eef0c05398fab37678243d7d610fa5f9af0d3a2cc9bf08cb0.
- Ask Claude Code to extract the verified archive inside printer-rescue.
You should see a brlaser-6.2.8 folder inside printer-rescue.
- Configure the release build inside printer-rescue by running these commands:
cmake -S brlaser-6.2.8 -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
What do these commands do?
- The first command reads the source from brlaser-6.2.8.
- The same command prepares a release build inside build.
- The second command compiles the rastertobrlaser filter.
- The build also produces brlaser.drv for PPD generation.
The build completes with build/rastertobrlaser plus build/brlaser.drv available.
The next action requests your administrator password because it writes printer components into system locations. Enter that password only in your own Terminal window.
- Switch to the separate Terminal window from earlier.
- Return that Terminal window to the existing printer-rescue folder.
- Install the filter plus generated PPD files with the SIP-safe sequence by running:
sudo /bin/cp build/rastertobrlaser /usr/libexec/cups/filter/rastertobrlaser
/usr/bin/ppdc -d build/ppd build/brlaser.drv
sudo /bin/sh -c 'D=/Library/Printers/PPDs/Contents/Resources; S="build/ppd"; /bin/mkdir -p "$D"; /bin/ls "$S" > "$D/.brlaser-installed-ppds"; for f in "$S"/*.ppd; do /bin/cp "$f" "$D/${f##*/}"; done'
sudo /bin/launchctl stop org.cups.cupsd
sudo /bin/launchctl start org.cups.cupsd
What do these commands do?
- The first command copies the compiled filter into the CUPS filter folder.
- The second command compiles brlaser.drv into individual PPD files.
- The third command records each generated PPD filename before copying the PPDs into the printer resource folder.
- The last two commands restart CUPS so it can load the installed models.
The sequence finishes with CUPS running again. The fallback files are now available to the print system.
- Keep the existing OldPrinter queue unchanged unless the exact physical Brother monochrome model appears in the brlaser supported-printer list.
Windows
A Windows fallback queue needs the physical printer address plus an exact installed driver name. The printer documentation must confirm that the selected driver language is compatible.
Physical printer
- Open a new Administrator PowerShell window.
- Use the Windows search bar to find PowerShell.
- Choose the option that runs PowerShell as an administrator.
- Approve the Windows permission request if it appears.
- Create the TCP/IP port plus the class-driver queue by running:
Add-PrinterPort -Name "IP_[[PRINTER_IP="your printer IP address"]]" -PrinterHostAddress "[[PRINTER_IP="your printer IP address"]]"
Add-Printer -Name "OldPrinter-Class" -DriverName "[[EXACT_INSTALLED_DRIVER_NAME="exact installed class-driver name"]]" -PortName "IP_[[PRINTER_IP="your printer IP address"]]"
What do these commands do?
- Add-PrinterPort creates a TCP/IP port that points to the physical printer.
- Add-Printer creates OldPrinter-Class with the exact compatible driver selected from the installed inventory.
Windows should create the IP_ port for your printer address. You should also see the OldPrinter-Class queue.
No printer
- Keep Microsoft Print to PDF as the practice queue.
- Keep the exact class-driver candidate recorded in printer-notes.md.
This route creates no TCP/IP port. It also creates no hardware queue.
Fallback installation failed?
- On Mac, confirm that the build produced build/rastertobrlaser before repeating the SIP-safe installation sequence.
- On Mac, confirm that CMake reports version 4.5.1 before rebuilding brlaser.
- On Windows, copy the driver name directly from the installed-driver inventory because its spacing must match.
Ask for help with my legacy printer fallback installation.
Verify the available legacy path
The final check proves which fallback your computer can offer. It also preserves the compatibility boundary established by your printer evidence.
Before you check, do you expect to see an installed fallback model or an inventory-only candidate?
macOS
- List the installed brlaser models by running:
lpinfo -m | grep -i brlaser
What does this command do?
lpinfo lists the printer models available to CUPS. grep keeps the entries containing the brlaser name.
You should see one or more brlaser model entries. This output proves that CUPS can discover the installed PPD files.
- Leave the practice printer on its verified driverless path.
- Leave an unsupported physical printer on its evidence-based path.
- Assign a brlaser PPD only when the exact physical Brother monochrome model is listed as compatible.
Your Mac now offers the fallback without assigning a Brother-specific PPD to an unconfirmed model.
Windows
Physical printer
- Check the class-driver queue by running:
Get-Printer -Name "OldPrinter-Class"
What does this command do?
This command retrieves the class-driver queue you created. Its output identifies the queue plus its selected driver.
You should see the OldPrinter-Class queue with the exact compatible driver you selected.
- Send a Windows test page through OldPrinter-Class by running:
rundll32 printui.dll,PrintUIEntry /k /n "OldPrinter-Class"
What does this command do?
This command sends the Windows test page through the named queue. The physical output tests the selected class driver against the printer.
You should receive a physical Windows test page when the printer accepts the selected class driver.
No printer
- Repeat the installed-driver inventory by running:
Get-PrinterDriver -Name *
What does this command do?
This command confirms that the recorded class-driver candidate remains in the installed Windows inventory.
You should see the exact candidate recorded in your notes. Your existing Microsoft Print to PDF queue remains the verified practice path.
You have now proved the fallback boundary. Your computer lists an installed Mac driver or an evidence-based Windows candidate while the working driverless path remains available.
Your print path now has a documented fallback. Next, you will read the supply telemetry that obsolete printer utilities often hide.
Read Printer Supply Levels
Your verified printing path proves that data can reach the physical or practice target. Claude Code now helps you turn standardized device telemetry into a reusable support check.
Support work also needs supply telemetry after printing proves data reaches the target.
In this step, get ready to:
- Verify that your chosen telemetry client is ready.
- Create a supply checker that reports usable percentages or documented nonnumeric states.
- Run the checker against a physical printer or practice target. Capture the observed result.
Prepare the SNMP client
The Simple Network Management Protocol lets support tools request device information over a network. The Printer MIB standard organizes supply descriptions, capacities, and current levels into related table rows.
Your route uses snmpwalk or Python with PySNMP. The no-printer Mac route reads practice supply attributes over IPP instead.
macOS
The Mac checker uses snmpwalk when the command is available. A runtime check keeps the script honest across macOS versions.
- Check whether snmpwalk is available by running this command:
command -v snmpwalk
What does this command do?
The command searches for the snmpwalk executable. It prints the executable path when the tool is available.
You should see a path when snmpwalk is available. An empty result confirms that you need the Python and PySNMP fallback for a physical printer.
- If no path appears for a physical-printer route, install Python from the official Python downloads page.
- Install PySNMP 7.1.33 from the official PySNMP project page.
You should now have either an snmpwalk path or the Python and PySNMP fallback required by check_toner.py.
Windows
The Windows checker uses PySNMP's asynchronous manager functions. Python 3.15.2 supports the pinned PySNMP release used by this project.
- Check the active Python version by running this command:
py -V
What does this command do?
The Windows Python launcher reports the active interpreter version. This check separates a ready installation from an older or missing one.
✔️ I see the required Python version
Continue when the result shows Python 3.15.2. Skip the conditional installation action below.
ⓧ I see an older version
The active interpreter is below the project pin. Use the shared installation action below to install Python 3.15.2.
ⓧ The command is not found
The Python launcher is unavailable. Use the shared installation action below to install Python 3.15.2.
- If the check shows an older version or no command, install Python 3.15.2 from the official Python Windows downloads page.
- Verify the active Python version again by running this command:
py -V
You should see Python 3.15.2 in the output.
- Install the pinned PySNMP package by running this command:
py -m pip install pysnmp==7.1.33
What does this command do?
The command runs pip through the Python launcher. The version pin installs PySNMP 7.1.33 so the script can use the expected asynchronous API.
PySNMP installation failed?
- Confirm that py -V reports Python 3.15.2.
- Check that your internet connection can reach the Python package index.
- Run the installation command from a regular PowerShell window instead of the Claude Code prompt.
Help me diagnose my PySNMP installation.
- Confirm the installed PySNMP package by running this command:
py -m pip show pysnmp
What does this command do?
The command displays metadata for the installed package. It gives you a direct version check before you run the supply checker.
You should see PySNMP version 7.1.33 in the package details.
Create the supply checker
Each supply occupies one indexed row across three Printer MIB columns. Matching the shared row suffix keeps a toner description paired with its own capacity and current level.
Create the checker for your selected platform in the existing printer-rescue folder. Use the reference tab to correct any differences before continuing.
macOS
- In the Claude Code session from earlier, create check-toner.sh inside printer-rescue.
- Configure the script to read the description, maximum-capacity, and current-level columns.
- Match the three columns by their shared row order.
- Format numeric levels as percentages.
- Preserve the documented nonnumeric supply states.
✔️ I'll try it first
Ask Claude Code to write the shell checker from the requirements above. Compare the result with the reference when the file is ready.
ⓧ Let me check my work
#!/bin/sh
set -eu
DESC_OID="1.3.6.1.2.1.43.11.1.1.6"
MAX_OID="1.3.6.1.2.1.43.11.1.1.8"
LEVEL_OID="1.3.6.1.2.1.43.11.1.1.9"
if [ "$#" -lt 1 ] || [ "$#" -gt 2 ]; then
echo "Usage: bash check-toner.sh HOST [COMMUNITY]" >&2
exit 2
fi
host=$1
community=${2:-public}
if ! command -v snmpwalk >/dev/null 2>&1; then
echo "snmpwalk was not found. Use the Python/PySNMP fallback." >&2
exit 1
fi
tmpdir=$(mktemp -d)
trap 'rm -rf "$tmpdir"' EXIT HUP INT TERM
snmpwalk -v1 -c "$community" -Oqv "$host" "$DESC_OID" > "$tmpdir/names"
snmpwalk -v1 -c "$community" -Oqv "$host" "$MAX_OID" > "$tmpdir/max"
snmpwalk -v1 -c "$community" -Oqv "$host" "$LEVEL_OID" > "$tmpdir/levels"
if [ ! -s "$tmpdir/names" ]; then
echo "No Printer MIB supply rows were returned." >&2
exit 1
fi
paste -d '|' "$tmpdir/names" "$tmpdir/max" "$tmpdir/levels" |
while IFS='|' read -r name maximum level; do
name=$(printf '%s' "$name" | sed 's/^"//; s/"$//')
case "$level" in
-3) result="some left" ;;
-2) result="unknown" ;;
-1) result="other" ;;
*)
case "$maximum:$level" in
*[!0-9:]*|0:*|:*) result="unavailable" ;;
*) result="$(awk -v level="$level" -v maximum="$maximum" 'BEGIN { printf "%.0f%%", (level * 100) / maximum }')" ;;
esac
;;
esac
printf '%s: %s\n' "$name" "$result"
done
What does this code do?
- The three OID constants identify the supply description, maximum capacity, and current level columns.
- The temporary files keep each returned column separate until paste joins corresponding rows.
- The nested cases preserve the RFC 3805 states. Numeric rows become percentages only when the capacity and level are usable.
- The cleanup trap removes the temporary directory when the script finishes or stops.
- Save check-toner.sh inside printer-rescue.
You should see check-toner.sh alongside printer-notes.md and test-page.txt in Claude Code.
Windows
- In the Claude Code session from earlier, create check_toner.py inside printer-rescue.
- Use PySNMP's asynchronous walk_cmd for the three supply columns.
- Use get_cmd for the practice scalar query.
- Match returned supply values by their table-index suffix.
- Format usable numeric rows as percentages.
- Preserve the documented nonnumeric supply states.
✔️ I'll try it first
Ask Claude Code to write the asynchronous Python checker from the requirements above. Compare the result with the reference when the file is ready.
ⓧ Let me check my work
import argparse
import asyncio
from pysnmp.hlapi.v3arch.asyncio import (
CommunityData,
ContextData,
ObjectIdentity,
ObjectType,
SnmpEngine,
UdpTransportTarget,
get_cmd,
walk_cmd,
)
DESC_OID = "1.3.6.1.2.1.43.11.1.1.6"
MAX_OID = "1.3.6.1.2.1.43.11.1.1.8"
LEVEL_OID = "1.3.6.1.2.1.43.11.1.1.9"
SYS_DESCR_OID = "1.3.6.1.2.1.1.1.0"
DEMO_HOST = "demo.pysnmp.com"
async def walk_column(engine, target, community, oid):
rows = {}
async for error_indication, error_status, error_index, var_binds in walk_cmd(
engine,
CommunityData(community, mpModel=0),
target,
ContextData(),
ObjectType(ObjectIdentity(oid)),
lexicographicMode=False,
lookupMib=False,
):
if error_indication:
raise RuntimeError(str(error_indication))
if error_status:
raise RuntimeError(
f"{error_status.prettyPrint()} at index {int(error_index)}"
)
for name, value in var_binds:
full_oid = name.prettyPrint()
prefix = f"{oid}."
if full_oid.startswith(prefix):
rows[full_oid[len(prefix) :]] = value.prettyPrint()
return rows
def format_supply(name, maximum, level):
if level == -3:
return f"{name}: some left"
if level == -2:
return f"{name}: unknown"
if level == -1:
return f"{name}: other"
if maximum <= 0 or level < 0:
return f"{name}: unavailable"
return f"{name}: {round(level * 100 / maximum)}%"
async def read_demo():
engine = SnmpEngine()
try:
target = await UdpTransportTarget.create((DEMO_HOST, 161))
error_indication, error_status, error_index, var_binds = await get_cmd(
engine,
CommunityData("public", mpModel=0),
target,
ContextData(),
ObjectType(ObjectIdentity(SYS_DESCR_OID)),
lookupMib=False,
)
if error_indication:
raise RuntimeError(str(error_indication))
if error_status:
raise RuntimeError(
f"{error_status.prettyPrint()} at index {int(error_index)}"
)
print(f"SNMP practice response: {var_binds[0][1].prettyPrint()}")
finally:
engine.close_dispatcher()
async def read_supplies(host, community):
engine = SnmpEngine()
try:
target = await UdpTransportTarget.create((host, 161))
descriptions = await walk_column(engine, target, community, DESC_OID)
maximums = await walk_column(engine, target, community, MAX_OID)
levels = await walk_column(engine, target, community, LEVEL_OID)
common_rows = sorted(
descriptions.keys() & maximums.keys() & levels.keys(),
key=lambda suffix: tuple(int(part) for part in suffix.split(".")),
)
if not common_rows:
raise RuntimeError("No complete Printer MIB supply rows were returned.")
for row in common_rows:
print(
format_supply(
descriptions[row], int(maximums[row]), int(levels[row])
)
)
finally:
engine.close_dispatcher()
def parse_args():
parser = argparse.ArgumentParser(
description="Read printer supplies from the RFC 3805 Printer MIB."
)
parser.add_argument("host", nargs="?", help="Printer IP address or hostname")
parser.add_argument("--community", default="public")
parser.add_argument("--demo", action="store_true")
return parser.parse_args()
async def main():
args = parse_args()
if args.demo:
await read_demo()
elif args.host:
await read_supplies(args.host, args.community)
else:
raise SystemExit("Provide a printer host or use --demo.")
if __name__ == "__main__":
asyncio.run(main())
What does this code do?
- The walk_column function walks one Printer MIB column. It stores each value under the row suffix taken from its full OID.
- The format_supply function converts usable numeric values into percentages. It preserves the documented special states.
- The read_demo function performs one scalar request against the public demonstration agent.
- The read_supplies function keeps only indexes found in all three supply columns. This prevents unrelated table rows from being combined.
- Save check_toner.py inside printer-rescue.
You should see check_toner.py alongside printer-notes.md and test-page.txt in Claude Code.
Run and interpret the result
Printers expose only the consumable rows they support. Your result may include toner, ink, a drum, a waste container, or another supply type.
macOS
Physical printer
Before you run the checker, do you expect your printer to return numeric percentages or one of the documented supply states?
- Run the shell checker against the printer address recorded in your notes:
bash check-toner.sh {IP}
What does this command do?
The command passes the printer address to check-toner.sh. The script uses the SNMP community public unless you supply a second argument.
You should see one line for each complete supply row. Each line ends with a percentage or the state some left, unknown, other, or unavailable.
No printer
Before you query the practice printer, do you expect the response to prove an SNMP exchange or an IPP exchange?
- Query the practice printer's IPP supply attributes by running this command:
ipptool -tv ipp://localhost:8631/ipp/print get-printer-attributes.test
What does this command do?
The command requests the practice printer's advertised attributes. Look for printer-supply and printer-supply-description in the response.
You should see the IPP attributes exposed by the practice printer. This result proves an IPP query without claiming that SNMP produced it.
Windows
Physical printer
Before you run the checker, do you expect your printer to return numeric percentages or one of the documented supply states?
- Run the Python checker against the printer address recorded in your notes:
py check_toner.py {IP}
What does this command do?
The command passes the printer address to check_toner.py. The checker walks the description, capacity, and level columns before matching their shared indexes.
You should see one line for each complete supply row. Each line ends with a percentage or the state some left, unknown, other, or unavailable.
No printer
Before you run the demo, do you expect a printer supply percentage or a general SNMP system description?
- Run the public demonstration query by running this command:
py check_toner.py --demo
What does this command do?
The --demo option sends a scalar request to the public PySNMP demonstration agent. The agent is a connectivity practice target rather than a printer.
You should see a line beginning with SNMP practice response:. This proves that the asynchronous PySNMP request completed.
No supply result?
- Confirm that the printer address matches the address recorded in printer-notes.md.
- Confirm that the physical printer is powered on and reachable from the same network.
- Check whether the printer exposes supply telemetry through SNMP.
Help me diagnose my printer supply query.
You now have an observed supply or practice response from the same toolkit that rescued the printing path. That result turns your project into a repeatable printer-support workflow.
Secret mission
Add the Page Counter and Print a Status Page
Supply readings show what the printer has left. Extend your checker with a lifetime page counter, turn the result into a dated status report, then print or save the report through your verified queue.
Clean Up Your Resources
Clean Up Your Resources
Choose whether to keep your printer-rescue toolkit available, pause its running processes, or remove its local resources. These resources have no usage charge. Your existing Claude plan charge remains separate.
Resources you used:
- The printer-rescue folder containing your notes, scripts, test artifacts, and status report.
- The OldPrinter print queue and the optional OldPrinter-Class queue on Windows.
- The optional ippeveprinter process and retained practice jobs under ~/fake-printer on Mac.
- The optional brlaser filter and the generated PPD files whose names you recorded on Mac.
Keep everything running
No action needed. Choose this if you want the toolkit ready for future printer support work.
- Your printer-rescue folder remains available with its evidence, supply checker, and printable reports.
- Your project-created print queues remain available for another test.
- Your retained Mac practice jobs remain under ~/fake-printer if you used the no-printer route.
- Your Claude Code session and platform development tools remain available.
Pause - I'll come back to this later
Stop active local processes while keeping your files, queues, drivers, and reports intact.
- Save any open work in printer-rescue.
- Close the terminal window running Claude Code.
- On the Mac no-printer route, switch back to the Terminal window running ippeveprinter.
- Press Control-C to stop the practice printer.
- Leave the printer-rescue folder and project-created queues in place.
Your local toolkit remains ready for another diagnostic session. Restart the practice printer with the same command from Step 2 when you return.
Delete - I don't want to use this again
Deletion is permanent. Copy every test page, PDF, note, and status report you want to keep before continuing.
macOS
The commands below remove only the named queue and restart the local print service. macOS may ask for your administrator password in Terminal.
- Copy any wanted artifacts from printer-rescue to another folder.
- Switch back to the Terminal window running ippeveprinter if the practice printer is active.
- Press Control-C to stop the practice printer.
- Press Cmd+Space to open Spotlight.
- Type Terminal.
- Press Enter to open a separate Terminal window.
- Remove the OldPrinter queue by running this command:
sudo lpadmin -x OldPrinter
What does this command do?
The lpadmin -x OldPrinter command deletes the named queue and its pending jobs. The sudo prefix gives the command the administrator access required for this local change.
- Click the Finder icon in the Dock.
- Press Cmd+Shift+G.
- Enter /usr/libexec/cups/filter/.
- Move rastertobrlaser to Trash.
- Press Cmd+Shift+G again.
- Enter /Library/Printers/PPDs/Contents/Resources.
- Move only the brlaser PPD filenames recorded during installation to Trash.
- Restart CUPS by running these commands in Terminal:
sudo /bin/launchctl stop org.cups.cupsd
sudo /bin/launchctl start org.cups.cupsd
What do these commands do?
The first command stops CUPS. The second starts it again so the service reloads after the brlaser files are removed.
- Move ~/fake-printer to Trash if you created it.
- Close the terminal window running Claude Code.
- Move the printer-rescue folder from its current location to Trash.
- Empty Trash after confirming that your wanted artifacts are stored elsewhere.
Xcode Command Line Tools and CMake remain installed as shared development tools.
Windows
Remove only the queues created for this project. Keep the built-in Microsoft Print to PDF queue and any existing class driver used by other printers.
- Copy any wanted artifacts from printer-rescue to another folder.
- Copy status-page.pdf outside printer-rescue if you want to keep the saved report.
- Close the PowerShell window running Claude Code.
- Press the Windows key to open search.
- Type Settings.
- Press Enter to open Windows Settings.
- Type printers into the Settings search field.
- Open the result that shows installed printer queues.
- Select OldPrinter.
- Use the page's removal control to delete OldPrinter.
- Select OldPrinter-Class if you created that queue.
- Use the page's removal control to delete OldPrinter-Class.
- Use Windows search to open the file browser.
- Move the printer-rescue folder from its current location to Recycle Bin.
- Empty Recycle Bin after confirming that your wanted artifacts are stored elsewhere.
Microsoft Print to PDF remains installed because it existed before this project. The installed class driver also stays in place because the project reused an existing driver.
Python and PySNMP remain installed as shared development tools.
Nice Work!
Nice Work!
Your printer-rescue toolkit is complete! It now diagnoses an old printer from first discovery through a printed status report.
What you learned:
- Built an evidence-based printer discovery workflow with Claude Code. Your observations about the target live in printer-notes.md.
- Tested IPP Everywhere before selecting a legacy fallback. You verified brlaser safely on macOS or used an exact installed Windows class driver where compatible hardware was available.
- Built a reusable SNMP supply checker with check-toner.sh or check_toner.py. It reads standardized Printer MIB rows without inventing missing consumables.
- Secret Mission: Extended the checker with a marker life counter. You generated status.txt with the date, supply readings, and page count. You printed or saved the report through your selected queue.
Ready to quiz yourself?