I'm surprised that the previous code worked, I should have broken something.
It seems to be a bit model dependent though, but the devices seem
relatively consistent in sending b'\rmessage\r', so always read until '\r',
check if that is empty, in which case reading until the next '\r' should give
the message.
I'm surprised that the previous code worked, I should have broken something. It seems to be a bit model dependent though, but the devices seem relatively consistent in sending b'\rmessage\r', so always read until '\r', check if that is empty, in which case reading until the next '\r' should give the message.