Posts: 57
Threads: 24
Joined: Feb 2017
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]
Posts: 3,458
Threads: 101
Joined: Sep 2016
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... :/
Posts: 12,028
Threads: 485
Joined: Sep 2016
You probably need to install a driver.
What OS are you using?
Posts: 57
Threads: 24
Joined: Feb 2017
(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
Posts: 1,298
Threads: 38
Joined: Sep 2016
You still need a driver. Also, the max232 chip requires 5 V input, does it not?
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Posts: 57
Threads: 24
Joined: Feb 2017
(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????
Posts: 1,298
Threads: 38
Joined: Sep 2016
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/
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Posts: 57
Threads: 24
Joined: Feb 2017
May-14-2017, 04:58 AM
(This post was last modified: May-14-2017, 04:58 AM by gray.)
(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
Posts: 12,028
Threads: 485
Joined: Sep 2016
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.
Posts: 1,298
Threads: 38
Joined: Sep 2016
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.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
|