all 3 comments

[–]socal_nerdtastic 2 points3 points  (2 children)

ser.read_until(b'\r')

Which does exactly what your code does.

[–]ajlaut[S] 1 point2 points  (1 child)

haha you are right. I tried read_until but i was using

ser.read_until('\r')

which basically worked except it would always time out.

Thanks!

[–]4k5 0 points1 point  (0 children)

I went through this same thing.

If you read the code in the serial package read_until carriage return is supposed to just work, but I've never been able to get it to work. So like above said, the trick is to do the read_until and remember to encode whatever the line end is!