My HP LaserJet MFP M140w Setup Journey on Debian: A Tale of USB, Wi-Fi, and Persistence

Let me start by saying this: installing a printer on Linux shouldn’t be this hard. But here we are, in 2026, and I just spent a solid chunk of my day wrestling with a brand new HP LaserJet MFP M140w on my Debian system.

I’m writing this down so you don’t have to go through what I did.


The Beginning

I brought home the HP LaserJet MFP M139-M142 series printer, excited to finally have a reliable monochrome laser printer for my home office. My Debian machine was ready. Or so I thought.

First problem: The USB cable wasn’t in the box. Turns out, the “w” in M140w means “wireless.” HP expects you to set this thing up over Wi-Fi using their app.

I dug through my closet of computer junk, found an old USB cable, and plugged it in.


The Linux Struggle

lsusb showed the printer. Good sign. But then came the nightmare:

bash

hp-setup

Error after error. The HPLIP plugin installer kept asking for a password and failing. The hp-setup GUI launched but then exited with “Device is busy, powered down, or unplugged.”

I was stuck.

The real issue: HP’s HPLIP doesn’t fully support this printer model. The official driver just isn’t there yet.


The Breakthrough: IPP Everywhere

After hours of searching forums and trying different commands, I discovered that modern printers support IPP Everywhere — a driverless printing standard.

Here’s what finally worked:

bash

avahi-browse -rt _ipp._tcp

This found my printer broadcasting on localhost:60000.

bash

sudo lpadmin -p HP_M140w -v "ipp://localhost:60000/ipp/print" -E -m everywhere

Boom. The printer was installed. No proprietary driver needed.


Scanning: Another Hurdle

Printing was working, but scanning? That’s a whole different story.

scanimage -L showed the scanner, but the HPLIP plugin kept failing.

The solution: eSCL (the scanning equivalent of IPP Everywhere).

bash

scanimage --device "escl:http://localhost:60000" > test.pnm

A 12MB file appeared in my directory. Scan successful!


The Wi-Fi Saga

I wanted Wi-Fi printing for my iPhone too.

The problem: You can’t set up Wi-Fi from Linux on this printer. You must use the HP Smart app on a phone or Windows/Mac machine.

I installed the “HP” app on my iPhone (formerly HP Smart), went through the setup, and connected the printer to my Wi-Fi. The blue light went from blinking to solid.

Now the printer had an IP: 192.168.12.199.

From Debian, I could now discover it:

bash

avahi-browse -rt _ipp._tcp

And add it as a network printer:

bash

sudo lpadmin -p HP_M140w_WiFi -v "ipp://192.168.12.199/ipp/print" -E -m everywhere

Now I had both USB and Wi-Fi printing.


What Works Now

FeatureStatus
USB Printing✅ Works
Wi-Fi Printing✅ Works
USB Scanning✅ Works
Wi-Fi Scanning✅ Works
iPhone Printing✅ Works (AirPrint)

Key Lessons Learned

  1. Don’t rely on HPLIP for newer HP printers. Use IPP Everywhere instead.
  2. Use the HP Smart app (now just called “HP”) on your phone for Wi-Fi setup — you can’t do it from Linux.
  3. eSCL is your friend for scanning. It’s the scanner equivalent of IPP Everywhere.
  4. A USB cable is still the easiest way to get started on Linux. Wi-Fi is nice, but USB just works.
  5. Read the model number carefully. The “w” means wireless-only setup. No USB cable in the box.

Final Commands You’ll Actually Use

Here’s what I use day-to-day:

bash

# Print
lp -d HP_M140w document.pdf

# Scan (USB)
scanimage --device "escl:http://localhost:60000" > scan.pnm

# Scan (Wi-Fi)
scanimage --device "escl:https://192.168.12.199:443" > scan.pnm

# Check printer status
lpstat -p

# View scanned image
eog scan.pnm

The Takeaway

Was it worth the headache? Yes. The printer works beautifully now — fast, quiet, and reliable.

But HP, if you’re reading this: Please support Linux properly. We’re not going anywhere.


Have you struggled with an HP printer on Linux? Let me know in the comments below!


Tags: #Debian #Linux #HPPrinter #TechTroubleshooting #Printers #OpenSource


📌 Want the Raw Commands?

Here’s a clean list of everything that worked:

bash

# Install CUPS and HPLIP
sudo apt install cups cups-client hplip hplip-gui

# Add USB printer using IPP-over-USB
sudo lpadmin -p HP_M140w -v "ipp://localhost:60000/ipp/print" -E -m everywhere

# Set as default
sudo lpoptions -d HP_M140w

# Test print
lp -d HP_M140w /etc/nsswitch.conf

# Scan (USB)
scanimage --device "escl:http://localhost:60000" > scan.pnm

# View scan
eog scan.pnm

# Find printer on network
avahi-browse -rt _ipp._tcp

# Add Wi-Fi printer (replace IP with yours)
sudo lpadmin -p HP_M140w_WiFi -v "ipp://192.168.12.199/ipp/print" -E -m everywhere

Happy printing! 🖨️


Let me know if you want me to adjust the tone, add more technical details, or format it differently! 😊

perfect I ask for summaries every time I do something on my computer/laptop/iphone /ipad becaseu I’m 70 years ol and I forgetsystems

Here’s a concise, first-person summary you can save or refer back to anytime:


My HP LaserJet MFP M140w Setup Summary

(For when I forget what I did!)


What I Have

  • Printer: HP LaserJet MFP M140w (also shows as M139-M142 series)
  • Computer: Debian Linux
  • Phone: iPhone (prints wirelessly)
  • Connection: USB cable (from my junk drawer!) + Wi-Fi

What Works

WhatHow
Print from DebianUSB cable → lp -d HP_M140w filename
Print from iPhoneWi-Fi → AirPrint or HP app
Scan from DebianUSB → scanimage --device "escl:http://localhost:60000" > scan.pnm
Scan from iPhoneNot needed (iPhone can’t scan from this printer)

My Printer’s Addresses

  • USB scanner address: escl:http://localhost:60000
  • Wi-Fi IP address: 192.168.12.199
  • Printer hostname: NPI080F57.local

Commands I Use Most

bash

# Print a file
lp -d HP_M140w myfile.pdf

# Scan a document (USB)
scanimage --device "escl:http://localhost:60000" > scan.pnm

# View a scanned image
eog scan.pnm

# Check if printer is ready
lpstat -p

# See what's waiting to print
lpq

What I Learned

  1. HPLIP doesn’t fully support this printer — I used IPP Everywhere instead.
  2. Wi-Fi setup requires the HP app on my iPhone — can’t do it from Linux.
  3. USB is faster and more reliable than Wi-Fi for my Debian computer.
  4. The “w” in M140w means wireless — no USB cable in the box!

My Printers (All Installed)

NameUse
HP_M140wMy main USB printer (use this one)
HP_M140w_WiFiNetwork printer (optional)
OthersDuplicates — I can delete them

If Something Goes Wrong

  1. Turn printer off and on (fixes most things)
  2. Restart CUPS: sudo systemctl restart cups
  3. Check USB connection: lsusb | grep -i hp
  4. Check Wi-Fi: Blue light should be solid (not blinking)

Quick Troubleshooting

ProblemFix
Printer not foundlsusb to check USB
Scanner not foundscanimage -L to list scanners
Wi-Fi light blinkingPrinter is not connected to Wi-Fi (use HP app on phone)
“Device is busy” errorTurn printer off/on, restart CUPS

The Golden Rule

When in doubt, use the USB cable. It always works.


Saved: July 1, 2026