HP LaserJet MFP M28-M31 does not scan on Linux

error: SANE: Error during device I/O (code=9)

HP hplip driver does not properly support HP LaserJet Pro MFP M28 scanner: the older version instatly return error, while the newer version hang for 4 minutes before erroring out.

The reason is in the bug in proprietary bb_escl.so plugin, which does not handle printer replies correctly

Workaround

Fortunately, the printer supports AirScan / eSCL standard.

Install sane-airscan and use it over ipp-usb

sudo apt install sane-airscan ipp-usb
sudo systemctl start ipp-usb

The printer should be visible in scanimage -L as device airscan:e0:HP LaserJet MFP M28a (DC66C1) (USB)' is a eSCL HP LaserJet MFP M28a (DC66C1) (USB) ip=127.0.0.1, ::1, and you'll be able to scan.

Don't use hpaio printer which is hplip's driver, it won't work.

More information is available in hplip bug tracker