I'm trying to read data from a serial port:
Code:
ser = serial.Serial(
port='/dev/ttyUSB0',
baudrate = 4800,
parity = serial.PARITY_NONE,
stopbits = serial.STOPBITS_ONE,
bytesize = serial.EIGHTBITS,
timeout=1)
and
Code:
Str = ser.read(8)
print (Str)
I expected to see xxxx.xxb'\r'
but what I seem to be getting is b'xxxx.xx\r'
It seems to be splitting the EOL marker some how. I'm asssuming that b'\r' is old fashioned carriage return and has the same effect as b'\n' [new line] I'm completely baffled. Any suggestions?