Closed GoogleCodeExporter closed 9 years ago
Hi subairi.mxt
Do you mind to try the following code please?
from escpos import *
gp80 = printer.Usb(0x0FE6,0x811E)
gp80.text("Hello World\n")
gp80.cut()
Original comment by manpaz
on 8 Mar 2014 at 7:16
i get error list:
Traceback (most recent call last):
File "<pyshell#12>", line 1, in <module>
gp80.text("Hello world\n")
File "/usr/local/lib/python2.7/dist-packages/escpos/escpos.py", line 177, in text
self._raw(txt)
File "/usr/local/lib/python2.7/dist-packages/escpos/printer.py", line 58, in _raw
self.device.write(self.out_ep, msg, self.interface)
File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 625, in write
fn = fn_map[self._ctx.get_endpoint_type(self, endpoint, intf)]
File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 180, in get_endpoint_type
etype = util.endpoint_type(e.bmAttributes)
AttributeError: 'NoneType' object has no attribute 'bmAttributes'
Original comment by subairi....@gmail.com
on 8 Mar 2014 at 10:39
Seems like you have no access to the printer.
Do you mind to confirm you have done all the requirements described on "System
Preparation" section?
http://code.google.com/p/python-escpos/wiki/Installation
Original comment by manpaz
on 8 Mar 2014 at 7:41
my printer connect to usb like this:
root@sby:/home/pi# lsusb -D /dev/bus/usb/001/007
Device: ID 0fe6:811e Kontron (Industrial Computer Source / ICS Advent) Parallel
Adapter
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x0fe6 Kontron (Industrial Computer Source / ICS Advent)
idProduct 0x811e Parallel Adapter
bcdDevice 1.00
iManufacturer 0
iProduct 2
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 32
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 7 Printer
bInterfaceSubClass 1 Printer
bInterfaceProtocol 2 Bidirectional
iInterface 98 Memory
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 8
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 8
Device Status: 0x0001
Self Powered
root@sby:/home/pi# lsusb -vvv -d 0FE6:811E | grep bEndpointAddress | grep OUT
bEndpointAddress 0x02 EP 2 OUT
root@sby:/home/pi# lsusb -vvv -d 0FE6:811E | grep iInterface
iInterface 98 Memory
;================================
the iInterface is 98? it's normal? how do initialize this printer?
Original comment by subairi....@gmail.com
on 10 Mar 2014 at 1:35
my problem solved mr. Manpaz tank you !
Original comment by subairi....@gmail.com
on 10 Mar 2014 at 4:19
Good to hear that!
Original comment by manpaz
on 10 Mar 2014 at 5:20
hello,
Could you please tell me how you resolved your problem? I am having the same
type of error.
Regards,
D
Original comment by yod...@gmail.com
on 10 Apr 2014 at 12:13
i use this code for initialized my printer:
gp80=printer.Usb(0x0EF6,0x811E,0,0x82,0x02)
gp80.text("test print 12345/r/n")
2014-04-10 19:13 GMT+07:00 <python-escpos@googlecode.com>:
Original comment by subairi....@gmail.com
on 21 Apr 2014 at 7:17
yod...@gmail.com tyr this code:
from escpos import *
gp80 = printer.Usb(0x0FE6,0x811E,0,0x82,0x02)
gp80.text("Hello World\n")
gp80.cut()
Original comment by subairi....@gmail.com
on 21 Apr 2014 at 7:24
Original issue reported on code.google.com by
subairi....@gmail.com
on 8 Mar 2014 at 2:40