Martin Kajdas | 31 Aug 17:41

Re: Print errors and hangs using HPIJS with HP DJ4160

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:david.suffield <at> hp.com] 
Sent: Wednesday, August 29, 2007 3:04 PM
(Continue reading)

Martin Kajdas | 31 Aug 20:54

Re: Print errors and hangs using HPIJS with HP DJ4160

I have more details after tracing the communication: 
The error comes from dj3320.cpp, line 2928 (bCreditInitialized == 0)
because UpdateState(TRUE) above never returns TRUE.
I traced UpdateState and the error comes from GetPackets(...) == 0
I do not know the LDL protocol but there is something wrong with the
printer sometimes.
What can I do?
Martin

-----Original Message-----
From: Martin Kajdas 
Sent: Friday, August 31, 2007 8:41 AM
To: 'Suffield, David'
Cc: hplip-devel <at> lists.sourceforge.net
Subject: RE: [HPLIP-Devel] Print errors and hangs using HPIJS with HP
DJ4160

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,
(Continue reading)

Suffield, David | 31 Aug 21:33
Favicon

Re: Print errors and hangs using HPIJS with HP DJ4160

Credit pacing should not be enable for LDL. You are not running with
bi-di disabled. You need to look at the hpijs glue code and see how
bi-di is disabled (ie: see RestIOMode) before the printer job
instantiation.

-dave

> -----Original Message-----
> From: Martin Kajdas [mailto:mkajdas <at> MKPROD.com] 
> Sent: Friday, August 31, 2007 11:55 AM
> To: Suffield, David
> Cc: hplip-devel <at> lists.sourceforge.net
> Subject: RE: [HPLIP-Devel] Print errors and hangs using HPIJS 
> with HP DJ4160
> 
> I have more details after tracing the communication: 
> The error comes from dj3320.cpp, line 2928 
> (bCreditInitialized == 0) because UpdateState(TRUE) above 
> never returns TRUE.
> I traced UpdateState and the error comes from GetPackets(...) 
> == 0 I do not know the LDL protocol but there is something 
> wrong with the printer sometimes.
> What can I do?
> Martin
> 
> 
> -----Original Message-----
> From: Martin Kajdas
> Sent: Friday, August 31, 2007 8:41 AM
> To: 'Suffield, David'
(Continue reading)

Martin Kajdas | 31 Aug 23:10

Re: Print errors and hangs using HPIJS with HP DJ4160

That was it.
It was my bug; I already did call ResetIOMode but because of my bug it
did not execute properly.
After I fixed the bug, it skips the credit pacing like it suppose to and
it seems to work better and faster.

Amazingly, it worked 90% of the time and I did not suspect something
this critical being broken.

The problem is of course is understanding LDL and as far as I know the
spec is not released.
Is this so and why?

I will do some more testing and report any issues.
Martin

-----Original Message-----
From: Suffield, David [mailto:david.suffield <at> hp.com] 
Sent: Friday, August 31, 2007 12:33 PM
To: Martin Kajdas
Cc: hplip-devel <at> lists.sourceforge.net
Subject: RE: [HPLIP-Devel] Print errors and hangs using HPIJS with HP
DJ4160

Credit pacing should not be enable for LDL. You are not running with
bi-di disabled. You need to look at the hpijs glue code and see how
bi-di is disabled (ie: see RestIOMode) before the printer job
instantiation.

-dave
(Continue reading)

Martin Kajdas | 6 Sep 18:19

Re: Print errors and hangs using HPIJS with HP DJ4160

I noticed that when I switched to uni-di mode, the BusyWait() is not
called anymore.
BusyWait function had all my calls to OS to keep it alive.
Now, my keyboard (and screen) are not updated until the printer
finishes.
To fix this I added the OS calls to ToDevice() which fixed the problem
but I am wondering if this is the best place to put it.
Any suggestions?

Also, when the OS detects Escape key, I return JOB_CANCELED from
ToDevice() but it does not stop gracefully.
What is the proper way to cancel the job?
Martin

-----Original Message-----
From: hplip-devel-bounces <at> lists.sourceforge.net
[mailto:hplip-devel-bounces <at> lists.sourceforge.net] On Behalf Of Martin
Kajdas
Sent: Friday, August 31, 2007 2:10 PM
To: Suffield, David
Cc: hplip-devel <at> lists.sourceforge.net
Subject: Re: [HPLIP-Devel] Print errors and hangs using HPIJS with HP
DJ4160

That was it.
It was my bug; I already did call ResetIOMode but because of my bug it
did not execute properly.
After I fixed the bug, it skips the credit pacing like it suppose to and
it seems to work better and faster.

(Continue reading)

Martin Kajdas | 23 Oct 17:40

How to abort printing

I have an embedded system that uses HPIJS only to talk to the printer
(DeskJet D4160) using dj3320.cpp and I it is mostly working.
However, I cannot find a proper way to abort printing.
When a user presses an Escape key while printing, I set DisplayStatus to
DISPLAY_PRINTING_CANCELED and return JOB_CANCELED in ToDevice() and
BusyWait() functions which test the escape flag every time they are
called.

I do not remember all of the details now, but the printing stops but
some debugging errors are generated and/or printed on screen and it
takes a while for the printer to recover or it is not responsive at all
(blinking lights?).

Before I start bothering you with the details, I would like to find out
if what I am doing is correct and what is the proper sequence of
aborting because most likely it is my code's fault.

Anther, issue I have is that the last print line (about 10mm wide) on
the page is only done once instead of twice (?) and it appears much
lighter and the color is not completely filled in.
I tried all kinds of delays and status checking to let the printer
finish the job before ejecting, without any success.
Any ideas?

Martin

-------------------------------------------------------------------------
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.
(Continue reading)

Favicon

Re: How to abort printing

Are you looking at the return value from Job::SendRaster?
Looks like hpijs.cpp is ignoring the return value from SendRaster. In
the main loop,
it is calling pSS->ProcessRaster and ignoring the return value. You will
have to
look at the return value and break out of the loop if you get a
JOB_CANCELED error.
Raghu 

-----Original Message-----
From: hplip-devel-bounces <at> lists.sourceforge.net
[mailto:hplip-devel-bounces <at> lists.sourceforge.net] On Behalf Of Martin
Kajdas
Sent: Tuesday, October 23, 2007 8:41 AM
To: Suffield, David
Cc: hplip-devel <at> lists.sourceforge.net
Subject: [HPLIP-Devel] How to abort printing

I have an embedded system that uses HPIJS only to talk to the printer
(DeskJet D4160) using dj3320.cpp and I it is mostly working.
However, I cannot find a proper way to abort printing.
When a user presses an Escape key while printing, I set DisplayStatus to
DISPLAY_PRINTING_CANCELED and return JOB_CANCELED in ToDevice() and
BusyWait() functions which test the escape flag every time they are
called.

I do not remember all of the details now, but the printing stops but
some debugging errors are generated and/or printed on screen and it
takes a while for the printer to recover or it is not responsive at all
(blinking lights?).
(Continue reading)

Martin Kajdas | 23 Oct 18:34

Re: How to abort printing

This is a statically linked app using HP's APDK specification so HPIJS
server (hpijs.cpp) is not used.
I checked my loop and I do exit page printing loop when SendRaster()
returns any error > 0.
Then I call NewPage() which returns another status and if this status is
also > 0, then I exit job completely.
This may be my problem and I will confirm it (SendRaster error should
not be overwritten by NewPage error: could be 0 by then).
Martin

-----Original Message-----
From: Cauligi, Raghothama S [mailto:raghothama.cauligi <at> hp.com] 
Sent: Tuesday, October 23, 2007 9:12 AM
To: Martin Kajdas; Suffield, David
Cc: hplip-devel <at> lists.sourceforge.net
Subject: RE: [HPLIP-Devel] How to abort printing

Are you looking at the return value from Job::SendRaster?
Looks like hpijs.cpp is ignoring the return value from SendRaster. In
the main loop, it is calling pSS->ProcessRaster and ignoring the return
value. You will have to look at the return value and break out of the
loop if you get a JOB_CANCELED error.
Raghu 

-----Original Message-----
From: hplip-devel-bounces <at> lists.sourceforge.net
[mailto:hplip-devel-bounces <at> lists.sourceforge.net] On Behalf Of Martin
Kajdas
Sent: Tuesday, October 23, 2007 8:41 AM
To: Suffield, David
(Continue reading)

Martin Kajdas | 23 Oct 19:16

Re: How to abort printing

I am sorry, but previous email was incorrect.
I exit both loops when SendRaster() returns any error > 0, so no NewPage
is called().
My guess is that something happens that breaks the printer communication
sequence and the printer or USB driver gets confused.
The latest HPIJS fixed many problems but I believe it is not completely
debugged.
Martin

-----Original Message-----
From: hplip-devel-bounces <at> lists.sourceforge.net
[mailto:hplip-devel-bounces <at> lists.sourceforge.net] On Behalf Of Martin
Kajdas
Sent: Tuesday, October 23, 2007 9:35 AM
To: Cauligi, Raghothama S; Suffield, David
Cc: hplip-devel <at> lists.sourceforge.net
Subject: Re: [HPLIP-Devel] How to abort printing

This is a statically linked app using HP's APDK specification so HPIJS
server (hpijs.cpp) is not used.
I checked my loop and I do exit page printing loop when SendRaster()
returns any error > 0.
Then I call NewPage() which returns another status and if this status is
also > 0, then I exit job completely.
This may be my problem and I will confirm it (SendRaster error should
not be overwritten by NewPage error: could be 0 by then).
Martin

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
(Continue reading)

Martin Kajdas | 23 Oct 20:18

Re: How to abort printing

I tried to duplicate the problem and I do not think the problem is with
aborting the print.
It seems to abort fine (at least for now).
However, the problem is with the printer doing its stuff (cleaning?)
after the abort and after normal print also, when if I send another job
to it, it either keeps blinking or just hangs up.
I believe that the printer returns IDLE status when the new job is sent
because I test for it when I close the (previous) job.
I need to reset the computer and printer to recover.
Martin

-----Original Message-----
From: Martin Kajdas 
Sent: Tuesday, October 23, 2007 10:16 AM
To: Martin Kajdas; Cauligi, Raghothama S; Suffield, David
Cc: hplip-devel <at> lists.sourceforge.net
Subject: RE: [HPLIP-Devel] How to abort printing

I am sorry, but previous email was incorrect.
I exit both loops when SendRaster() returns any error > 0, so no NewPage
is called().
My guess is that something happens that breaks the printer communication
sequence and the printer or USB driver gets confused.
The latest HPIJS fixed many problems but I believe it is not completely
debugged.
Martin

-----Original Message-----
From: hplip-devel-bounces <at> lists.sourceforge.net
[mailto:hplip-devel-bounces <at> lists.sourceforge.net] On Behalf Of Martin
(Continue reading)


Gmane