Skip to content

Instantly share code, notes, and snippets.

@ru-ka
Created August 13, 2025 18:48
Show Gist options
  • Select an option

  • Save ru-ka/c878e101ba920094e60b3486f2b48f7e to your computer and use it in GitHub Desktop.

Select an option

Save ru-ka/c878e101ba920094e60b3486f2b48f7e to your computer and use it in GitHub Desktop.

Getting Your HP ScanJet Working on Fedora

The Problem: Fedora's ipp-usb service automatically converts USB scanners into network devices (airscan/eSCL). This causes HP's native hpaio driver to fail with "SANE: Error during device I/O (code=9)" when you try to scan.

The Solution: Blacklist your scanner in ipp-usb configuration so the native hpaio:/usb/ driver can access the device directly instead of the generic airscan: network interface.

Symptoms You'll See Without This Fix

When you run hp-scan and choose the USB device (option 2), you'll get:

Opening connection to device...
error: SANE: Error during device I/O (code=9)

This happens because both the hpaio:/usb/ driver and airscan: network interface are trying to control the same device.

Step 1: Install HP's Software

sudo dnf install hplip hplip-gui sane-backends

Step 2: Install HP's Proprietary Plugin

sudo hp-plugin -i

Follow the prompts and accept the license. This installs the closed-source driver needed for full scanner functionality. After installation, unplug and reconnect your scanner to reset the USB connection.

Step 3: Blacklist Scanner in ipp-usb to Fix SANE I/O Error

# Create the ipp-usb quirks configuration directory
sudo mkdir -p /etc/ipp-usb/quirks

# Check what ipp-usb detects (should show your scanner)
ipp-usb check | grep -i scanjet
# Expected output: HP ScanJet Pro 2000 s2

# Create blacklist configuration file using exact device name
sudo tee /etc/ipp-usb/quirks/hp-scanjet.conf >/dev/null <<'EOF'
[HP ScanJet Pro 2000 s2]   # ← Use exact string from ipp-usb check output
blacklist = true
EOF

# Restart ipp-usb service to apply the blacklist
sudo systemctl restart ipp-usb

This prevents ipp-usb from creating an airscan: network device that conflicts with the native hpaio:/usb/ driver.

Step 4: Verify the Fix Works

# List available SANE devices - should show only hpaio:/usb/ device
scanimage -L    
# Expected output: device `hpaio:/usb/HP_ScanJet_Pro_2000_s2?serial=CN43IB20DY' is a Hewlett-Packard HP_ScanJet_Pro_2000_s2 all-in-one

# Test HP's scan utility - option 2 should work without I/O errors
hp-scan         

Troubleshooting: If you still encounter SANE I/O errors, temporarily disable ipp-usb with sudo systemctl stop ipp-usb && sudo systemctl mask ipp-usb to confirm whether airscan conflicts are the root cause, then re-enable it using sudo systemctl unmask ipp-usb && sudo systemctl start ipp-usb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment