OpenPrinting / ipp-usb

ipp-usb -- HTTP reverse proxy, backed by IPP-over-USB connection to device
BSD 2-Clause "Simplified" License
129 stars 11 forks source link

Unstable connection #3

Closed scubajeff closed 4 years ago

scubajeff commented 4 years ago

Compile latest ipp-usb from source on a Raspberry Pi 3B+ running Ubuntu 20.04 which connects to a HP LaserJet MFP M28a via usb. Printing is OK, but sometimes hang, and I have to switch off and switch on the printer to get it back to work. Browsing to printer sever at port 60000 hang every now and then, during which I see lot of messages saying "kernel: usb 1-1.1.2: usbfs: usb_submit_urb returned -121" in journalctl output. With sane-airscan, it reports finding a scanner, but fail to scan, the scanning bar in the machine started moving from the left to right, but stop in the middle.

scubajeff commented 4 years ago

I have latest sane 1.0.30 installed from ppa:rolfbensch/sane-git, so I try the escl backend, it also found the scanner, but scanimage -d escl:http://127.0.0.1:60000 > a.pnm gave this output:

Output format is not set, using pnm as a default.
scanimage: rounded value of br-x from 215.9 to 215.9
scanimage: rounded value of br-y from 297.011 to 297.011
scanimage: sane_start: Invalid argument

During this, I also find kernel: usb 1-1.1.2: usbfs: usb_submit_urb returned -121 error in journalctl output.

And the printer has to be reboot again.

alexpevzner commented 4 years ago

Hi @scubajeff,

I've tried to blindly fix it, please test again

scubajeff commented 4 years ago

Your fix works! Now the scanner can finish scanning. But no matter what format I try, jpeg, tiff, pnm, scanimage can't product correct result. I try vi those files, all start with a string State and end with the same string. I'm using eSCL backend that came with sane 1.0.30. Will try your airscan backend tomorrow. It's too late now.

The admin webpage works too. I only got hang once when I click the System tab, however no log in journalctl this time.

BTW, seems like I have to change this line in ipp-usb.conf so that the printer can be discovered on the net: interface = all

alexpevzner commented 4 years ago

To scan with scanimage you need to use its -o file option rather that redirect its output to file.

Can you reproduce web console hangup? If so, please send me fresh log files from the /var/log/ipp-usb/ directory.

Yes, interface = all enables network visibility, so printer can be exsed to the network without extra packages, like CUPS.

scubajeff commented 4 years ago

My bad. With -o file the scanner is working perfectly. When the console hangup, /var/log/ipp-usb/ has multiple entries of USB[1]: zero-size read. How can I send you the log file?

scubajeff commented 4 years ago

Did you mean that I don't need any CUPS package installed? Not just cups, but also cups-browsed, cups-daemon, cups-filters, cups-ipp-utils, cups-server-common, etc.?

scubajeff commented 4 years ago

Like I said, scanning locally with scanimage works. But trying to scan using simple-scan on another machine failed. The scanner got listed, but failed to scan. ipp-usb log shows that simple-scan tried to get GET /eSCL/ScanJobs/1.0/NextDocument HTTP/1.1 after a scan job created, that failed with 404. While local scanimage was doing GET /eSCL/ScanJobs/yk1lecc6-b1yz-v2zm-1005-9wqtyq05/NextDocument HTTP/1.1, it also failed with 404, but scan completed.

scubajeff commented 4 years ago

By the way, I'm using eSCL backend.

scubajeff commented 4 years ago

Some more observation fyi. If only ipp-usb is annoucing print queue, Android and Ubuntu machine on the same network will pick it up nicely, but iOS devices will not. If I create an avahi service file, avahi will announce it, it will show up in iOS printer list, but then Android and Ubuntu will list two print queues.

It would be nice to have ipp-usb to announce Airprint print queue to iOS devices.

alexpevzner commented 4 years ago

You may send me log files directly by e-main: pzz@apevzner.com

Please, try scanning with my eSCL backend:

May I ask you to send me Avahi service file, that works with iOS?

scubajeff commented 4 years ago

I tried your backend this morning. airscan-discover can find the scanner, but scanimage with airscan backend can't find any.

I will send you the log file and avahi service file when I get back home later.

scubajeff commented 4 years ago

I upgrade the Ubuntu client machine to sane 1.0.30, simple-scan works now. I had setup saned in the print server, and my scan client in Android phone also works. So the issues unsolved are hang in web console and proper way to share print queue and scan device. I've sent you email with log file and avahi service file. During this logging, I experienced hang when I try to open web console home tab.

alexpevzner commented 4 years ago

Hi @scubajeff,

I've created 3 new issues, based on your feedback: #4, #5 and #6

4 and #6 are now hopefully fixed (please, test and confirm)

5 is work in progress

alexpevzner commented 4 years ago

Please look to my comment in the #5