Skip to content

commands send with send_command() might be ignored by the GPS #18

Closed
@MSube

Description

@MSube

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()
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions