Re: Problem with Epson Pos Printer

Alan Stern <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
On Thu, 8 Mar 2007, Linos wrote:

> lsusb -v shows this for the Epson Printer:
> 
> Bus 002 Device 003: ID 04b8:0202 Seiko Epson Corp. Receipt Printer M129C
...
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        0
>       bAlternateSetting       0
>       bNumEndpoints           2
>       bInterfaceClass       255 Vendor Specific Class
>       bInterfaceSubClass    255 Vendor Specific Subclass
>       bInterfaceProtocol      2 

Those values mean this printer uses a vendor-specific communication
protocol, not the standard USB printer protocol.  As a result, usblp is
unwilling to drive it.

> ----------------------------------------------------------------------
> 
> I have been able to do usblp recognize it changing this more lines in
> usblp.c.
> 
> 
> /* Analyze and pick initial alternate settings and endpoints. */
> protocol = usblp_select_alts(usblp);
> if (protocol < 0) {
>         dbg("incompatible printer-class device 0x%4.4X/0x%4.4X",
>                 le16_to_cpu(dev->descriptor.idVendor),
>                 le16_to_cpu(dev->descriptor.idProduct));
>         goto abort;
> }
> 
> here i change "if (protocol < 0) {" for "if (protocol < -2000) {" 
> 
> ----------------------------------------------------------------------
> 
> /* Setup the selected alternate setting and endpoints. */
> if (usblp_set_protocol(usblp, protocol) < 0)
>        goto abort;
> 
> here i change "(usblp_set_protocol(usblp, protocol) < 0)" for
> "(usblp_set_protocol(usblp, protocol) < -2000)"
> 
> ----------------------------------------------------------------------

No, those are not the right changes to make.

I don't know if usblp will work with that printer at all.  To find out, 
you should remove these two lines near the top of usblp_select_alts():

		if (ifd->desc.bInterfaceClass != 7 || ifd->desc.bInterfaceSubClass != 1)
			continue;

> when i compile the module and install with insmod dmesg gives me this
> output.
> 
> drivers/usb/class/usblp.c: usblp0: USB Unidirectional printer dev 3 if 0
> alt -1 proto 0 vid 0x04B8 pid 0x0202
> usbcore: registered new driver usblp
> drivers/usb/class/usblp.c: v0.13: USB Printer Device Class driver
> 
> 
> and i have the "/dev/usb/lp0" device but when i try to print anything.
> 
> 
> "echo test > /dev/usb/lp0" it fails and gives me this errors in dmesg:
> 
> BUG: unable to handle kernel NULL pointer dereference at virtual address
> 00000000
...
> hehehe i would be better long away from kernel code i think :).

Probably. :-)

Try making the change above and see what happens.

Alan Stern


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.