eymlo / python-escpos

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

trouble printing variables..... i'n NOOB #21

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi

i have troubles printing variables with the library.... i used the example code 
to confirm that printer works... now i have this line of code but i get an 
error:

Epson.text(text) 

my variable is called text...

i have tried to add single and double quotes.. ' ' and " "

the error is:

    raise TextError()
TextError: Text string must be supplied to the text() method

what have the "NOOB" done wrong?

Original issue reported on code.google.com by bo.herrm...@gmail.com on 20 Feb 2014 at 8:18

GoogleCodeExporter commented 9 years ago
Hi bo.herrmannsen,

If all you want is to pass the variable text, then you can try with:

Epson.text("%s" % text)

Thank you.

Original comment by manpaz on 24 Feb 2014 at 7:16

GoogleCodeExporter commented 9 years ago
Hi Manuel,

I try to connect the RPI with an Epson TM T20 with serial port (through USB 
adapter) with the escpos library.

I followed the steps  from Wessix in  
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=46&t=19883 

but can only print question marks from  the code: 
""" Seiko Epson Corp. Receipt Printer M129 Definitions (EPSON TM-T88II) over US$
#Epson = printer.Serial( 0x067b,0x2303,0,0x81,0x02)
Epson = printer.Serial("/dev/ttyUSB0",9600,8,2)  #thats the dev the adapter 
gets regognized
Epson.text("Hello World")

The printer wont print the  "Hello World text" or  cut the paper.

Could you please help how I could  connect  the RPI to the Epson Tm T20 please?
I have the same USb parameters  printer.Usb( 0x067b,0x2303,0,0x81,0x02).

Many thanks!

Jeremie Ho

Original comment by HOHIOH...@HOTMAIL.COM on 14 Mar 2014 at 6:17

GoogleCodeExporter commented 9 years ago
Hi Jeremie,

Do you mind to confirn /dev/ttyUSB0 is being created when you attach your USB 
to serial adapter?
Also, please, I'll appreciate if you can post the output of lsusb.

Please, feel free to open a separate ticket to track your problem individually.

Thank you

Original comment by manpaz on 15 Mar 2014 at 2:42