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?

[image: Screenshot from 2021-10-07 21-01-16.png][image: Screenshot from 
2021-10-07 21-03-33.png]
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.                   

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/1e338f58-0d79-4cb3-98df-93fa8db1e6can%40googlegroups.com.

Reply via email to