Resetting epson chip in linux - tip.

S

Stoyan Stoyanov

For Windows just grab the tool form http://www.ssclg.com/epsone.shtml
- Thanks guys!

For Linux you need something like the perl script below and a
communication log file for your printer. The communication file can be
generated using the above mentioned tool for windows and a usb
monitoring tool such as
http://www.hhdsoftware.com/usbmon.html#Download. Once you have the
communication log you won't need windows to reset your cartridges.

Note the script expects the communication log to be in the following
format but you can change it the way you like it (you can find a real
example at the end of the posting):

-> XX XX XX...
<- XX XX XX...


Here's the script:

----------------------------------------
#!/usr/bin/perl -w
use strict;
use Time::HiRes qw(usleep);

my $DEVICE = '/dev/usb/lp0';
my $COMM = './all';

my @buffout = ();
my @buffin = ();

open (COMM, $COMM);
while (<COMM>) {
chomp;
my ($line, $data) = ($_, $_);
my $buffer;
$data =~ s/^\S+\s*//;
foreach (split(/\s+/,$data)) {
$buffer .= sprintf ("%c", hex $_);
}
$buffer = 'noresponse' unless (defined $buffer);
if ($line =~ /^->\s/) {
push @buffout, $buffer;
}
else {
push @buffin, $buffer;
}
}
close (COMM);


my $count = @buffout;

for (my $i=0; $i<$count; $i++) {
my $resp;
open(FH, "> $DEVICE") or die $!;
print FH $buffout[$i] or die $!;
close (FH);
usleep (100);
next if ($buffin[$i] eq 'noresponse');
open (FH, $DEVICE) or die $!;
(defined ($resp = <FH>)) or die $!;
close (FH);
if ($buffin[$i] =~ /^$resp/) {
print "Response $i received OK\n";
}
else {
print "Response $i doesn't match\n";
}
usleep (100);
}

close (FH);
-----------------------------------

If you happen to have Epson Stylus Color 777 here is a real working
communication file for you. Just save it as 'all' in the same
directory as the above script and run the script. Don't forget to turn
off your printer for a few minutes after executing the script.

-------------------------------
-> 00 00 00 1B 01 40 45 4A 4C 20 31 32 38 34 2E 34 0A 40 45 4A 4C 0A
40 45 4A 4C 0A
<- 00 00 00 08 01 00 C5 00
-> 00 00 00 08 01 00 00 0A
<- 00 00 00 09 01 00 80 00 0A
-> 00 00 00 11 01 00 09 45 50 53 4F 4E 2D 44 41 54 41
<- 00 00 00 13 01 00 89 00 40 45 50 53 4F 4E 2D 44 41 54 41
-> 00 00 00 11 01 00 09 45 50 53 4F 4E 2D 43 54 52 4C
<- 00 00 00 13 01 00 89 00 02 45 50 53 4F 4E 2D 43 54 52 4C
-> 00 00 00 11 01 00 01 02 02 04 00 04 00 00 00 00 00
<- 00 00 00 10 01 00 81 00 02 02 00 40 01 00 00 00
-> 00 00 00 11 01 00 01 40 40 04 00 04 00 00 00 00 00
<- 00 00 00 10 01 00 81 00 40 40 04 00 04 00 00 00
-> 00 00 00 0D 01 00 04 02 02 00 01 FF FF
<- 00 00 00 0C 01 00 84 00 02 02 00 01
-> 00 00 00 0B 01 00 03 02 02 00 01
<- 00 00 00 0A 01 00 83 00 02 02
-> 02 02 00 11 00 00 7C 7C 07 00 06 15 42 BD 21 02 00
<- 02 02 00 10 00 01 7C 7C 3A 34 32 3A 4F 4B 3B 0C
-> 00 00 00 0D 01 00 04 02 02 00 01 FF FF
<- 00 00 00 0C 01 00 84 00 02 02 00 01
-> 00 00 00 0B 01 00 03 02 02 00 01
<- 00 00 00 0A 01 00 83 00 02 02
-> 02 02 00 11 00 00 7C 7C 07 00 06 15 42 BD 21 03 00
<- 02 02 00 10 00 01 7C 7C 3A 34 32 3A 4F 4B 3B 0C
-> 00 00 00 0D 01 00 04 02 02 00 01 FF FF
<- 00 00 00 0C 01 00 84 00 02 02 00 01
-> 00 00 00 0B 01 00 03 02 02 00 01
<- 00 00 00 0A 01 00 83 00 02 02
-> 02 02 00 11 00 00 7C 7C 07 00 06 15 42 BD 21 04 00
<- 02 02 00 10 00 01 7C 7C 3A 34 32 3A 4F 4B 3B 0C
-> 00 00 00 0D 01 00 04 02 02 00 01 FF FF
<- 00 00 00 0C 01 00 84 00 02 02 00 01
-> 00 00 00 0B 01 00 03 02 02 00 01
<- 00 00 00 0A 01 00 83 00 02 02
-> 02 02 00 11 00 00 7C 7C 07 00 06 15 42 BD 21 05 00
<- 02 02 00 10 00 01 7C 7C 3A 34 32 3A 4F 4B 3B 0C
-> 00 00 00 0D 01 00 04 40 40 00 C8 FF FF
<- 00 00 00 0C 01 00 84 00 40 40 00 1C
-> 00 00 00 0B 01 00 03 40 40 00 C8
<- 00 00 00 0A 01 00 83 00 40 40
-> 40 40 00 13 00 00 1B 7C 00 08 00 06 15 62 9D 31 00 00 00
<-
-> 00 00 00 0D 01 00 04 02 02 00 01 FF FF
<- 00 00 00 0C 01 00 84 00 02 02 00 01
-> 00 00 00 0B 01 00 03 02 02 00 01
<- 00 00 00 0A 01 00 83 00 02 02
-> 02 02 00 11 00 00 7C 7C 07 00 06 15 42 BD 21 06 00
<- 02 02 00 10 00 01 7C 7C 3A 34 32 3A 4F 4B 3B 0C
-> 00 00 00 0D 01 00 04 02 02 00 01 FF FF
<- 00 00 00 0C 01 00 84 00 02 02 00 01
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top