Python Forum
the rs232 printer is not working
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
the rs232 printer is not working
#1

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]
Reply
#2
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... :/
Reply
#3
You probably need to install a driver.
What OS are you using?
Reply
#4
(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
Reply
#5
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
Reply
#6
(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????
Reply
#7
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
Reply
#8
(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
Reply
#9
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.
Reply
#10
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Problem with the printer function scratchmyhead 4 3,324 Oct-15-2020, 12:14 PM
Last Post: YvonneAlsop
  [Tkinter] How to print data to the printer scratchmyhead 11 7,899 Aug-20-2020, 08:12 PM
Last Post: StevenLee
  setup epson lq350 dot matrix printer by python-printer-escpos gray 10 9,001 Jun-05-2017, 01:20 PM
Last Post: sparkz_alot

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020