Skip to content

bytearray error with featherwing_gps #30

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
jerryneedell opened this issue Feb 23, 2019 · 6 comments
Closed

bytearray error with featherwing_gps #30

jerryneedell opened this issue Feb 23, 2019 · 6 comments

Comments

@jerryneedell
Copy link
Contributor

I am trying the featherwing_gps_simpletest but am getting this error.

Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 4.0.0-beta.2-97-g0dc260058 on 2019-02-19; Adafruit Grand Central M4 Express with samd51p20
>>> 
>>> 
>>> import featherwing_gps_simpletest
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "featherwing_gps_simpletest.py", line 10, in <module>
  File "adafruit_featherwing/gps_featherwing.py", line 61, in __init__
  File "adafruit_gps.py", line 122, in send_command
ValueError: string not supported; use bytes or bytearray
@jerryneedell jerryneedell changed the title bytarray error with featherwing_gps bytearray error with featherwing_gps Feb 23, 2019
@jerryneedell
Copy link
Contributor Author

I can fix it with this change.

ithub/Adafruit_CircuitPython_FeatherWing//adafruit_featherwing/
60,61c60,61
<         self._gps.send_command(bytes('PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0','utf-8'))
<         self._gps.send_command(bytes('PMTK220,{}'.format(update_period),'utf-8'))
---
>         self._gps.send_command(b'PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0')
>         self._gps.send_command(b'PMTK220,{}'.format(update_period))

but I am surprised this did not come up in testing?

@makermelissa
Copy link
Collaborator

I saw this in my testing and must have pushed the file without the fix. I’ll take a look as soon as I get home. I have a fix for it that I know works.

@makermelissa
Copy link
Collaborator

Actually, just reread (darn small phone screens). Go ahead and push your fix if it’s working.

@jerryneedell
Copy link
Contributor Author

Ialso was going to suggest a small chage to Doc string https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing/blob/master/adafruit_featherwing/gps_featherwing.py#L42
it refers to I2C -- should be UART, correct?

@makermelissa
Copy link
Collaborator

Correct. Thanks for catching that.

@makermelissa
Copy link
Collaborator

Fixed #30 via #31.

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

No branches or pull requests

2 participants