-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HP Color LaserJet Enterprise MFP M578 detection during printer start up #64
Comments
Hi Timo,
Looks like it is not enough, because regardless of status, if May be, for this kind of device, it will be better to simply delay initialization after device was connected, based on quirk? |
BTW, |
As workaround, I'm using now: --- a/device.go
+++ b/device.go
@@ -84,6 +84,10 @@ func NewDevice(desc UsbDeviceDesc) (*Device, error) {
if err != nil {
dev.Log.Error('!', "IPP: %s", err)
+ if strings.StartsWith(err.Error(), "HTTP: 503") {
+ err = ErrInitTimedOut
+ goto ERROR
+ }
}
log.Flush() This works because the In any case, not receiving the trailing
This is not a real option. When the device is connected via cable, and you hit power on. It takes about 1-2 minutes for the USB interface to come up, and then it takes 4-6 minutes for the IPP layers to be up. For those 4-6 minutes I see the On the other hand, if the printer is online, and I connect the cable, everything works immediately. Adding a 6 minute |
Yes, 6 minutes looks a little bit too much to wait. If we suppress the following logic in the
|
No. See first comment. During cold boot, there in the end will be a state that the printer query will return 503, but scanner will return 200. During this stage it will permanently detect the MFP as having scanner only and printing will not be available. |
Somewhat related to #32, I detected additional issues in this HP printer.
When the printer is starting up, it behaves as follows during early boot:
/ipp/print
requests return503 Service not ready
, and sadly it is missing the last\n
soipp-usb
does not see it as full request/eSCL/ScannerCapabilities
requests return404 Not Found
, and also miss the last\n
This results
ipp-usb
to reset and retry device initialization. This happens because theEsclService
init times out, and the error condition in https://github.com/OpenPrinting/ipp-usb/blob/master/device.go#L120 is triggered.Later during the startup sequence, the scanner side starts first responding with success, but IPP printer still gives 503. During this condition,
ipp-usb
is left in hung state. The printer is not detected, because the attribute reading aborts early in https://github.com/OpenPrinting/ipp-usb/blob/master/ipp.go#L155 when error is received. Therefor no timeout happens, and https://github.com/OpenPrinting/ipp-usb/blob/master/usbtransport.go#L550 triggers. This tries to indefinitely drain the response which never comes and the channels is left stuck. (Recovery can be done with restart ipp-usb, or disconnect/connect USB cable.)Perhaps the device init logic could be adjusted to automatically always do timeout retry if ipp return 503 error (either directly, or via quirk).
I wonder also if the response draining could be also also adjusted to cope better with printer bugs such as this one.
The text was updated successfully, but these errors were encountered: