Hello everyone,
I try to get the page counter from an HP 4 si mx using a perl script. While
it works perfectly with other HP printers (4050, 4100), I never get the
expected answer.
Here's the script I use (found on this list)
#!/usr/bin/perl
use IO;
use Socket;
use strict;
my $ipaddr = '130.104.3.15:9100';
my $sock=IO::Socket::INET->new(PeerAddr =>$ipaddr, Proto => 'tcp', Type =>
SOCK_
STREAM) or die "socket : $!";
my $eol="\x0a";
my $esc="\x1B";
my $pagecount="$esc\%-12345X\@PJL JOB$eol" . "\@PJL INFO PAGECOUNT $eol" .
"$esc
\%-12345x";
my $stuff;
$sock->send("$pagecount");
$sock->recv($stuff, 1024);
print "Received : $stuff\n";
close $sock;
The result I get is :
Received : @PJL USTATUS TIMED
CODE=10001
DISPLAY=":"
ONLINE=TRUE
When expecting :
Received : @PJL INFO PAGECOUNT
18043
-----------------------------------------------------------------------------
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.
-----------------------------------------------------------------------------