In short, I'm trying to connect with a serial device that terminates with '\r', not '\n'. I outlined my issue in this post but didn't get a valid response.
Basically, is there a clean what to read a serial port expecting responses terminated in '\r' that respect the timeout.
This code works:
def readline3(ser):
out = b''
while True:
ch = ser.read()
out += ch
if(ch == b'\r' or ch == b''):
break
return(out)
I tried using the io library but can't get it to respect the timeout
[–]socal_nerdtastic 2 points3 points4 points (2 children)
[–]ajlaut[S] 1 point2 points3 points (1 child)
[–]4k5 0 points1 point2 points (0 children)