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

Gary E. Miller gem at rellim.com
Sun Jun 4 20:18:54 UTC 2023


Yo Hal!

On Sat, 03 Jun 2023 21:53:34 -0700
Hal Murray via devel <devel at ntpsec.org> wrote:

> 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.

Good.

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

Cool.

> 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.

Weird...  Since ttyACM0 is USB, maybe a driver thing.

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
	gem at rellim.com  Tel:+1 541 382 8588

	    Veritas liberabit vos. -- Quid est veritas?
    "If you can't measure it, you can't improve it." - Lord Kelvin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 246 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20230604/6b8af353/attachment.bin>


More information about the devel mailing list