iljabauer / python-escpos

Automatically exported from code.google.com/p/python-escpos
GNU General Public License v3.0
0 stars 0 forks source link

Can't print #30

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello,

I just found your python library today but I have not had success getting it to 
work.  Any help would be appreciated!

Thanks,
Jack

I am getting this message for test.py:

dell@Dell:~/python-escpos-a1ff2d1740ad/escpos$ python test.py
Traceback (most recent call last):
  File "test.py", line 3, in <module>
    Epson = printer.Usb(0x04b8,0x0202)
NameError: name 'printer' is not defined

The printer is an Epson TM-T88II connected with USB.

lsusb
Bus 003 Device 002: ID 04b8:0202 Seiko Epson Corp. Receipt Printer M129C

lsusb -vvv -d 04b8:0202 | grep iInterface
      iInterface              0
lsusb -vvv -d 04b8:0202 | grep bEndpointAddress | grep OUT
        bEndpointAddress     0x01  EP 1 OUT

lsusb -vvv -d 04b8:0202
...
idVendor           0x04b8 Seiko Epson Corp.
idProduct          0x0202 Receipt Printer M129C

OS Ubuntu 12.04.3 LTS
Linux Dell 3.8.0-39-generic #58~precise1-Ubuntu SMP Fri May 2 21:33:17 UTC 2014 
i686 i686 i386 GNU/Linux

python-serial 2.5-2.1build1
pyusb-1.0.0b1
python-qrcode
python-escpos-a1ff2d1740ad

test.py

from escpos import *

Epson = printer.Usb(0x04b8,0x0202)
# Print text
Epson.text("Hello World\n")
# Print image
Epson.image("logo.gif")
# Print QR Code
Epson.qr("You can readme from your smartphone")
# Print barcode
Epson.barcode('1324354657687','EAN13',64,2,'','')
# Cut paper
Epson.cut()

Original issue reported on code.google.com by jackcjen...@gmail.com on 22 May 2014 at 10:16

GoogleCodeExporter commented 9 years ago
Hello Jack,

Did you follow the instructions here?
https://code.google.com/p/python-escpos/wiki/Installation

Original comment by manpaz on 22 May 2014 at 11:20

GoogleCodeExporter commented 9 years ago
Hello,

Yes but I am new to Python maybe I made a mistake somewhere.

Thanks,
Jack

Original comment by jackcjen...@gmail.com on 22 May 2014 at 11:26

GoogleCodeExporter commented 9 years ago
Hello,

Thank you for your reply.

I ran this again:

cd python-escpos
python setup.py build
sudo python setup.py install

Then ran:
dell@Dell:~/python-escpos-a1ff2d1740ad$ python test.py

and it worked!

I'm not sure why that made any difference.

Thanks,
Jack

Original comment by jackcjen...@gmail.com on 22 May 2014 at 11:52

GoogleCodeExporter commented 9 years ago
Probably "sudo" didn't work at the first time :)
Anyways, I'm glad it is working for you now.

Thank you for your interest in the project!

Original comment by manpaz on 23 May 2014 at 12:08