scan with Laserjet MFP-M28 fails

Bug #1811504 reported by Lucazade on 2019-01-12
118
This bug affects 25 people
Affects Status Importance Assigned to Milestone
Ubuntu
Undecided
Unassigned

Bug Description

I’m trying to scan with my new printer Hp LaserJet MFP M28-M31 but I always get this error when scanning using SANE:

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

I’ve installed hplip hplip-plugins and any other dependencies listed in hp-check but without luck.

any hints?

brian_p (claremont102) wrote :

Message #5:

https://bugs.launchpad.net/hplip/+bug/1809287

Any joy?

--
Brian.

still no luck!
modified models.dat but always get sane: i/o error. and no scan at all.
Tried in ubuntu 18.04.1 and Manjaro with hplip-3.18.12 but same issue.

brian_p (claremont102) wrote :

Anything shown with 'journalctl'?

Please post the output of

  avahi-browse -rt _uscan._tcp

for the device.

--
Brian.

-> % avahi-browse -rt _uscan._tcp
+ wlp6s0 IPv4 HP LaserJet MFP M28w (4FA59A) _uscan._tcp local
= wlp6s0 IPv4 HP LaserJet MFP M28w (4FA59A) _uscan._tcp local
   hostname = [NPI4FA59A.local]
   address = [192.168.1.173]
   port = [8080]
   txt = ["note=" "duplex=F" "is=platen" "cs=color,grayscale" "pdl=application/pdf,image/jpeg" "uuid=564e4333-4b34-3438-3737-84a93e4fa59a" "rs=eSCL" "representation=http://NPI4FA59A.local./ipp/images/printer.png" "vers=2.63" "usb_MDL=HP LaserJet MFP M28-M31" "usb_MFG=HP" "mdl=LaserJet MFP M28-M31" "mfg=HP" "ty=HP LaserJet MFP M28-M31" "adminurl=http://NPI4FA59A.local." "txtvers=1"]

> % scanimage --device "hpaio:/usb/HP_LaserJet_MFP_M28-M31?serial=VNC3K44877" --format=png --resolution 300 >scan01.png
scanimage: sane_start: Error during device I/O

brian_p (claremont102) wrote :

Your avahi-browse output shows

  ty=HP LaserJet MFP M28-M31

As

  https://bugs.launchpad.net/hplip/+bug/1797501

discusses, the first three characters are removed and the software looks for "laserJet mtp_m28-m31" in models.dat. There are no entries in models.dat for this device. I am very surprised journalctl does not inform you of this.

Look again. There is more than one entry found in models.dat when I search for "m28".

--
Brian.

if I remove "hp_" prefix in both entries in models.dat the printer is not recognized during hp-setup:

-> % hp-setup

HP Linux Imaging and Printing System (ver. 3.18.12)
Printer/Fax Setup Utility ver. 9.0

Copyright (c) 2001-15 HP Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

Searching... (bus=usb, search=(None), desc=0)
error: No devices found on bus: usb

Done.

brian_p (claremont102) wrote :

Apologies - I hadn't fully appreciated you were using a USB connection. You could disconnect it and try wireless.

--
Brian.

Yes, I'm using a USB connection.
I tried also via wireless but it fails the same way (i/o error code 9) when it starts scanning.

I believe the relevant part of journalctl is:

io/hpmud/musb.c 1566: invalid HP-ESCL-SCAN channel=26
io/hpmud/musb.c 975: removed HP-ESCL-SCAN channel=26 clientCnt=0 channelCnt=0
http.c 263: unable to open HP-ESCL-SCAN channel
...
http.c 322: invalid http_status=409
http.c 328: dumping len=127
http.c 153: hpmud_read_channel failed retrying (2) more times)
http.c 153: hpmud_read_channel failed retrying (1) more times)
http.c 153: hpmud_read_channel failed retrying (0) more times)
http.c 157: read_stream error stat=49
http.c 189: -read_stream() bytes_read=0 s.index=0 s.cnt=0 stat=1
bb_escl.c 828: http_read_header returned error code(1) hence exiting..
(attached full log)

I'm wondering why there is a 409 http error code.. it looks like there is some conflict or broken communication somewhere, maybe because of unreachble HP-ESCL-SCAN channel.

The scanner works ok with vuescan proprietary engine so the issue seems related to sane/hpaio backend.

brian_p (claremont102) wrote :

A 409 http error code indicates a conflict. A portion of the data which is sent conflicts with the software's idea of what the scanner is capable of. The capabilities are shown in your journalctl file by the "Platen" entries.

bb_esc comes with the plug-in. According to models.dat, you device does not need such software. You could remove it from /usr/share/hplip and see how you go on.

--
Brian.

brian_p (claremont102) wrote :

bb_esc ---> bb_escl

--
Brian.

if I remove /usr/share/hplip/scan/plugins/bb_escl.so

-> % scanimage --device "hpaio:/usb/HP_LaserJet_MFP_M28-M31?serial=VNC3K44877" --format=png --resolution 300 >scan01.png
scanimage: open of device hpaio:/usb/HP_LaserJet_MFP_M28-M31?serial=VNC3K44877 failed: Error during device I/O

scan/sane/escl.c 418: escl_open() session=(nil)
io/hpmud/musb.c 427: Found interface conf=0, iface=0, altset=0, index=1
io/hpmud/musb.c 389: Active kernel driver on interface=0 ret=0
io/hpmud/musb.c 535: claimed 7/1/2 interface
io/hpmud/musb.c 780: read actual device_id successfully fd=1 len=239
io/hpmud/musb.c 561: released 7/1/2 interface
common/utils.c 245: unable to load library libm.so: /usr/lib/libm.so: invalid ELF header
common/utils.c 245: unable to load library /usr/share/hplip/scan/plugins/bb_escl.so: /usr/share/hplip/scan/plugins/bb_escl.so: cannot open shared object file: No such file or directory
scan/sane/escl.c 89: Calling escl bb_unload:

brian_p (claremont102) wrote :

The evidence from models.dat is that a plug-in is not required. This is repeated at

https://developers.hp.com/hp-linux-imaging-and-printing/binary_plugin.html

Perhaps it would be as well to tell HPLIP there is no plug-in installed by moving /var/lib/hp/hplip.state out of the way or editing it. The plug-in software may not be the problem, but it complicates matters.

--
Brian.

Interesting! The plugin seems not required but when I scan with hp-scan it asks me to install the plugin (I previously uninstalled the plugin and moved out /var/lib/hp/hplip.state)

How to tell to not require the plugin installation? Maybe in models.dat?

ok made some progress but still no luck!

* modified /var/lib/hp/hplip.state
[plugin]
installed = 0
eula = 1
version = 3.18.12

* modified models.dat by removing "hp_" prefix

and now it seems to start scanning but it hangs after a little.
Now it say http error 503.. attached full log

brian_p (claremont102) wrote :

I cannot account for your experience with hp-scan. Using it with a USB-connected PSC 1300 here does no such thing. Altering models.dat? That shouldn't be needed as it has "plugin=0". Try xsane or simple-scan.

In your journalctl there is the line

  bb_escl.c 1558: Requested_width = [2550], max_width = [2549]

This is immediately followed by the 409 because a request is made which conflicts with max_width. My thinking is that bb_escl.c has it wrong. The max_width here is 2550. I can give you a command if you want to find what it is for your device, but the device has to be on the network.

--
Brian.

I can scan via network and I get a 503 error like previous test.
409 error seems disappeared after I removed the plugin.

I can try your command to test out max-width!

brian_p (claremont102) wrote :

curl -v -s http://<IP_or_hostname.local>:8080/eSCL/ScannerCapabilities

I'd be interested in seeing what you get so that I can compare it with my machine's ouput.

--
Brian.

here is the output! hope you can find the culprit! :)

brian_p (claremont102) wrote :

Please would you describe how you got scan-debug_wifi.txt?

--
Brian.

using hp-scan and network device and looking output in journalctl -f

brian_p (claremont102) wrote :

scan-debug_wifi.txt
-------------------
scl_open() calling bb_escl.so PASSED
scan/sane/escl.c 89: Calling escl bb_unload:

Plug-in software appears to be still available and being used. Whenever I have wanted to get rid of it I have deleted all associated directories in /usr/share/h[lip. It's possible the 503 error merely replaces the 409 error. 503 is given when the web server on the scanner refuses to accept something.

ScannerCapabilities.txt
-----------------------
In conradiction to your logs - MaxWidth>2550<
I cannot think of any other simple approach to tackle this issue or a way of reproducing it here. If the problen lies entirely with libsane-hpaio, I haven't much to offer. BTW, I am working with Debian packages.

--
Brian.

I've uninstalled hplip and removed /usr/share/hplip dir and reinstalled it back.

Unfortunately it always ask for plugin installation even modifying models.dat (stripping hp_).

So without plugin the scan process doesn't start.. instead if I install the plugin it says 503.
Frustating!

Do you know how to ask support directly to hplip developers?

brian_p (claremont102) wrote :

> I've uninstalled hplip and removed /usr/share/hplip dir and reinstalled it back.
>
> Unfortunately it always ask for plugin installation even modifying models.dat
> (stripping hp_).

The stripping would (IMO) only be needed for a network printer with mdns. Being asked (or made) to install a plugin is beyond my experience.

> So without plugin the scan process doesn't start.. instead if I install the plugin
> it says 503.
> Frustating!

Very; particularly when all the documentation indicates one isn't need. Sorry it didn't work out.

> Do you know how to ask support directly to hplip developers?

There is only Launchpad. HPLIP developers do read the reports and often respond to them.

Scanning here is generally of full pages over wireless with a set resolution. Nothing fancy; just get the job done. Users are given the script scan.py, obtainable from

  https://github.com/kno10/python-scan-eSCL

Make it executable and

  scan.py <output_file> <resolution>

output_file is a jpeg. With your device, resolution is in the range 200-600. Rudimentary, but it works well for me. All processing takes place on the device, so no HPLIP or other software is needed. It could suit you.

--
Brian.

no luck also with this tool!
the webserver on the printer always answers with a 503 error.

brian_p (claremont102) wrote :

Dispiriting! I imagine you have tried switching the device on and off?

The scanner is found and a scan request is made. The response is a location. Accessing the location should cause scanning to take place and a file to be downloaded to out.jpeg.

Location: http://192.168.1.173:80/eSCL/ScanJobs/pcluyfwp-bt6d-cdkq-1003-qviyb7lo

I reckon the port should be 8080. It is what I use here and it is what you used earlier to get the scanner capabilities. I do not know why the scanner says it is port 80, but the service (scanning and downloading) is unavailable on this port. At least, that is my theory. Let's test it.

Use scan.py again. Copy and paste the location, change it to

http://192.168.1.173:8080/eSCL/ScanJobs/<Whatever_UUID_is_given>/NextDocument

and do

curl -v -s http://192.168.1.173:8080/eSCL/ScanJobs/<Whatever_UUID_is_given>/NextDocument > out.jpg

You have to be quick with this because the request expires in about 30 seconds.

--
Brian.

I was trying with wget to get the image and it works!. I didn't think about curl :)
Now I'm modifying scan.py to suit my needs!

Well we found a workaround.. I'm really happy! thanks for your great support mate!

What remains a mystery is why I receive a 503 error using the other tools! https? certificate? auth?

brian_p (claremont102) wrote :

wget is as suitable a tool as curl; the location should also display in a web browser. Did port 80 work with wget? (I was thinking in terms of a firmware bug). Perhaps not all HP eSCL scanners work in exactly the same way.

I'm glad we got somewhere with this, even though it does not solve the HPLIP problem. Your extensive logging and testing helped considerably; thanks. When you complete your scan.py modifications would you please post the new script here?

--
Brian.

Port 80 here works the same way as 8080. I don't know why it is automatically choosen instead of 8080.

Attached there is my modified scan.py script.
I'm not a python expert so it could prettier but it works for me :)

brian_p (claremont102) wrote :

> Port 80 here works the same way as 8080.

So I found out earlier. Confirmation is good to get.

> Attached there is my modified scan.py script.
> I'm not a python expert so it could prettier but it works for me :)

Thanks. I don't know any python - but can fiddle. :)

From before:

> The evidence from models.dat is that a plug-in is not required.

Famous last words! Knowing now exactly what the MFP is (HP LaserJet MFP M28w), a closer look at models.dat indicates that (as you said all along) it is required. Recalling

> bb_escl.c 1558: Requested_width = [2550], max_width = [2549]

I wonder what happens if a width less than 2549 is requested.This should do it

hp-scan -d <USB_or_network_URI> -a 0,0,20,20

Does that scan?

--
Brian.

unfortunately it doesn't work :(
any other way to pass width? maybe hardcode bb_escl.c? just wondering!

-> % hp-scan -d "hpaio:/net/laserjet_mfp_m28-m31?ip=192.168.1.173&queue=false" -a 0,0,20,20
HP Linux Imaging and Printing System (ver. 3.18.12)
Scan Utility ver. 2.2
warning: No destinations specified. Adding 'file' destination by default.
Using device hpaio:/net/laserjet_mfp_m28-m31?ip=192.168.1.173&queue=false
Opening connection to device...

Resolution: 300dpi
Mode: gray
Compression: JPEG
Scan area (mm):
  Top left (x,y): (0.000000mm, 0.000000mm)
  Bottom right (x,y): (20.000000mm, 20.000000mm)
  Width: 20.000000mm
  Height: 20.000000mm
Destination(s): file
Output file:
warning: File destination enabled with no output file specified.
Setting output format to PNG for greyscale mode.
warning: Defaulting to '/home/luca/hpscan001.png'.

Warming up...
Scanning...
error: SANE: Error during device I/O (code=9)
Closing device.

-> % hp-scan -d "hpaio:/usb/HP_LaserJet_MFP_M28-M31?serial=VNC3K44877" -a 0,0,20,20
HP Linux Imaging and Printing System (ver. 3.18.12)
Scan Utility ver. 2.2
warning: No destinations specified. Adding 'file' destination by default.
Using device hpaio:/usb/HP_LaserJet_MFP_M28-M31?serial=VNC3K44877
Opening connection to device...

Resolution: 300dpi
Mode: gray
Compression: JPEG
Scan area (mm):
  Top left (x,y): (0.000000mm, 0.000000mm)
  Bottom right (x,y): (20.000000mm, 20.000000mm)
  Width: 20.000000mm
  Height: 20.000000mm
Destination(s): file
Output file:
warning: File destination enabled with no output file specified.
Setting output format to PNG for greyscale mode.
warning: Defaulting to '/home/luca/hpscan001.png'.

Warming up...
Scanning...
error: SANE: Error during device I/O (code=9)
Closing device.

brian_p (claremont102) wrote :

> any other way to pass width? maybe hardcode bb_escl.c? just wondering!

No; bb_escl.c is closed source. Anyway, I'm not even sure it is the problem, although I must admit I'm leaning towards a bug in the plugin as the cause. Anyway, you are not the only one:

https://answers.launchpad.net/hplip/+question/675574

Time to move on. The developers can assess what we have done and go from there. You can now scan and I know more about scanning than I knew previously. Nice to have worked with you.

--
Brian.

Thanks for your support! Really appreciated!
I hope some developer will take care of this issue in the plugin.
Have a nice day ;)

petrj (petrjanousek-net) wrote :

I've just craeted command line scanning tool as a workaround for this bug. It works only with printer connected via network. Script scan.py did not work for me.

https://github.com/petrj/HPWifiScan

Enjoy

Samuele Rini (samuele-rini) wrote :

I have the same problem with latest hplip (now is @ version 3.19.3, released a few hours ago) and same printer, both with wi-fi or USB.
Linux Mint 19.1.

Any news on this issue?
Thanks.

Hi All,

This issue is seen as if we did not enable “ Enable Remote User Auto Capture “ option in the EWS page of the device.
Once we enabled this option, we were able to do the scan.

To enable the option :
1) Connect the device and PC in same network
2) Open a Web browser, and in the address field, type the device IP address exactly as it displays on the Configuration Page, and then press Enter.
NOTE: If the Web browser displays a message indicating that accessing the website might not be safe, select the option to continue to the website. Accessing this website will not harm the computer.
3) On the top navigation tabs, select the Security tab.
4) In the Web Scan Auto Capture Jobs, select the Enable Remote User Auto Capture check box.
After that restart the device (i.e., printer/scanner)

Thanks,
Umesh

Changed in hplip:
status: New → In Progress
brian_p (claremont102) wrote :

@lucazade and Samuele Rini (and anyone else who is interested).

The result of testing Umesh's advice would be appreciated. There are quite a few reports of scanning not working for this device. Testing should be done with an HPLIP version of 3.18.9 or greater to avoid bug 1797501.

--
Brian.

brian_p (claremont102) wrote :

> Testing should be done with an HPLIP version of 3.18.9
> or greater to avoid bug 1797501.

That advice applies only if the scanner is on the network.

--
Brian.

@brian_p @Umesh Mahindrakar

I cannot find "Web Scan Auto Capture Jobs" and "Enable Remote User Auto Capture" check box in the settings.
This is my security setting page

brian_p (claremont102) wrote :

Thank you for your response, Luca.

Part of the reason I asked was because I could not find any mention of these settings in the manual. Also, the advice will not help with the M28a (USB only) as said in Message #11 at bug 1819742.

You earlier journalctl file has:

> scanimage[1676]: http.c 263: unable to open HP-ESCL-SCAN channel

ESCL is scan-type=9 in models.dat. The MFP M28-M31 section also has

   tech-class=Hbpl1
   family-class=PCLM

From a non-detailed analysis of the rest of models.dat it seems to me that these two lines are associated with scan-type=5. I reckon changing scan-type=9 to scan-type=5 in the relevant MFP M28-M31 section (there are two of them) is worth a try.

--
Brian.

brian_p (claremont102) wrote :

> .....is worth a try.

It was tried unsuccessfully in bug 1819742 (Message #13). Also, the EWS settings observation is commented on in bug 1821932 and bug 1819742 (Message #11).

--
Brian.

Ben Bipod (benbipod) wrote :

The command line wifi scanning tool (not using HPLIP) given in comment #36 works for me. Thanks a lot, @petrj!

Ben Bipod (benbipod) wrote :

To summarize the state of wifi scanning: hp-scan fails with output

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

corresponding to

> Apr 26 20:04:57 myhost /hp-scan[11160]: http.c 322: invalid http_status=503

in systemd journal/syslog. This is as far as you can get with HPLIP at the moment.

Then there is the generic eSCL scan tool (non-HPLIP) at https://github.com/kno10/python-scan-eSCL. It also fails with

> urllib2.HTTPError: HTTP Error 503: Service Unavailable

@Lucazade in comment #31 posted a modified version of that tool, essentially just delaying the retrieval of the scan result for 20 seconds after the scan request has been issued, thus avoiding the HTTP 503 error. I confirm this works for me and encourage everybody affected by this bug to try it out.

Also, @petrj in comment #36 announced another custom eSCL based scan tool at https://github.com/petrj/HPWifiScan, which I can also confirm works for me. Again, waiting for the result seems to be the essential feature, this tool more dynamically polls the job status instead of waiting for a fixed amount of time.

Many thanks to both @Lucazade and @petrj! I hope some HPLIP developer is reviewing this and can base a fix to the HPLIP software on the work done here.

MarkosJal (markosjal) wrote :

That Scan.py script fails on several printers I know of . If you have an android device try Mopria client when scanner is connected to network

Joel Maxuel (joel-maxuel) wrote :

It seems to me the error is of SANE timing out prematurely, as if it assumes the `hpaio` class all have automatic feeders.

It wouldn't be the first time a timeout needed to be adjusted:
> https://unix.stackexchange.com/questions/349850/xsane-error-during-read-error-during-device-i-o-canon-pixma-mg3550-scanner

This would work outside/avoiding the models.dat file model. However I cannot find the acceptable config option to suggest a change in timeout to `/etc/sane.d/hpaio.conf`.

Maybe someone would be better at discovering the SANE documentation for the `hpaio` backend than I am.

Jarno (yannick-jarno) wrote :

Hi,
no news since May....does anyone know if hp is working on this bug or if definitely the problem will not be solved .
rgds
Yannick

Gaurav Sood (gaurav-sood) wrote :

Hi
we are working on this. and will update you this week.

shivani mandora (shivani1708) wrote :

Hi,

We are seeing the issue with the scan for Hp LaserJet MFP M28-M31 in 3.18.4 release.
The scan issue has been fixed in 3.19.6 release.
Can you please download the latest HPLIP driver 3.19.6 and plugin file from the portal and check again. We have tested from our side.It should work fine.
If you face any problem please let me know.

Changed in hplip:
status: In Progress → Fix Released

It seems to work well.. tried with xscan, skanlite and skanimage and everything is fine.
I just get an I/O error sometimes, probably because I tried to scan to quickly after another scan.
I will continue to test and give feedback :)

jidge (jacques-guezenec) wrote :

No change with the problem with me. Context Xubuntu 19.04, One minute before scan work between each page to scan.

I have deleted and re-installed HP-Lip 3.19.6: do nothing best. No change for the pb.

affects: hplip → ubuntu
Fulvio Brosio (fulvio-grrr) wrote :

Hi,
I've installed hplip 3.19.6 on my Debian Buster using experimental repositories. I've just purchased an M28a LaserJet.
With the new driver I'm able to scan just in text mode and 300dpi or 600dpi resolution (using Gnome simple scan tool). If I set the color scan mode (or picture mode), I get I/O error.

Thanks,
Fulvio

Jarno (yannick-jarno) wrote :

Hi,
Good news, it works.
The automatic installation of the plugin did not work, I had to install it manually
Thanks for your help
Yannick

Thomas Moreau (t-moreau) wrote :

Hi,
**Works** for me via WiFi with the 'hp-scan' CLI and Simple Scan 3.28.0

Fails with XSane 0.999

on Ubuntu MATE 18.04.2 LTS (32 bit)
with HPLIP 3.19.6 (from https://developers.hp.com/hp-linux-imaging-and-printing/gethplip)
and HPLIP-plugin 3.19.6 (from https://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/)

I can provide more details if needed.

Thanks.

Lorenzo J. Lucchini (ljl) wrote :

Did you have to install a binary plugin (using hp-plugin) for it to work, Thomas? (In theory none is required for this model.)

Did it work with Simple Scan without changing anything in particular?

brian_p (claremont102) wrote :

I would not have revisited this bug report if it had not been for

https://bugs.launchpad.net/hplip/+bug/1840842

Now I find it is fixed. However, I feel like complaining about the way the issue has been treated.

1. Bug reported on 2019-01-12; fix announced on 2019-07-17. A 6 month wait.

2. In 3.19.6, models.dat still has "plugin=0". Why then is a plugin required? Nobody has ever explained.

3. "scan-type=9" is still undocumented.

4. The Release Notes for 3.19.6 have absolutely no mention of this bug (or any other bug) being fixed. Talk about keeping everyone in the dark. I regard this lack of changelog detail as a serious defect.

5. Correct information about the cause or origin of the issue is completely lacking. If upstream do not know, at least say so; we are not mushrooms. :)

6. HPLIP is important, quality software. It deserves better.

--
Brian.

Thomas Moreau (t-moreau) wrote :

Hi,

@Lorenzo J. Lucchini (ljl):
1. Yes, you do need to install the plugin, despite the documentation saying the opposite.
2. Actually, it seems to work with both Simple Scan and XSane, but only in text/gray mode, not in image/color mode (my tests were not extensive enough. I probably declared victory too early...).

brian_p (claremont102) raised really good points. I'd like them to be addressed.

Thomas.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers