Ultimate GPS, PMTK issues

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Guran
 
Posts: 1
Joined: Sun Jan 07, 2018 9:28 am

Ultimate GPS, PMTK issues

Post by Guran »

Hi,
I am currently working on an home brewed autopilot project in which the Ultimate GPS plays a vital role. However, after spending a lot of time testing the device I think the word “Ultimate” in its name is not appropriate. In my opinion the firmware is not high quality. This I will develop on later.

The GPS is communicating with a Rpi 2 utilising the excellent WirinPi library (version 2.44). See below.

pi@raspberrypi:~ $ gpio -v
gpio version: 2.44
Copyright (c) 2012-2017 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty

Raspberry Pi Details:
Type: Pi 2, Revision: 01, Memory: 1024MB, Maker: Sony
* Device tree is enabled.
*--> Raspberry Pi 2 Model B Rev 1.1
* This Raspberry Pi supports user-level GPIO access.

pi@raspberrypi:~ $ cat /proc/device-tree/model
Raspberry Pi 2 Model B Rev 1.1

pi@raspberrypi:~ $ cat /etc/debian_version
9.1

pi@raspberrypi:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

The GPS have an interface for setting and retrieving parameters. Each such interaction which I will onwards refer to as a transaction may consist of one, two or three messages, like:

- Request
- Response
- Acknowledgement

Furthermore some unsolicited messages are received during start-up.

My error handling for the communication is as fairly straightforward. If a communication error occurs during a transaction or an expected message is not received within consecutive 10 messages from the GPS, the transaction is redone.

My questions and comments
----------------------------------

1. It’s not possible to issue transactions a random order (within limits, of course!). For instance sometimes when you issue:
PMTK314,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28 in order to disallow all NMEA messages and then as a last transaction in the start-up sequence you fire off: PMTK314,0,1,0,5,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29 to resume the selected NMEA-messages you will in many cases get stuck before you reach the end.

This also applies to the baud rate setting transaction. There are places in the start-up sequence that will cause failure, stuck for ever.

2. On every start-up I receive communication errors on the request message of 605- and the 301-transactions. Why?

Write GPS: PMTK605*31 <<<< First

File descriptor: 15 Read error! Errno: 2 Text: No such file or directory Data: -1
Write GPS: PMTK605*31 <<<< Retry

Read GPS: PMTK705,AXN_2.31_3339_13101700,5632,PA6H,1.0*6B
Write GPS: PMTK001,705,3*32

Write GPS: PMTK301,2*2E <<<< First

File descriptor: 15 Read error! Errno: 2 Text: No such file or directory Data: -1
Write GPS: PMTK301,2*2E <<<< Retry

Read GPS: PMTK001,301,3*32
Write GPS: PMTK313,1*2E

3. The transaction for setting the speed threshold is not working properly.

Write GPS: PMTK397,0.4*39 <<< Setting the threshold to 0.4 m/s.
Read GPS: PMTK001,397,3*3D <<< Good ACK received!

Write GPS: PMTK447*35 <<< Querying the previously set value.
Read GPS: PMTK527,0.00*00 <<< 0.00 is received, expected 0.4!
Write GPS: PMTK001,527,3*30



Code: Select all

Complete logging of my start-up sequence

(Please note that parts of the lon and lat fields below are masked by me due to privacy reasons.)


Cold starting...
Write GPS: PMTK104*37
 
Read GPS: PGACK,103*40
Read GPS: PGACK,105*46
Read GPS: PMTK011,MTKGPS*08
Read GPS: PMTK010,001*2E
Write GPS: PMTK314,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28
 
Read GPS: PMTK001,314,3*36
Write GPS: PMTK000*32
 
Read GPS: PMTK001,0,3*30
Write GPS: PMTK414*33
 
Read GPS: PMTK514,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*2E
Write GPS: PMTK001,514,3*30
 
Write GPS: PMTK605*31
 
File descriptor: 15 Read error!  Errno: 2  Text: No such file or directory Data: -1
Write GPS: PMTK605*31
 
Read GPS: PMTK705,AXN_2.31_3339_13101700,5632,PA6H,1.0*6B
Write GPS: PMTK001,705,3*32
 
Write GPS: PMTK301,2*2E
 
File descriptor: 15 Read error!  Errno: 2  Text: No such file or directory Data: -1
Write GPS: PMTK301,2*2E
 
Read GPS: PMTK001,301,3*32
Write GPS: PMTK313,1*2E
 
Read GPS: PMTK001,313,3*31
Write GPS: PMTK251,57600*2C
 
Write GPS: PMTK220,100*2F
 
Read GPS: PMTK001,220,3*30
Write GPS: PMTK314,0,1,0,5,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29
 
Read GPS: PMTK001,314,3*36
Write GPS: PMTK330,0*2E
 
Read GPS: GPGGA,130558.000,5917.8452,N,YYYYY.8845,E,1,05,2.00,51.6,M,23.2,M,,*5C
Read GPS: GPGSA,A,3,05,28,30,09,13,,,,,,,,2.19,2.00,0.89*0C
Read GPS: GPRMC,130558.000,A,XXXX.8452,N,YYYYY.8845,E,0.30,29.95,070118,,,A*53
Read GPS: GPRMC,130558.100,A,XXXX.8450,N,YYYYY.8840,E,0.38,28.88,070118,,,A*50
Read GPS: PMTK001,330,3*30
Write GPS: PMTK430*35
 
Read GPS: GPRMC,130558.200,A,XXXX.8449,N,YYYYY.8837,E,0.40,27.07,070118,,,A*5C
Read GPS: GPRMC,130558.300,A,XXXX.8449,N,YYYYY.8834,E,0.32,19.62,070118,,,A*55
Read GPS: GPRMC,130558.400,A,XXXX.8448,N,YYYYY.8833,E,0.11,31.11,070118,,,A*5B
Read GPS: GPGGA,130558.500,XXXX.8448,N,YYYYY.8832,E,1,05,2.00,51.7,M,23.2,M,,*53
Read GPS: GPGSA,A,3,05,28,30,09,13,,,,,,,,2.19,2.00,0.89*0C
Read GPS: GPRMC,130558.500,A,XXXX.8448,N,YYYYY.8832,E,0.06,347.36,070118,,,A*6A
Read GPS: GPRMC,130558.600,A,XXXX.8449,N,YYYYY.8832,E,0.11,329.33,070118,,,A*63
Read GPS: PMTK530,0*28
Write GPS: PMTK001,530,3*36
 
Write GPS: PMTK286,1*23
 
Read GPS: GPRMC,130558.700,A,XXXX.8449,N,YYYYY.8832,E,0.11,315.57,070118,,,A*6F
Read GPS: GPRMC,130558.800,A,XXXX.8450,N,YYYYY.8832,E,0.05,346.50,070118,,,A*6C
Read GPS: GPRMC,130558.900,A,XXXX.8450,N,YYYYY.8832,E,0.05,109.57,070118,,,A*63
Read GPS: GPGGA,130559.000,XXXX.8450,N,YYYYY.8831,E,1,05,2.00,52.1,M,23.2,M,,*58
Read GPS: GPGSA,A,3,05,28,30,09,13,,,,,,,,2.19,2.00,0.89*0C
Read GPS: GPRMC,130559.000,A,XXXX.8450,N,YYYYY.8831,E,0.12,156.05,070118,,,A*63
Read GPS: GPRMC,130559.100,A,XXXX.8449,N,YYYYY.8831,E,0.13,165.60,070118,,,A*68
Read GPS: GPRMC,130559.200,A,XXXX.8450,N,YYYYY.8830,E,0.13,174.88,070118,,,A*64
Read GPS: GPRMC,130559.300,A,XXXX.8450,N,YYYYY.8830,E,0.12,180.28,070118,,,A*65
Read GPS: GPRMC,130559.400,A,XXXX.8450,N,YYYYY.8830,E,0.12,201.47,070118,,,A*61
Read GPS: GPGGA,130559.500,XXXX.8450,N,YYYYY.8830,E,1,05,2.00,52.5,M,23.2,M,,*58
Write GPS: PMTK286,1*23
 
Read GPS: GPGSA,A,3,05,28,30,09,13,,,,,,,,2.19,2.00,0.89*0C
Read GPS: GPRMC,130559.500,A,XXXX.8450,N,YYYYY.8830,E,0.05,229.88,070118,,,A*6F
Read GPS: GPRMC,130559.600,A,XXXX.8450,N,YYYYY.8830,E,0.06,249.14,070118,,,A*6C
Read GPS: GPRMC,130559.700,A,XXXX.8450,N,YYYYY.8829,E,0.09,247.95,070118,,,A*6D
Read GPS: GPRMC,130559.800,A,XXXX.8449,N,YYYYY.8829,E,0.09,255.19,070118,,,A*6D
Read GPS: GPRMC,130559.900,A,XXXX.8449,N,YYYYY.8829,E,0.08,277.18,070118,,,A*6C
Read GPS: GPGGA,130600.000,XXXX.8449,N,YYYYY.8829,E,1,05,2.00,52.9,M,23.2,M,,*5E
Read GPS: GPGSA,A,3,05,28,30,09,13,,,,,,,,2.19,2.00,0.89*0C
Read GPS: GPRMC,130600.000,A,XXXX.8449,N,YYYYY.8829,E,0.09,284.67,070118,,,A*6F
Read GPS: PMTK001,286,3*3C
Write GPS: PMTK397,0.4*39
 
Read GPS: GPRMC,130600.100,A,XXXX.8449,N,YYYYY.8829,E,0.08,286.26,070118,,,A*68
Read GPS: GPRMC,130600.200,A,XXXX.8448,N,YYYYY.8829,E,0.09,278.87,070118,,,A*61
Read GPS: GPRMC,130600.300,A,XXXX.8448,N,YYYYY.8829,E,0.09,278.17,070118,,,A*69
Read GPS: GPRMC,130600.400,A,XXXX.8448,N,YYYYY.8829,E,0.10,270.01,070118,,,A*69
Read GPS: GPGGA,130600.500,XXXX.8447,N,YYYYY.8829,E,1,05,2.00,53.3,M,23.2,M,,*5E
Read GPS: GPGSA,A,3,05,28,30,09,13,,,,,,,,2.19,2.00,0.89*0C
Read GPS: GPRMC,130600.500,A,XXXX.8447,N,YYYYY.8829,E,0.09,266.93,070118,,,A*63
Read GPS: PMTK001,397,3*3D
Write GPS: PMTK447*35
 
Read GPS: GPRMC,130600.600,A,XXXX.8447,N,YYYYY.8828,E,0.09,252.27,070118,,,A*69
Read GPS: GPRMC,130600.700,A,XXXX.8447,N,YYYYY.8828,E,0.10,252.65,070118,,,A*66
Read GPS: GPRMC,130600.800,A,XXXX.8446,N,YYYYY.8827,E,0.13,256.60,070118,,,A*65
Read GPS: GPRMC,130600.900,A,XXXX.8446,N,YYYYY.8827,E,0.15,253.13,070118,,,A*63
Read GPS: GPGGA,130601.000,XXXX.8445,N,YYYYY.8827,E,1,05,2.00,53.7,M,23.2,M,,*52
Read GPS: GPGSA,A,3,05,28,30,09,13,,,,,,,,2.19,2.00,0.89*0C
Read GPS: GPRMC,130601.000,A,XXXX.8445,N,YYYYY.8827,E,0.14,251.86,070118,,,A*67
Read GPS: GPRMC,130601.100,A,XXXX.8445,N,YYYYY.8827,E,0.13,251.13,070118,,,A*6D
Read GPS: PMTK527,0.00*00
Write GPS: PMTK001,527,3*30
 
Write GPS: PMTK607*33
 
Read GPS: GPRMC,130601.200,A,XXXX.8445,N,YYYYY.8827,E,0.11,250.06,070118,,,A*69
Read GPS: GPRMC,130601.300,A,XXXX.8445,N,YYYYY.8827,E,0.07,245.49,070118,,,A*60
Read GPS: GPRMC,130601.400,A,XXXX.8444,N,YYYYY.8827,E,0.04,214.05,070118,,,A*69
Read GPS: GPGGA,130601.500,XXXX.8444,N,YYYYY.8827,E,1,05,2.00,53.9,M,23.2,M,,*58
Read GPS: GPGSA,A,3,05,28,30,09,13,,,,,,,,2.19,2.00,0.89*0C
Read GPS: GPRMC,130601.500,A,XXXX.8444,N,YYYYY.8827,E,0.03,171.04,070118,,,A*6E
Read GPS: GPRMC,130601.600,A,XXXX.8444,N,YYYYY.8827,E,0.03,142.90,070118,,,A*60
Read GPS: GPRMC,130601.700,A,XXXX.8443,N,YYYYY.8827,E,0.03,145.96,070118,,,A*67
Read GPS: GPRMC,130601.800,A,XXXX.8443,N,YYYYY.8826,E,0.05,140.15,070118,,,A*61
Read GPS: GPRMC,130601.900,A,XXXX.8443,N,YYYYY.8826,E,0.04,123.52,070118,,,A*67
Read GPS: GPGGA,130602.000,XXXX.8442,N,YYYYY.8826,E,1,05,2.00,54.0,M,23.2,M,,*57
Write GPS: PMTK607*33
 
Read GPS: GPGSA,A,3,05,28,30,09,13,,,,,,,,2.19,2.00,0.89*0C
Read GPS: GPRMC,130602.000,A,XXXX.8442,N,YYYYY.8826,E,0.05,97.94,070118,,,A*59
Read GPS: GPRMC,130602.100,A,XXXX.8442,N,YYYYY.8826,E,0.06,97.81,070118,,,A*5F
Read GPS: GPRMC,130602.200,A,XXXX.8442,N,YYYYY.8826,E,0.06,97.45,070118,,,A*54
Read GPS: GPRMC,130602.300,A,XXXX.8441,N,YYYYY.8826,E,0.04,102.53,070118,,,A*6E
Read GPS: GPRMC,130602.400,A,XXXX.8441,N,YYYYY.8826,E,0.04,125.82,070118,,,A*60
Read GPS: GPGGA,130602.500,XXXX.8441,N,YYYYY.8825,E,1,05,2.00,54.2,M,23.2,M,,*50
Read GPS: GPGSA,A,3,05,28,30,09,13,,,,,,,,2.19,2.00,0.89*0C
Read GPS: GPRMC,130602.500,A,XXXX.8441,N,YYYYY.8825,E,0.02,150.31,070118,,,A*6E
Read GPS: PMTK707,0,0,0,0,0,0,0,0,0*2E
Write GPS: PMTK001,707,3*30
 
NMEA_msgs_thread: Exit
Waiting for GPS fix...
Read GPS: GPRMC,130602.600,A,XXXX.8441,N,YYYYY.8825,E,0.03,194.70,070118,,,A*61
Read GPS: GPRMC,130602.700,A,XXXX.8440,N,YYYYY.8825,E,0.04,206.28,070118,,,A*63
Read GPS: GPRMC,130602.800,A,XXXX.8440,N,YYYYY.8825,E,0.08,203.17,070118,,,A*69
Read GPS: GPRMC,130602.900,A,XXXX.8439,N,YYYYY.8824,E,0.12,205.73,070118,,,A*68
Read GPS: GPGGA,130603.000,XXXX.8439,N,YYYYY.8824,E,1,05,2.00,54.4,M,23.2,M,,*5C
Read GPS: GPGSA,A,3,05,28,30,09,13,,,,,,,,2.19,2.00,0.89*0C
Read GPS: GPRMC,130603.000,A,XXXX.8439,N,YYYYY.8824,E,0.14,217.53,070118,,,A*67
Read GPS: GPRMC,130603.100,A,XXXX.8439,N,YYYYY.8824,E,0.15,217.81,070118,,,A*68
Read GPS: GPRMC,130603.200,A,XXXX.8438,N,YYYYY.8824,E,0.15,215.28,070118,,,A*6B
Read GPS: GPRMC,130603.300,A,XXXX.8438,N,YYYYY.8824,E,0.16,210.56,070118,,,A*65
Read GPS: GPRMC,130603.400,A,XXXX.8438,N,YYYYY.8823,E,0.19,209.50,070118,,,A*64
Read GPS: GPGGA,130603.500,XXXX.8437,N,YYYYY.8823,E,1,05,2.00,54.6,M,23.2,M,,*52
Read GPS: GPGSA,A,3,05,28,30,09,13,,,,,,,,2.19,2.00,0.89*0C
Read GPS: GPRMC,130603.500,A,XXXX.8437,N,YYYYY.8823,E,0.19,207.73,070118,,,A*65
Read GPS: GPRMC,130603.600,A,XXXX.8437,N,YYYYY.8823,E,0.19,204.97,070118,,,A*6F
Read GPS: GPRMC,130603.700,A,XXXX.8437,N,YYYYY.8823,E,0.18,195.00,070118,,,A*6A
Read GPS: GPRMC,130603.800,A,XXXX.8437,N,YYYYY.8823,E,0.18,193.78,070118,,,A*6C
Read GPS: GPRMC,130603.900,A,XXXX.8436,N,YYYYY.8822,E,0.21,196.80,070118,,,A*65
Read GPS: GPGGA,130604.000,XXXX.8436,N,YYYYY.8822,E,1,05,2.00,54.8,M,23.2,M,,*5E
Read GPS: GPGSA,A,3,05,28,30,09,13,,,,,,,,2.19,2.00,0.89*0C
Read GPS: GPRMC,130604.000,A,XXXX.8436,N,YYYYY.8822,E,0.24,201.16,070118,,,A*6C
Read GPS: GPRMC,130604.100,A,XXXX.8435,N,YYYYY.8822,E,0.24,201.74,070118,,,A*6A
Read GPS: GPRMC,130604.200,A,XXXX.8435,N,YYYYY.8821,E,0.24,205.25,070118,,,A*6A
Read GPS: GPRMC,130604.300,A,XXXX.8435,N,YYYYY.8821,E,0.25,211.46,070118,,,A*6A
Read GPS: GPRMC,130604.400,A,XXXX.8435,N,YYYYY.8821,E,0.26,218.78,070118,,,A*6A
Read GPS: GPGGA,130604.500,XXXX.8434,N,YYYYY.8820,E,1,05,2.00,54.9,M,23.2,M,,*5A
Read GPS: GPGSA,A,3,05,28,30,09,13,,,,,,,,2.19,2.00,0.89*0C
Read GPS: GPRMC,130604.500,A,XXXX.8434,N,YYYYY.8820,E,0.28,221.39,070118,,,A*6A
Read GPS: GPRMC,130604.600,A,XXXX.8434,N,YYYYY.8820,E,0.29,221.14,070118,,,A*67
Read GPS: GPRMC,130604.700,A,XXXX.8434,N,YYYYY.8820,E,0.29,221.35,070118,,,A*65
Read GPS: GPRMC,130604.800,A,XXXX.8434,N,YYYYY.8820,E,0.27,220.72,070118,,,A*66
Read GPS: GPRMC,130604.900,A,XXXX.8433,N,YYYYY.8820,E,0.26,210.80,070118,,,A*6F
Read GPS: GPGGA,130605.000,XXXX.8433,N,YYYYY.8820,E,1,05,2.00,55.1,M,23.2,M,,*50
Read GPS: GPGSA,A,3,05,28,30,09,13,,,,,,,,2.19,2.00,0.89*0C
Read GPS: GPRMC,130605.000,A,XXXX.8433,N,YYYYY.8820,E,0.25,204.18,070118,,,A*60
Read GPS: GPRMC,130605.100,A,XXXX.8433,N,YYYYY.8820,E,0.24,203.05,070118,,,A*6B
GPS fix received!
Read GPS: GPRMC,130605.200,A,XXXX.8433,N,YYYYY.8820,E,0.24,197.97,070118,,,A*6D
Read GPS: GPRMC,130605.300,A,XXXX.8433,N,YYYYY.8820,E,0.24,193.31,070118,,,A*64
Read GPS: GPRMC,130605.400,A,XXXX.8432,N,YYYYY.8820,E,0.25,189.94,070118,,,A*67
Read GPS: GPGGA,130605.500,XXXX.8432,N,YYYYY.8820,E,1,05,2.00,55.3,M,23.2,M,,*56
Read GPS: GPGSA,A,3,05,28,30,09,13,,,,,,,,2.19,2.00,0.89*0C
Read GPS: GPRMC,130605.500,A,XXXX.8432,N,YYYYY.8820,E,0.27,186.79,070118,,,A*68
Read GPS: GPRMC,130605.600,A,XXXX.8431,N,YYYYY.8820,E,0.29,186.34,070118,,,A*6F
Read GPS: GPRMC,130605.700,A,XXXX.8431,N,YYYYY.8820,E,0.30,186.26,070118,,,A*65
Read GPS: GPRMC,130605.800,A,XXXX.8431,N,YYYYY.8820,E,0.29,186.75,070118,,,A*64
Read GPS: GPRMC,130605.900,A,XXXX.8431,N,YYYYY.8820,E,0.27,190.80,070118,,,A*66
Read GPS: GPGGA,130606.000,XXXX.8431,N,YYYYY.8820,E,1,05,2.00,55.5,M,23.2,M,,*55

User avatar
simonboydfoley
 
Posts: 3
Joined: Sun Aug 12, 2018 5:51 pm

Re: Ultimate GPS, PMTK issues

Post by simonboydfoley »

I agree with you that this Ultimate GPS product is complete Junk.
I cant get any useful data from the Unit, the provided libraries seem to fail to set the unit correctly which I suspect the the baud rate failing;
$PMTK001,220,3*30

I then get a 705 Packet Type message which isnt even documented in the PDF's

I'll try to set to 4800

User avatar
simonboydfoley
 
Posts: 3
Joined: Sun Aug 12, 2018 5:51 pm

Re: Ultimate GPS, PMTK issues

Post by simonboydfoley »

I managed to get the unit responding by setting the baudrate to 4800, then 115200 and then back to 9600 and it sprang into life;

GPS.begin(9600);

I also had to change the example code which does not work on a MEGA
From:
HardwareSerial mySerial = Serial1;
Adafruit_GPS GPS(&mySerial);

To:
Adafruit_GPS GPS(&Serial1);

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”