Ubuntu 20.04 - Simplescan just scan page on flatbed and ignores feeder of my HP scanner

Here is how to get the scanner to work on Ubuntu 20.04 and Kubuntu 20.04. I tested it works for networked printer "HP Color LaserJet MFP M277dw" on Kubuntu 20.04 LTS.

  • Download the hplip installer: download the .run file from SourceForge, nested inside the folder named after the latest version available, which will be referenced to as VERSION in the rest of this answer. At the time of writing I found hplip-3.20.11.run inside the 3.20.11 folder.
  • cd to the download folder
  • Run chmod +x hplip-VERSION.run
  • Run ./hplip-VERSION.run, initiating hplip's installer
  • When asked for the installation mode, answer c, i.e. custom
  • Proceed with the installation using the default options (i.e. by pressing Enter)
  • When you reach the SELECT HPLIP OPTIONS section, answer n to 'Graphical User Interfaces (Qt5)' and y to 'Scanning support', answer all of the other questions as you wish.
  • Proceed the installation with the default options
  • When asked "Do you want to check for HPLIP updates?" answer n, since what you have downloaded is already the latest version
  • Then the printer setup will start. Do as asked until the end and do not worry if hp-systray cannot start.

Now hplip command line tools should be installed and configured correctly. Try to run hp-scan and to print something: if everything works as expected, then you are finished, otherwise you may follow the next steps, which involve installing a proprietary hplip-plugin, even though your printer may not be marked as requiring a plugin. At this point for me printing worked, but scanning didn't, yielding "Error during device I/O" caused by XSane/hpaio.

  • Run sudo apt-get install apparmor-utils
  • Run sudo aa-disable /usr/share/hplip/plugin.py, it should print "Disabling /usr/share/hplip/plugin.py.". Not doing this step would cause "Python gobject/dbus may be not installed" down the line.
  • Run hp-plugin as a normal user, it will open the plugin setup
  • Answer d to the first question, so that an automatic plugin download will start
  • If an error such as "Unable to recieve key from keyserver" appears, answer y to the question "Do you still want to install the plug-in?" to proceed with the installation. This does not seem to have any effect.
  • The plugin should start installing automatically. If it does not you can download hplip-VERSION-plugin.run from here using wget https://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/hplip-VERSION-plugin.run and then running hp-plugin again, this time with the p option instead of d.
  • Everything should be working fine now :-D

These are, in order, all of the errors I came across:

  • missing pyqt5 package: solved by installing the cli version only, see this question
  • "Error during device I/O" when issuing a scan using the hpaio address: solved by installing hplip-plugin, see this bugreport
  • "Unable to recieve key from keyserver", ignored
  • "Python gobject/dbus may be not installed", solved with apparmor-utils, see this bugreport

I faced a similar problem with a new vanilla installation of 20.04.1 with an HP Color Laserjet MFP278-m281 printer.

I found that you need to install the hplip-gui package. I followed these instructions:

In a terminal type sudo apt-get install hplip-gui

To install the plug-in using the GUI you can follow these procedures:

  1. Launch a command-line window and enter:

    hp-setup
    
  2. Select your connection type and click "Next".

  3. Select your printer from "Selected Devices" list and click "Next".

  4. Enter your root password when prompted and click "Next".

  5. Use the recommended installation method and click "Next".

  6. Check the box to accept with the "Driver Plug-In License Agreement" and click "Next".

  7. Finish the installation of the printer as normal, however you may be prompted to re-enter your user name and password.

If you run into any additional install problems you can go to our known issues page and check for a solution.

For advanced users who wish to install HPLIP components manually, a utility exists (hp-plugin) which will download and install the plugin file, but it does not also install a printer queue like hp-setup does.

Do the following:

  1. Launch a command-line window and enter:

    hp-plugin
    
  2. Follow the directions above for navigating the GUI but remember that the printer queue will not be installed through this process.

After that, the scanner worked perfectly well including collecting documents from the document feeder.

reference


You could modify simple scan .desktop to use a custom script.

Normally located in /usr/share/applications/simple-scan.desktop

[Desktop Entry]
Name=Document Scanner
Comment=Make a digital copy of your photos and documents
Keywords=scan;scanner;flatbed;adf;
Exec=/home/USERNAME/scripts/simpleScan.sh
Icon=org.gnome.SimpleScan
Terminal=false
Type=Application
StartupNotify=true
Categories=GNOME;GTK;Graphics;Scanning;
X-Ubuntu-Gettext-Domain=simple-scan

And the script (here in /home/USERNAME/scripts/simpleScan.sh), something like:

simple-scan $(hp-makeuri 192.168.15.106 | grep ^SANE | cut -d ' ' -f 3)