Skip to content

AttributeError: 'bytes' object has no attribute 'decode' #74

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Skyfarer opened this issue Nov 13, 2021 · 5 comments
Closed

AttributeError: 'bytes' object has no attribute 'decode' #74

Skyfarer opened this issue Nov 13, 2021 · 5 comments

Comments

@Skyfarer
Copy link

I'm using CircuitPython version 7.0.0 on the Feather M0 Lora board. Also using a Beitian BN-220 GPS.
Getting this error when trying to parse GPS:
main.py output:
('GPGSV', '3,3,11,21,28,129,21,27,31,045,15,30,40,311,33')
Traceback (most recent call last):
File "main.py", line 53, in
File "adafruit_gps.py", line 282, in update
File "adafruit_gps.py", line 588, in _parse_gsv
AttributeError: 'bytes' object has no attribute 'decode'

I'd be grateful for some help,
Thanks!
Jeremy

@jepler
Copy link
Contributor

jepler commented Nov 13, 2021

It appears that this incompatibility with low-spec boards was probably introduced together with addition of GSV GSA sentence parsing:

@lesamouraipourpre not all circuitpython microcontrollers have bytes.decode. A possible alternative, assuming the message is ASCII, is "".join(chr(c) for c in talker)

@jepler
Copy link
Contributor

jepler commented Nov 13, 2021

str(talker, 'ascii') is more natural than the first alternative I suggested, and is already used.

@tekktrik
Copy link
Member

tekktrik commented Jun 3, 2022

@caternuson sounds like this is fixed?

@caternuson
Copy link
Contributor

@tekktrik Yep, should be.

@jeremyfsu Please try updating to the 3.9.8 release of the library:
https://github.com/adafruit/Adafruit_CircuitPython_GPS/releases/tag/3.9.8
which should be available in the library bundle:
https://circuitpython.org/libraries

@tekktrik
Copy link
Member

Closing since it seems like the issue was resolved!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants