UnicodeDecodeError from tty.readline(), u-Blox 8

Hal Murray halmurray at sonic.net
Sun Jun 4 04:53:34 UTC 2023


Gary said:
> To open to read binary:
>     tty = open("/dev/ttyACM0", "rb")
> The line will be binary.  Getting just the NMEA out will be fun. 

Thanks.  That's what I needed.

There is no problem getting just the NMEA.  I'm using isASCII to detect the 
garbage cases.

I get things like:
### Not ASCII 2023 Jun 3, 22:46:41 UTC
### "$GLG\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\x
cd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\
xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd
\xcd\xcd\xcd$GLGSV,3,3,11,87,43,333,,88,01,306,,90,13,029,*5A"

I get several bogus lines each day.  I haven't seen anything other then 0xcd 
in the non-ASCII part.


-- 
These are my opinions.  I hate spam.





More information about the devel mailing list