hi,

I think there was abug in IFHP, discovered last week, concerning 
accounting on the 4xxx series from HP:

 > From [EMAIL PROTECTED] Fri Nov 16 13:11:30 2001
 > Date: Fri, 16 Nov 2001 16:11:24 -0500 (EST)
 > From: Jason Keltz <[EMAIL PROTECTED]>
 > To: Patrick Powell <[EMAIL PROTECTED]>
 > Subject:  HP 4100 page accounting
 >
 > Hi Patrick,
 >
 > I'm pretty sure I've found a bug in ifhp that was causing the problems
 > with the HP 4100 print accounting.
 >
 > This morning, I wrote a little tcl script that talked to the 4100 
printer,
 > setting the proper job USTATUS, sending a job, listening for the
 > responses, and everything was as it should be.
 >
 > I then looked at the ifhp code with a coworker and we found the problem.
 >
 > In the function pjl_job(), in ifhp.c, there are these two lines:
 >
 >         len = strlen(buffer);
 >         SNPRINTF(buffer+len, sizeof(buffer)-len) Job_display, Jobname );
 >
 > I believe they are both incorrect.
 >
 > First off, buffer has no value up to that point in the function, so why
 > are you getting its length?
 >
 > Also, the SNPRINTF function ends up printing Job_display instead of
 > Jobstart_str which is definately an error.  Here are the definitions of
 > both of those:
 >
 >  char *Job_display=" DISPLAY = \"%s\" ";
 >  char *Jobend_str="@PJL EOJ NAME = \"%s\"";
 >
 > ... and in fact, a previous ifhp version did have Jobend_str.  I checked.
 >
 > Why this was working on any of our other printers, I do not know.  More
 > than likely the 4100 is smarter and doesn't like the bad syntax.  The
 > Put_pjl was throwing away the error without commenting on it.
 >
 > The two lines should be replaced with just this one:
 >  SNPRINTF(buffer, sizeof(buffer)) Jobstart_str, Jobname );
 >
 > Works for me..
 >
 > Jas.
 >


Christopher Lee wrote:

>Hi,
>
>I'm attempting to do printer accounting with LPRng+ifhp. The printers in use
>are all HP4000 series (be it 4000, 4050 or 4100). The Page Description
>Language we are using is PCL (5 i think).
>
>Currently, our print jobs from NT workstations are sent via samba to our
>unix server. From here the job is then forwarded onto a smaller linux box
>that is attached to the printer's parallel port. The smaller boxes run
>ZipSlack (7.1, 2.2.16 Linux kernel) and LPRng (3.8.1) and ifhp (3.4.7).
>We've had to go this route since not all our HP4000's have JetDirect cards
>installed, some currently use NetGear PS110 print servers, which I'm told
>can't do bi-directional communications, although I haven't tested it for
>myself, and really don't have the time.
>
>Anyway, I've got things setup relatively smoothly so far, and printing from
>an NT workstation through to the HP is working. However the *big* problem
>I'm having is getting a page count back from the printer.
>
>I've toyed with the printcap entry for LPRng to no end, and still can't get
>a page count back. If anyone out there has a working
>printcap/ifhp.conf/anything else I need, could you please, please please
>send me a copy/snippet of the relevant code?
>
>I'm to the stage where I really need to get things working before this
>project gets scrapped. I've read (and printed) the ifhp-howto, and read
>through bits of the LPRng-howto, but I've found the parts on accounting to
>be a bit thin, I think I really need dumbed down step-by-step instructions
>on how to get it working, and working examples would be a good place to
>start.
>
>At present most of my printcap has been pieced together from bits and pieces
>I've read between the two howto's. I just came across a section of interest
>in the ifhp-howto, section 4.9 - PS,PCL,PJL Printer with Parallel Port
>Connection.  From what I can tell I should probably have ":rw" defined in my
>printcap to get the parallel port opened read-write. I had assumed this
>would have happened by default, but perhaps it could be why I'm not getting
>a pagecount?
>
>We had a mild success today in getting a pagecount to work, basically we
>followed through the ifhp readme to test it's working, and dumped the one.ps
>file through ifhp out to a file. We then cut just the top part of the PJL
>commands out, and inserted our own line, "@PJL INFO PAGECOUNT", which I
>found looking through the ifhp.c source, then echoed the file out to
>/dev/lp0, and cat'd back /dev/lp0 and we got the magic page count number
>back.
>
>Yet I'm still unable to get LPRng+ifhp to get me this figure, and can't
>figure out what I'm doing wrong, so I'll post our most recent printcap we've
>been using and see if someone can point me in the right direction.
>
>The ifhp.conf file is (to the best of my knowledge) the one that came with
>ifhp, I don't think I modified it, as I'm sure it had more or less
>everything correct. The accounting.pl is the one that shipped with LPRng (or
>was it ifhp?), and I simply copied it to the /usr/local/libexec/filters
>directory since the examples had it that way.
>
># B10 JetDirect HP Printer
>#
>b10-lp
>        :sh
>        :ml=0
>        :mx=0
>        :lp=/dev/lp0
>        :sd=/var/spool/lpd
>        :af=acct
>        :ps=status
>        :as=|/usr/local/libexec/filters/accounting.pl start
>        :ae=|/usr/local/libexec/filters/accounting.pl end
>        :filter=/usr/local/libexec/filters/ifhp
>        :of=/usr/local/libexec/filters/ifhp
>        :ifhp=model=hp4000,of_options=status pagecount waitend
>
>#        :ifhp=model=default
>#        :of=/usr/local/libexec/filters/ifhp
>#        :ifhp=model=hp6p,of_options=sync pagecount waitend
>
>Any help with this would be greatly appreciated :-)
>
>PS: Does anyone know where to find a PJL Technical Reference from HP? We
>have the PCL 5e technical reference in PDF from HP, but even though the
>cover says PCL/PJL it barely mentions PJL, and "pagecount" and "page count"
>certainly don't exist anywhere in the document.
>
>Regards,
>Chris Lee
>
>
>
>-----------------------------------------------------------------------------
>YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
>The address you post from MUST be your subscription address
>
>If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
>or lprng-digest-requests) with the word 'help' in the body.  For the impatient,
>to subscribe to a list with name LIST,  send mail to [EMAIL PROTECTED]
>with:                           | example:
>subscribe LIST <mailaddr>       |  subscribe lprng-digest [EMAIL PROTECTED]
>unsubscribe LIST <mailaddr>     |  unsubscribe lprng [EMAIL PROTECTED]
>
>If you have major problems,  send email to [EMAIL PROTECTED] with the word
>LPRNGLIST in the SUBJECT line.
>-----------------------------------------------------------------------------
>

-- 
/* Christoph Beyer | Office: Building 2b / 23 *\ 
 * DESY            | Phone: 040-8998-2317     * 
 * - IT -          | Fax: 040-8998-4060       * 
\* 22603 Hamburg   | http://www.desy.de       */





-----------------------------------------------------------------------------
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address

If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body.  For the impatient,
to subscribe to a list with name LIST,  send mail to [EMAIL PROTECTED]
with:                           | example:
subscribe LIST <mailaddr>       |  subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr>     |  unsubscribe lprng [EMAIL PROTECTED]

If you have major problems,  send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------

Reply via email to