Dave,
Thanks for the excellent tip. 
I added similar code to my program and I believe it fixed the problem
with the bottom of the page being corrupted.
I wait for the printer to go idle before I close USB.

However, the problem with SYSTEM_ERROR still occurs and I will give you
some more info:
1. Never happens after power up (always works OK)
2. Seems to happen when I start a new job right after another print job.
After the previous job, the printer is still doing some head movement
and cleaning (?) for a while but its status says it is idle.
3. Querying ID works without a problem, I can get status and ink levels,
the error happens only when I try to write bulk (print) data.
4. The error happens because printer is not responding (to bulk data)
and timeout occurs (see #3, it responds to querying)
5. Pressing X button on the front panel fixes the problem
6. Sometimes, retrying the print job also makes it work

It seems that the printer goes into some kind of error mode and does not
accept print data.
Querying always works OK.

Any ideas,

Martin

-----Original Message-----
From: Suffield, David [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 29, 2007 3:04 PM
To: Martin Kajdas
Subject: RE: [HPLIP-Devel] Print errors and hangs using HPIJS with HP
DJ4160

> Yes, I am using  --enable-hpijs-only-build, but also printer status 
> and bi-di comm are used by default by HPIJS for this printer.
> Then, I link all of the HPIJS object files into a static library and 
> then with my app.
> BTW, I link libusb also for other devices that the application uses 
> (i.e. USB drives).

ok
 
> For HPIJS, I first call usb_find_busses, ubs_find_devices, usb_open, 
> usb_claim_interface, usb_set_altinterface, and after done, I call 
> usb_release_interface, usb_close.
> Are you saying I do not need to do all that?

ok, so you are doing your own device discovery.
 
> The SYSTEM_ERROR is returned by constructor of Job class and is 
> defined in APDK documentation.
> I think you maybe thinking about HPIJS server which I do not use.
> I use hplip-2.7.7/prnt/hpijs code by itself.

ok, so you are not using IJS interface. If you look at the hpijs code,
there is code to force the apdk run in uni-di only. Meaning no device-id
will be queried by the apdk. Which may have something to do with this
error during printer instantiation.
 
> I guess it is possible that I call usb_close while the buffered data 
> is still being transmitted.
> I would expect usblib to take care of this and hpijs to work properly 
> with it.
> I thought that when SendRasters returns, it is OK call
> NewPage() and to close usb.

It's been my experience that libusb will not take care of flushing the
data pipe line for you. If you look at my hp.c code I wait for the
printer to go idle by querying device-id, then close the usb device.

-dave

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
HPLIP-Devel mailing list
HPLIP-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hplip-devel

Reply via email to