I have a RPI 3 receiving a string over UART every 4.5 seconds. on a serial terminal ( im using cutecom) the string prints perfectly and horizontal. However once i use a python code to read the UART port and print the string, it prints it vertically bit by bit. I used the same code on a UpSquared board but it worked perfectly
import mraa
# Initialise UART
port = '/dev/ttyS0'
u = mraa.Uart(port)
# Set UART parameters
u.setBaudRate(115200)
u.setMode(8, mraa.UART_PARITY_NONE, 0)
u.setFlowcontrol(False, False)
# Start a neverending loop waiting for data to arrive.
# Press Ctrl+C to get out of it.
while True:
if u.dataAvailable():
# We are doing 1-byte reads here
data_byte = (u.readStr(12))
print (data_byte)
i expected to receive:
11SITFYPRPL1 -23
11SITFYPRPL1 -23
11SITFYPRPL1 -23
But what i printed was:
1
1
S
I
T
F
Y
P
R
P
L
1