Python Forum

Full Version: the rs232 printer is not working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2

i have a rs232 thermal printer(avasys)...i put a max232cpe on the path of rs232 cable from printer...i gave 3.3 volt to power supply pin of max232cpe..and then to rx , tx , gnd raspberry...i used python and pyserial...but the printer don't do any reaction...why????


[[/size][/font][/size][/color]
[code]import serial
import time


port = serial.Serial("/dev/ttyAMA0",baudrate=9600, timeout=1,
 parity=serial.PARITY_NONE,
 stopbits=serial.STOPBITS_ONE,
 bytesize=serial.EIGHTBITS)

port.write('abcdefgh')[/code]
[color=#242729][size=small][font=Arial,][size=small]][python]
I don't know anything about that kind of printer, but it probably expects a "document" in a specific format. Sending it random characters will probably just get ignored by the printer.

As I said, I don't know anything about that printer, but when I worked with thermal Zebra printers, I had to do a lot of work with zpl, their wacky little formatting language: https://en.wikipedia.org/wiki/Zebra_(pro..._language)
That probably won't help you too much, though... :/
You probably need to install a driver.
What OS are you using?
(May-11-2017, 09:41 PM)Larz60+ Wrote: [ -> ]You probably need to install a driver.
What OS are you using?

raspbian...
i think the driver is not needed when i use serial port...the driver is needed for usb port
You still need a driver. Also, the max232 chip requires 5 V input, does it not?
(May-12-2017, 01:14 PM)sparkz_alot Wrote: [ -> ]You still need a driver. Also, the max232 chip requires 5 V input, does it not?
how can i add this driver in python????
The driver is part of the OS, and may already be apart of it If not, you will have to find the correct driver and install it.  It's not a part of Python.  You might try the manufacturers web site (or contact them)  and see if they have a Linux driver.  

Found this article should all else fail (and you want to give it a try): http://scruss.com/blog/2015/07/12/therma...-pi-zj-58/
(May-13-2017, 01:05 PM)sparkz_alot Wrote: [ -> ]The driver is part of the OS, and may already be apart of it If not, you will have to find the correct driver and install it.  It's not a part of Python.  You might try the manufacturers web site (or contact them)  and see if they have a Linux driver.  

Found this article should all else fail (and you want to give it a try): http://scruss.com/blog/2015/07/12/therma...-pi-zj-58/

how can i understand that the driver is part of the OS????
i have seen this link and done it...but it doesn't work
Are to sure your cable is wired correctly?
RS232 is an old protocol, and there several sets of wires that sometimes have to
be reversed. see: https://www.lammertbies.nl/comm/info/RS-...modem.html

The reason for this is simple, at any given point, one computer or device will be sending data,
and the other receiving, so obviously in this scenario, the RX wire of one needs to be connected to the TX wire of the other.
these are pins 2 and 3 on both a db-9 or 25 pin (see: http://www.aggsoft.com/rs232-pinout-cable/RS232.htm) connector.
Try following this tutorial (yours would be a 'serial/TTL' printer) https://learn.adafruit.com/networked-the...i/overview

Other than that, you would be better served by the Raspian community.
Pages: 1 2