Wipy + Development Board 3.0 TTL to RS232 UART Printer Problem
I am trying to speak to a thermal RS232 printer from the WiPY by using a TTL to RS232 board (MAX3232 chip powered). I've tried a couple of boards a Grove and a DollaTek.
I am taking my four jumper cables: TX from Pin3, RX Pin 4 and GND and 3v3 (i also have tried flipping the RX/TX as some of these breakout boards are labelled with the cable it is looking for rather than what it is)
I'm then on a basic level doing something like:
from machine import UART uart = UART(1) uart.init(baudrate=115200, bits=8, stop=1, parity=UART.EVEN, pins=('P3', 'P4')) uart.write(bytes([25,25])) # This is a command I know the printer receives and does a reset
but nothing happens. I know the voltages from the WiPY are correct (checked with a multimeter). When I instantiate the UART object a light on the TTL - RS232 breakout goes out making me think something is right. I can run a jumper from P3 to P4 and write and receive the bytes on the WiPY but it does nothing RS232 wise.
Now for comparison I have a raspberry pi and purchased a Max3232 Hat from the PiHut
With just this CPython code:
import serial ser = serial.Serial( port='/dev/serial0',\ baudrate=115200,\ parity=serial.PARITY_EVEN,\ stopbits=serial.STOPBITS_ONE,\ bytesize=serial.EIGHTBITS,\ timeout=0) ser.write(bytes([25,25]))
It sends the message to the printer successfully. The only other difference is that the Pi Hat has a male DB9 whereas the two I've tried with the WiPY are female (meaning I have a different RS232 cable to the printer). Both RS232 cables are brand new. But essentially the HAT is identical in theory except that it isn't using Micropython.
My question is: should this just work? Or am I missing something about UART, the PyCom or something else. Am I doing something wrong?
Hope someone can help
This post is deleted!
robert-hh last edited by robert-hh
@handloomweaver It looks OK. What happens if you bridge RX/TX at the RS232 side. Then at least you can check that the data is passing through the Level converter. Then, the modem control lines could be the problem.
This post is deleted!