Scanner Detection

Sane needs a “front end,” which is what Xsane is…Please read the links I posted. IF I was you, I would completely uninstall (purge) anything to do with the scanner end, and thoroughly learn how to install Sane, and Xsane.

Thank you, I am going to try to do what you would do if you were I!
But if I don’t get this fixed very soon, I am going to save all my data and then re-install the OS on this machine, because there are so many files and folders that could have some effect on the installation and operation of the software that affects the scanner – and I’ve done so many things that there are “bandaids on the bandaids” everywhere I think.

1 Like

Question: When I “apt purge” hplip I am informed that a bunch of hplip-specific folders are not being removed because they are not empty. In leaving them there, am I polluting the next installation of hplip that I might do later? (question applies to any purge)

Some progress perhaps, but still no solution. Information found at the link you provided, SaneOverNetwork - Debian Wiki
Shows that the simplest way to scan with an HP all-in one “aio” can be done without hplip, you only need libsane-hpaio. On my “problem” computer I purged simple-scan, sane, Xsane, hplip, and libsane-hpaio. Then I re-installed libsane-hpaio. I now have THREE computers on the network with the scanner, and I find that on TWO of them the following console command will initiate a scan:
simple-scan hpaio:/net/hp_laserjet_mfp_m129-m134?ip=169.254.250.136
However, on the “problem” computer I get this from that command:
image
So I’m still working on it.
:slightly_frowning_face:

could it possibly be a network problem on that computer? What happens with the printer if you enter the IP address of the printer?

@kc1di What happens with the printer if you enter the IP address of the printer?
strong text
Not sure what you mean, but on the problem computer if I do a simple it prints, but it automatically selects a different URI for the printer. If I do it doesn’t work for any known URI on that computer. On the others the URI for the scanner is hpaio:/net/hp_laserjet_mfp_m129-m134?ip=169.254.250.136
The URI that “lp” pulls from somewhere is HP-LaserJet-MFP-M129-M134-84

Here is the DEBUG output from the console command on the “problem computer”. The failure can be seen in the last few lines.

jim@EliteZorin:~$ simple-scan -d hpaio:/net/hp_laserjet_mfp_m129-m134?ip=169.254.250.136
[+0.00s] DEBUG: simple-scan.vala:1720: Starting simple-scan 3.36.3, PID=28640
[+0.00s] DEBUG: unsetenv() is not thread-safe and should not be used after threads are created
[+0.01s] DEBUG: _g_io_module_get_default: Found default implementation dconf (DConfSettingsBackend) for ‘gsettings-backend’
[+0.06s] DEBUG: app-window.vala:1906: Loading state from /home/jim/.cache/simple-scan/state
[+0.06s] DEBUG: app-window.vala:1885: Restoring window to 600x400 pixels
[+0.13s] DEBUG: scanner.vala:1539: sane_init () → SANE_STATUS_GOOD
[+0.13s] DEBUG: scanner.vala:1545: SANE version 1.0.29
[+0.13s] DEBUG: scanner.vala:1606: Requesting redetection of scan devices
[+0.13s] DEBUG: scanner.vala:828: Processing request
[+0.44s] DEBUG: app-window.vala:1981: Saving state to /home/jim/.cache/simple-scan/state
[+8.03s] DEBUG: scanner.vala:341: sane_get_devices () → SANE_STATUS_GOOD
[+8.03s] DEBUG: scanner.vala:353: Device: name=“hpaio:/net/hp_laserjet_mfp_m129-m134?ip=169.254.250.136&queue=false” vendor=“Hewlett-Packard” model=“hp_laserjet_mfp_m129-m134” type=“all-in-one”
[+8.03s] DEBUG: scanner.vala:353: Device: name=“escl:http://169.254.250.136:8080” vendor=“ESCL” model=“HP LaserJet MFP M130fn (C1F054)” type=“flatbed scanner”
[+8.13s] DEBUG: app-window.vala:1981: Saving state to /home/jim/.cache/simple-scan/state
[+75.69s] DEBUG: simple-scan.vala:1536: Requesting scan at 150 dpi from device ‘hpaio:/net/hp_laserjet_mfp_m129-m134?ip=169.254.250.136’
[+75.69s] DEBUG: scanner.vala:1674: Scanner.scan (“hpaio:/net/hp_laserjet_mfp_m129-m134?ip=169.254.250.136”, dpi=150, scan_mode=ScanMode.GRAY, depth=2, type=single, paper_width=2159, paper_height=2794, brightness=0, contrast=0, delay=7000ms)
[+75.69s] DEBUG: scanner.vala:828: Processing request
[+75.97s] DEBUG: app-window.vala:1981: Saving state to /home/jim/.cache/simple-scan/state
[+76.13s] DEBUG: scanner.vala:889: sane_open (“hpaio:/net/hp_laserjet_mfp_m129-m134?ip=169.254.250.136”) → SANE_STATUS_IO_ERROR
[+76.13s] WARNING: scanner.vala:893: Unable to open device: Error during device I/O
[+76.75s] DEBUG: app-window.vala:1981: Saving state to /home/jim/.cache/simple-scan/state

He means…can you ping the printer with its IP address?

Here’s the ping response of the aio printer:

jim@EliteZorin:~$ ping 169.254.250.136
PING 169.254.250.136 (169.254.250.136) 56(84) bytes of data.
64 bytes from 169.254.250.136: icmp_seq=1 ttl=255 time=1004 ms
64 bytes from 169.254.250.136: icmp_seq=2 ttl=255 time=0.170 ms
64 bytes from 169.254.250.136: icmp_seq=3 ttl=255 time=0.240 ms
64 bytes from 169.254.250.136: icmp_seq=4 ttl=255 time=0.242 ms
64 bytes from 169.254.250.136: icmp_seq=5 ttl=255 time=0.241 ms
64 bytes from 169.254.250.136: icmp_seq=6 ttl=255 time=0.237 ms
64 bytes from 169.254.250.136: icmp_seq=7 ttl=255 time=0.193 ms
64 bytes from 169.254.250.136: icmp_seq=8 ttl=255 time=0.164 ms
^C
— 169.254.250.136 ping statistics —
8 packets transmitted, 8 received, 0% packet loss, time 7144ms
rtt min/avg/max/mdev = 0.164/125.656/1003.763/331.893 ms

Try connecting to the port like that:

nc -vz 169.254.250.136 8080

To be able to use the nc command, you should install ncat.

sudo apt update && sudo apt install -y ncat

Or if it isn’t found, use the following installation method. (If it can use Debian repositories, it should be found.

@Akito

Try connecting to the port like that:
nc -vz 169.254.250.136 8080

The nc command reports “Succeeded”…
The command to scan makes contact, with or without the 8080 port added to the URI
Here’s the debug output, first the bad scan, then the good scan.
AN INTERESTING DIFFERENCE IS THAT IN THE GOOD SCAN THE COMPUTER REQUESTS 300 DPI AND COLOR, VS IN THE BAD SCAN THE REQUEST IS FOR 150 DPI GRAY. There is a Sane ERROR right after that. (the printer is B&W only).

BAD SCAN

jim@EliteZorin:~$ nc -vz 169.254.250.136 8080
Connection to 169.254.250.136 8080 port [tcp/http-alt] succeeded!
jim@EliteZorin:~$ simple-scan -d hpaio:/net/hp_laserjet_mfp_m129-m134?ip=169.254.250.136 8080
[+0.00s] DEBUG: simple-scan.vala:1720: Starting simple-scan 3.36.3, PID=46727
[+0.00s] DEBUG: unsetenv() is not thread-safe and should not be used after threads are created
[+0.01s] DEBUG: _g_io_module_get_default: Found default implementation dconf (DConfSettingsBackend) for ‘gsettings-backend’
[+0.06s] DEBUG: app-window.vala:1906: Loading state from /home/jim/.cache/simple-scan/state
[+0.06s] DEBUG: app-window.vala:1885: Restoring window to 600x400 pixels
[+0.14s] DEBUG: scanner.vala:1539: sane_init () → SANE_STATUS_GOOD
[+0.14s] DEBUG: scanner.vala:1545: SANE version 1.0.29
[+0.14s] DEBUG: scanner.vala:1606: Requesting redetection of scan devices
[+0.14s] DEBUG: scanner.vala:828: Processing request
[+0.47s] DEBUG: app-window.vala:1981: Saving state to /home/jim/.cache/simple-scan/state
[+8.06s] DEBUG: scanner.vala:341: sane_get_devices () → SANE_STATUS_GOOD
[+8.06s] DEBUG: scanner.vala:353: Device: name=“hpaio:/net/hp_laserjet_mfp_m129-m134?ip=169.254.250.136&queue=false” vendor=“Hewlett-Packard” model=“hp_laserjet_mfp_m129-m134” type=“all-in-one”
[+8.06s] DEBUG: scanner.vala:353: Device: name=“escl:http://169.254.250.136:8080” vendor=“ESCL” model=“HP LaserJet MFP M130fn (C1F054)” type=“flatbed scanner”
[+8.17s] DEBUG: app-window.vala:1981: Saving state to /home/jim/.cache/simple-scan/state
[+13.71s] DEBUG: simple-scan.vala:1536: Requesting scan at 150 dpi from device ‘hpaio:/net/hp_laserjet_mfp_m129-m134?ip=169.254.250.136’
[+13.71s] DEBUG: scanner.vala:1674: Scanner.scan (“hpaio:/net/hp_laserjet_mfp_m129-m134?ip=169.254.250.136”, dpi=150, scan_mode=ScanMode.GRAY, depth=2, type=single, paper_width=2159, paper_height=2794, brightness=0, contrast=0, delay=7000ms)
[+13.71s] DEBUG: scanner.vala:828: Processing request
[+13.73s] DEBUG: scanner.vala:889: sane_open (“hpaio:/net/hp_laserjet_mfp_m129-m134?ip=169.254.250.136”) → SANE_STATUS_IO_ERROR
> [+13.73s] WARNING: scanner.vala:893: Unable to open device: Error during device I/O
[+14.36s] DEBUG: app-window.vala:1981: Saving state to /home/jim/.cache/simple-scan/state
[+28.17s] DEBUG: app-window.vala:1981: Saving state to /home/jim/.cache/simple-scan/state
[+34.53s] DEBUG: app-window.vala:1981: Saving state to /home/jim/.cache/simple-scan/state

From GOOD Scan: (same command)
james@james-ideacentre-310S-08ASR:~$ simple-scan -d hpaio:/net/hp_laserjet_mfp_m129-m134?ip=169.254.250.136 2> ScanDebug2.txt

[+0.00s] DEBUG: simple-scan.vala:1720: Starting simple-scan 3.36.3, PID=86502
[+0.00s] DEBUG: unsetenv() is not thread-safe and should not be used after threads are created
[+0.02s] DEBUG: _g_io_module_get_default: Found default implementation dconf (DConfSettingsBackend) for ‘gsettings-backend’
[+0.10s] DEBUG: app-window.vala:1906: Loading state from /home/james/.cache/simple-scan/state
[+0.10s] DEBUG: app-window.vala:1885: Restoring window to 653x400 pixels
[+0.21s] DEBUG: scanner.vala:1539: sane_init () → SANE_STATUS_GOOD
[+0.21s] DEBUG: scanner.vala:1545: SANE version 1.0.29
[+0.21s] DEBUG: scanner.vala:1606: Requesting redetection of scan devices
[+0.21s] DEBUG: scanner.vala:828: Processing request
[+0.57s] DEBUG: app-window.vala:1981: Saving state to /home/james/.cache/simple-scan/state
[+3.71s] DEBUG: simple-scan.vala:1536: Requesting scan at 300 dpi from device ‘hpaio:/net/hp_laserjet_mfp_m129-m134?ip=169.254.250.136’
[+3.71s] DEBUG: scanner.vala:1674: Scanner.scan (“hpaio:/net/hp_laserjet_mfp_m129-m134?ip=169.254.250.136”, dpi=300, scan_mode=ScanMode.COLOR, depth=8, type=single, paper_width=0, paper_height=0, brightness=0, contrast=0, delay=3000ms)
[+3.97s] DEBUG: app-window.vala:1981: Saving state to /home/james/.cache/simple-scan/state
[+7.84s] DEBUG: scanner.vala:341: sane_get_devices () → SANE_STATUS_GOOD
[+7.84s] DEBUG: scanner.vala:353: Device: name=“hpaio:/net/HP_LaserJet_MFP_M129-M134?ip=169.254.250.136” vendor=“Hewlett-Packard” model=“HP_LaserJet_MFP_M129-M134” type=“all-in-one”
[+7.84s] DEBUG: scanner.vala:353: Device: name=“escl:http://169.254.250.136:8080” vendor=“ESCL” model=“HP LaserJet MFP M130fn (C1F054)” type=“flatbed scanner”
[+7.84s] DEBUG: scanner.vala:828: Processing request
[+8.07s] DEBUG: scanner.vala:889: sane_open (“hpaio:/net/hp_laserjet_mfp_m129-m134?ip=169.254.250.136”) → SANE_STATUS_GOOD
[+8.07s] DEBUG: scanner.vala:910: sane_get_option_descriptor (0)
[+8.07s] DEBUG: scanner.vala:760: Option 0: name=‘option-cnt’ title=‘Number of options’ type=int size=4 cap=soft-detect
[+8.07s] DEBUG: scanner.vala:763: Description: Read-only option that specifies how many options a specific devices supports.
[+8.07s] DEBUG: scanner.vala:910: sane_get_option_descriptor (1)
[+8.07s] DEBUG: scanner.vala:760: Option 1: name=‘mode-group’ title=‘Scan mode’ type=group size=0
[+8.07s] DEBUG: scanner.vala:910: sane_get_option_descriptor (2)
[+8.07s] DEBUG: scanner.vala:760: Option 2: name=‘mode’ title=‘Scan mode’ type=string size=32 values=[“Lineart”, “Gray”, “Color”] cap=soft-select,soft-detect
[+8.07s] DEBUG: scanner.vala:763: Description: Selects the scan mode (e.g., lineart, monochrome, or color).
[+8.07s] DEBUG: scanner.vala:910: sane_get_option_descriptor (3)
[+8.07s] DEBUG: scanner.vala:760: Option 3: name=‘resolution’ title=‘Scan resolution’ type=int size=4 unit=dpi values=[75, 100, 150, 200, 300, 600, 1200] cap=soft-select,soft-detect
[+8.07s] DEBUG: scanner.vala:763: Description: Sets the resolution of the scanned image.
[+8.07s] DEBUG: scanner.vala:910: sane_get_option_descriptor (4)
[+8.07s] DEBUG: scanner.vala:760: Option 4: name=‘source’ title=‘Scan source’ type=string size=32 values=[“Flatbed”, “ADF”] cap=soft-select,soft-detect
[+8.07s] DEBUG: scanner.vala:763: Description: Selects the scan source (such as a document-feeder).
[+8.07s] DEBUG: scanner.vala:910: sane_get_option_descriptor (5)
[+8.07s] DEBUG: scanner.vala:760: Option 5: name=‘advanced-group’ title=‘Advanced’ type=group size=0 cap=advanced
[+8.07s] DEBUG: scanner.vala:910: sane_get_option_descriptor (6)
[+8.07s] DEBUG: scanner.vala:760: Option 6: name=‘brightness’ title=‘Brightness’ type=int size=4 min=-1000, max=1000, quant=0 cap=soft-select,soft-detect,advanced
[+8.07s] DEBUG: scanner.vala:763: Description: Controls the brightness of the acquired image.
[+8.07s] DEBUG: scanner.vala:910: sane_get_option_descriptor (7)
[+8.07s] DEBUG: scanner.vala:760: Option 7: name=‘contrast’ title=‘Contrast’ type=int size=4 min=-1000, max=1000, quant=0 cap=soft-select,soft-detect,advanced
[+8.07s] DEBUG: scanner.vala:763: Description: Controls the contrast of the acquired image.

Is your user in the scanner group?

…I’ve never heard of a “scanner group”, so I don’t know! :woozy_face:

@nevj
Oh, sorry, I forgot about user groups.
Here’s what I have for user groups, and user root only has group root.
jim@EliteZorin:~$ groups
jim adm cdrom sudo dip plugdev lpadmin sambashare
jim@EliteZorin:~$
The computer that works has the exact same groups.

OK not that.
For my brother scanner user has to belong to a group called scanner, looks like HP dont do that

That message is a clue. Sane is lacking permission to do something ?
Perhaps file permissions? Perhaps network issue?

@nevj @Akito Internet search on the sane error message led to other similar cases where the problem was that port 8080 was “blocked” . I was advised to use netstat (from net-tools) to see which ports are open. The command is <netstat -tulpn | grep LISTEN>. I did this on both computers.
On the one that works the output shows two lines with “port 8000 LISTEN 4886/hplip-printer-”
On the one that does not work port 8000 (or 8080) is not in the list.
Nor does 8000 show on the complete list without grep LISTEN.
What does this mean?

1 Like

Ports are “logical holes” in the firewall that allow data to pass in or out of your machine.
It would be an idea to do some reading on … firewalls, iptables, …
You need to work out what utility is controlling the firewall in your machine … it might be iptables, it might be some gui firewall package.
Then you need to learn how to use the thing … firewalls are not the easiest topic and you can mess up networking or break security if you dont do it properly
When you understand it, you might be able to open port 8000 manually.
And I still dont understand … how come port 8000 is open on one machine and not the other? These things dont just happen. Something has to edit the firewall config to open or close a port.

Have fun
Neville

That’s not a good advice. Linux should get out of the 90’s.

netstat is deprecated. Today, one should do the following, instead.

ss -tulpn

Not necessary.

If the port is not listed, it means the server is not running. That means, the software managing the hplip-printer- utility should be run to make this whole thing work.

If the software will be run the same way as it is already running on the other computer, things will start to work the same way.

@Akito I ran ps -e > file on both machines. The “good” machine has 251 listed processes not counting ps; The “bad” one has 237. The good one had one known extra program running (Bitwarden), which had 6 identifiable processes, so there are 8 more processes on the “good” machine, but since the processes are not in the same order in the lists, it will be hard to identify the differences. Do you think it is worth the trouble to identify all the differences between the two process lists? Do you know an easy way to do it? I have little to no knowledge of what any of these processes do.
Another question: the function "sane_open() comes from sane, and SANE_STATUS_IO_ERROR is one of it’s possible error messages. I’m wondering if the “device name” (URI) parameter passed by sane_open, which was passed to simple-scan by the console command, is not “recognized” by the computer. But sane_open() has another error message “SANE_STATUS_INVAL” which means the “the device name is not valid” and this was not chosen. So SANE thinks that name is “valid”, but could the computer still think it is NOT valid?
Also – can I use the “SANE_Handle * h” function return to get any useful clue to this problem?

4.3.4 sane_open
This function is used to establish a connection to a particular device. The name of the device to be opened is passed in argument name. If the call completes successfully, a handle for the device is returned in *h. As a special case, specifying a zero-length string as the device requests opening the first available device (if there is such a device).

SANE_Status sane_open (SANE_String_Const name, SANE_Handle * h);
This function may fail with one of the following status codes.

SANE_STATUS_DEVICE_BUSY:
The device is currently busy (in use by somebody else).
SANE_STATUS_INVAL:
The device name is not valid.
SANE_STATUS_IO_ERROR:
An error occured while communicating with the device.
SANE_STATUS_NO_MEM:
An insufficent amount of memory is available.
SANE_STATUS_ACCESS_DENIED:
Access to the device has been denied due to insufficient or invalid authentication.
Thanks!

No, not worth the effort.

I was thinking about you checking out what process is running in a normal way. Like e.g. you can maybe see a tray icon of the HP program or in your appllication launcher. Usually such programs should be visible to the user and not hidden in a list of background processes. Or ideally, you would already know about that program, as it was probably installed on purpose and wasn’t already installed by default.

If I would be in your situation, I wouldn’t start with such low level investigation. It’s easier to first look for obvious signs. Like the tray icon for the program.

The reason I assume it should be fairly straight forward is, that there was obviously a special HP program running on your “good” machine, which is apparently missing on your “bad” machine. So, I don’t see a need in investigating logs so thoroughly, when we already have a hint at a missing driver/program.

I would advise trying to find the program that is opening the extra port on the “good” machine and then install that on the “bad” one. I assume, things should start to work then.

ufw is actually quite forgiving…

https://help.ubuntu.com/community/UFW#Default_rules_are_fine_for_the_average_home_user

Just know how to enable or disable ufw before you get fancy :wink: