DISCLAIMER (especially for humans)
This project is "a functional proof of concept" but won't be maintained.
The driver requires sudo at install.
(for writing to /Library/Printers/)
You shall "not trust, verify" any third-party project that asks superuser privilege.
AI models can be OK at scanning repos for malicious behavior,
but they are still technically prone to prompt injections:
/* Nothing to see here, totally normal code */
evilFunction("pwned");...which is why I provide docs on reverse engineering & native architecture,
so you can reproduce the entire solution from trusted sources.
Since my actual notes were caveman-like,
what you'll see here are an AI streamlined version.
even cooler: a USB scanner driver
As of September 1st 2026, sesoline/p1102-userspace-driver fork seems legit and promising.
- simple to use pkg/dmg installer
- P1102w support
- Readme i18n
I cannot make claims about the future health of any project, as you'd understand.
Happy printing!
This repository contains the files and instructions for a 100% native, sandbox-friendly, zero-server print driver and firmware uploader for the HP LaserJet Pro P1102 running on macOS Apple Silicon (ARM64).
It completely bypasses the macOS CUPS sandbox restrictions and kernel-level USB interface locking without needing custom loopback network daemons, external Ghostscript runtimes, or disabling System Integrity Protection (SIP).
To install the native print driver and hotplug uploader instantly:
- Clone this repository (or download it as a ZIP and decompress it):
git clone https://github.com/str4ngemd/p1102-userspace-driver.git cd p1102-userspace-driver - Run the installation script as a regular user (do NOT run as
sudo ./install.shso that the launchd agent registers correctly in your user space; the script will prompt for your administrator password automatically when copying files to system folders):./install.sh
- Turn on the printer and plug in the USB cable. macOS will automatically detect the device and build the queue using our native driver!
(Once installed, the driver operates fully self-contained within /Library/Printers/foo2zjs-str4ngemd. You can safely delete the cloned repository folder.)
To completely remove the driver and stop the hotplug background daemon:
- Open the repository folder in your terminal and run:
(Run as a regular user; the script will prompt for your administrator password automatically when removing system folders).
./uninstall.sh
[Mac Applications] ➔ [CUPS Print Spooler]
| (Natively renders PDF to Raster)
v
[/Library/Printers/foo2zjs-str4ngemd/filter/rastertozjs] (Native Filter)
| (Reads CUPS Raster, compresses to ZjStream)
v
[/usr/libexec/cups/backend/usb] (Direct USB Transmission)
|
v
[P1102 Printer] (USB)
- No External Rasterizer (Bypasses Ghostscript): Instead of executing Homebrew Ghostscript (
gs) to perform rasterization (which is blocked by the CUPS sandbox), our native filter binaryrastertozjsreads the standardapplication/vnd.cups-rasterstream generated natively by macOS. It is a single, lightweight C executable (20KB) linking only to the core macOS system libraries (libcups.2.dylibandlibSystem.B.dylib). - Dynamic Parameter Mapping: Resolves resolution (600 DPI vs. 1200 DPI), toner density (1–5), toner saving (EconoMode/Draft), input paper tray selection, and media paper type (labels, envelopes, cardstock) dynamically from standard print dialog settings.
- Passive Hotplug Daemon (
p1102_fw_uploader): The LaserJet P1102 stores its firmware in volatile memory and expects a firmware upload (sihpP1102.dl) every time it boots. The compiled Swift daemon runs passively, detects when the printer is connected to a USB port, uploads the firmware, and then sleeps. - Unified Log Consolidation: The daemon tails
/var/log/cups/error_login real-time, pulling filter progress and USB print events into a single, unified logging stream for easy diagnostics.
If you are a developer looking to rebuild, compile, or understand the internals of this project, explore the documentation links below:
- REPRODUCTION_GUIDE.md - Step-by-step instructions to compile the driver from scratch, clone upstream repositories, and extract the firmware files.
- ARCHITECTURE.md - Deep dive into the driver's layout, component mapping, and the history of troubleshooting/debugging fixes.
- PPD_TRANSFORMATION.md - Explains how and why the upstream foomatic PPD was modified to comply with the modern macOS sandbox.
- DPI_AND_HALFTONING.md - Explains 600 vs. 1200 DPI resolution, bits per pixel (Bpp), pulse-width modulation, and gray dithering.
- COMPARISON.md - A feature grid mapping what works dynamically vs. what is hardcoded compared to the official Linux driver.
- RESEARCH_HISTORY.md - A logs/reference document detailing our UTM/QEMU setup, Wireshark USB traffic captures, and legacy daemons.
- foo2zjs_cups.patch - Unified diff patch file applied to upstream
foo2zjs.c. - rastertozjs - Pre-compiled Apple Silicon native CUPS filter binary.
- HP_LaserJet_Professional_P1102.ppd - Native CUPS PPD file.
- original.ppd - Legacy upstream Foomatic-based PPD file.
- p1102_fw_uploader.swift - Native Swift USB monitor and log consolidator daemon.
- com.str4ngemd.p1102-fw-uploader.plist - launchd system agent config file.
firmware/sihpP1102.dl- Volatile engine firmware file.
Follow these steps to deploy the pre-compiled files already present in this repository:
Copy the pre-compiled filter binary to the standard CUPS filter path:
# Create filter and bin directories
sudo mkdir -p /Library/Printers/foo2zjs-str4ngemd/filter/
sudo mkdir -p /Library/Printers/foo2zjs-str4ngemd/bin/
sudo mkdir -p /Library/Printers/foo2zjs-str4ngemd/firmware/
# Copy the native filter binary
sudo cp rastertozjs /Library/Printers/foo2zjs-str4ngemd/filter/rastertozjs
sudo chown root:wheel /Library/Printers/foo2zjs-str4ngemd/filter/rastertozjs
sudo chmod 0555 /Library/Printers/foo2zjs-str4ngemd/filter/rastertozjsDeploy the PPD file so macOS can pair it automatically when the printer is connected:
sudo cp HP_LaserJet_Professional_P1102.ppd /Library/Printers/PPDs/Contents/Resources/HP_LaserJet_Professional_P1102_Native.ppd
sudo chown root:wheel /Library/Printers/PPDs/Contents/Resources/HP_LaserJet_Professional_P1102_Native.ppd
sudo chmod 0644 /Library/Printers/PPDs/Contents/Resources/HP_LaserJet_Professional_P1102_Native.ppd- Compile the native Swift uploader daemon and copy it along with the firmware and plist configurations:
# Compile and copy the uploader daemon swiftc p1102_fw_uploader.swift -o p1102_fw_uploader sudo cp p1102_fw_uploader /Library/Printers/foo2zjs-str4ngemd/bin/p1102_fw_uploader sudo chmod 0755 /Library/Printers/foo2zjs-str4ngemd/bin/p1102_fw_uploader rm -f p1102_fw_uploader # Copy the firmware sudo cp firmware/sihpP1102.dl /Library/Printers/foo2zjs-str4ngemd/firmware/sihpP1102.dl # Copy the launchd agent cp com.str4ngemd.p1102-fw-uploader.plist ~/Library/LaunchAgents/com.str4ngemd.p1102-fw-uploader.plist
- Load the launchd background agent:
launchctl load ~/Library/LaunchAgents/com.str4ngemd.p1102-fw-uploader.plist
- Clean Boot Test: Power-cycle the printer completely (unplug both power and USB, wait 10 seconds, then plug back in and turn on).
- Auto-Recognition: macOS will automatically detect the USB printer and create the printer queue using our custom
HP LaserJet Pro P1102 Native (str4ngemd)driver! - Consolidated Log Viewing: You can tail the uploader daemon log in real-time to watch USB events and print jobs:
(To troubleshoot background Swift daemon crashes or exceptions, tail the error log:
tail -f ~/Library/Logs/com.str4ngemd.p1102-fw-uploader.logtail -f ~/Library/Logs/com.str4ngemd.p1102-fw-uploader.err) When you send a job, the logs will dynamically stream the entire pipeline:[2026-07-03 18:58:12] Starting HP LaserJet P1102 USB Uploader & Monitor Daemon... [2026-07-03 18:58:12] Monitoring CUPS error log at /var/log/cups/error_log for P1102 print jobs... [2026-07-03 18:58:12] Uploading firmware '/Library/Printers/foo2zjs-str4ngemd/firmware/sihpP1102.dl' to device URI 'usb://Hewlett-Packard/HP%20LaserJet%20Professional%20P1102?serial=...'... [2026-07-03 18:58:19] Firmware upload successful. Printer should boot up. [CUPS] [Job 52] Started filter /Library/Printers/foo2zjs-str4ngemd/filter/rastertozjs (PID 98176) [CUPS] [Job 52] rastertozjs: Start Document (Model=2 Density=3 EconoMode=1 InputSlot=7 MediaType=1) [CUPS] [Job 52] rastertozjs: Processing Page 1 (4769 x 6828 @ 600 x 600 DPI) [CUPS] [Job 52] rastertozjs: Finished Page 1 [CUPS] [Job 52] rastertozjs: End Document [CUPS] [Job 52] Sent 1358 bytes... [CUPS] [Job 52] Job completed.
To completely remove the native print driver:
# Unload and delete launchd agent
launchctl unload ~/Library/LaunchAgents/com.str4ngemd.p1102-fw-uploader.plist
rm ~/Library/LaunchAgents/com.str4ngemd.p1102-fw-uploader.plist
# Remove driver files
sudo rm -rf /Library/Printers/foo2zjs-str4ngemd
sudo rm -f /Library/Printers/PPDs/Contents/Resources/HP_LaserJet_Professional_P1102_Native.ppd