[−][src]Module adafruit_gps::PMTK
PMTK commands give the gps module settings for output.
To give a PMTK command send it via the Gps struct: gps.pmtk....(args). See simple.rs for example.
Note: All commands will be destructive for all sentences in the buffer. You will not be able to read data given by the gps after sending it a command.
Important commands
pmtk_220_set_nmea_updaterate -> Hz for the gps update rate.
//! pmtk_314_api_set_nmea_output -> Sets 6 modes, GLL is not included in any other docs.
Changing the baudrate
Given it's a special function, it's a stand alone methon in the send_pmtk module.
The port baud rate needs to be changed and the gps baudrate needs to be changed. To do so, a specific set of commands need to be given (changing to 57600, for example):
- stty -F /dev/serial0 raw 9600 cs8 clocal -cstopb
- echo -e "$PMTK251,57600*2C\r\n" > /dev/serial0
- stty -F /dev/serial0 57600 clocal cread cs8 -cstopb -parenb
Then open the port at the new baudrate and you're good.
To remove sources of error, changing the baud rate here will do a full restart, so all saved options will be removed.
PMTK return formats
PMTK001
The PMTK001 command is the response given when there is a valid command given.
Commands are Invalid, Unsupported, Failed, Successful, or No packet received.
PMTK500
5** pmtk standards are all reply formats. Each is individual and unique.
Reboot commands
Upon any kind of restart the following is printed: $CDACK,7,049\r\n -> Unknown what this is. This is what is given upon wake up. $PMTK011,MTKGPS08\r\n -> Output sys message. $PMTK010,0012E\r\n -> Sys message, 001 Startup. $PMTK011,MTKGPS08\r\n -> 001 txt message, output system message. $PMTK010,002*2D\r\n -> Sys msg, 002 = Notification, aiding EPO.
Modules
send_pmtk |