-
Notifications
You must be signed in to change notification settings - Fork 60
commands send with send_command() might be ignored by the GPS #18
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
Comments
Disregard my previous answers. About the main issue you were having; gps.update needs to be called A BUNCH OF times before it actually returns anything. When I was testing your file, it ran over 4,700 times before it could actually return something. I'd try putting the gps.update in a while True loop and that will almost certainly fix that problem. Now, about the second issue you were having with the GPS sending the additional packages. Not sure why that's happening, but from what I've gathered from the documentation about the GPS itself, it's almost certainly not on Circuitpython's end. Has something to do with the default settings on the GPS module itself. This can be solved by putting a time.sleep() in-between each PMTK314 packets being sent. |
Something like this might work better for what you want
|
Addressed in #28. Closed |
send_command() uses multiple write() operations to send the sentence and the GPS might not recognize the sentence if there is a delay in between the write operations.
Each send_command should produce one PMTK001 message and an absent message indicates that the command was not recieved.
The code below may or may not output 4 PMTK001 messages after a soft reboot on an Feather M4 Express with an attached GPS breakout.
Also, the GPS keeps sending the additional messages if the third PMTK314 is not received.
Combining the writes into a single one helps.
`
import board, busio, adafruit_gps
uart = busio.UART(board.TX, board.RX, baudrate=9600, timeout=3)
gps = adafruit_gps.GPS(uart, debug=True)
gps.update()
gps.send_command(b'PMTK314,-1')
gps.update()
gps.send_command(b'PMTK314,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0')
gps.update()
gps.send_command(b'PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0')
gps.update()
gps.send_command(b'PMTK220,1000')
for i in range(20):
gps.update()
`
The text was updated successfully, but these errors were encountered: