Hi all,
Trying to push data via USB serial onto python application. Fails intermittently seemingly only ever due to the \r\n combination found within the received bytes (shown below).
Any ideas whats going on here?
Code snippet from application:
len_ = ser.read_until(size = 2)
# Unpack as uint16 with big endianness
bytes_to_read = struct.unpack('>H',len_)[0]
print("PB bytes incoming: {}".format(bytes_to_read))
message = bytearray(ser.read(size=bytes_to_read))
print(message)
print(message.hex(' '))
print(len(message))
try:
telemetry.ParseFromString(message)
except:
print("Bad decode!")
Cheers,
Matt.