
- •Contents at a Glance
- •Contents
- •Hardware Hacks
- •GPS Secrets
- •Hidden Secrets
- •Garmin Secret Screens
- •Hard Resets
- •Soft Resets
- •Warm Resets
- •Full GPS Resets
- •Diagnostic Screens
- •Autolocating
- •Magellan Secret Screens
- •Magellan Meridian Series
- •After a Hard or Soft Reset
- •Summary
- •Cables Demystified
- •The Data Cable
- •Power Cords
- •Combo Cables
- •Combining Cable Types
- •Multi-GPS Cables
- •Multi-Data Cables
- •Multi-Data/Power Cables
- •Multi-Data/Power/GPS Cables
- •Making Your Own Data Cables
- •Materials You Will Need
- •Don’t Want to Buy a Connector?
- •Making Power Cords
- •Power Cord Assembly
- •Testing
- •Precautions
- •GPS/iPAQ Connections
- •Cradle Modification
- •Testing the Connection
- •Making Combo Cables
- •Making Multi Cables
- •Summary
- •Power Hacks
- •GPS Power Needs
- •Alkaline Batteries
- •Lithium Batteries
- •Rechargeable (NiMH) Batteries
- •Battery Do’s and Don’ts
- •Power Hacks
- •Carrying Your Own 12-Volt Power Supply
- •Battery Packs
- •A Different Kind of Battery Pack
- •Alternative Power Supplies
- •Summary
- •Antenna Hacks
- •The GPS Antenna
- •Quad-Helix Orientation
- •Patch Antenna Orientation
- •Best Performance Summary
- •External Antennas
- •Antenna Placement
- •Other Things to Avoid
- •Reradiating Antennas
- •Personal Reradiating Antenna
- •Communal Reradiating Antenna
- •Reradiating Antenna Considerations
- •Setting Up a Reradiating Antenna in a Car
- •Testing the System
- •Making the System Permanent
- •Carrying a GPS Signal via Cable
- •How Much Signal Do You Need?
- •Cable Losses
- •Connector Losses
- •Using a Signal Repeater
- •Building Your Own Mega GPS Antenna
- •Materials
- •Building the Antenna
- •Summary
- •Screen Damage
- •Screen Protectors
- •More Screen Armoring
- •Commercial Protection for GPS and PDAs
- •Mounting GPS
- •Car Mounting
- •Mounting a GPS for Biking, Hiking, and Skiing
- •Making a Personalized Case
- •Summary
- •Software Hacks
- •Hacking the Firmware
- •Firmware
- •Updating Warnings
- •Updating the Firmware
- •Hacking GPS Firmware
- •Bypassing the Garmin eTrex Vista Startup Screen
- •Bypassing the Garmin eTrex Legend Startup Screen
- •Bypassing the Garmin eTrex Venture Startup Screen
- •MeMap Personalization
- •Manual Firmware Editing
- •Magellan GPS Firmware Modifications
- •Recovering from a Failed Firmware Load
- •Garmin
- •Magellan
- •Summary
- •Connection Types
- •Which Connection Is Best?
- •Troubleshooting Problems
- •PC Connection Trouble
- •General PDA Connection Trouble
- •General Bluetooth Connection Trouble
- •Software-Specific Issues
- •Erratic Mouse Pointer after Connecting a GPS
- •Windows XP Problem: Microsoft Ball Point
- •Microsoft MapPoint Troubleshooting
- •USB-to-Serial Converters
- •Summary
- •GPS Data Collection
- •Position, Velocity, Time
- •Waypoints
- •Working with the Data
- •EasyGPS
- •G7toWin
- •Creative Uses of GPS Data
- •Sharing Waypoints
- •Adding GPS Information to Digital Photos
- •Lightning Detector and Plotter
- •Wardriving
- •GPS in Programming
- •Summary
- •Examining the Data
- •NMEA
- •NMEA Sentences
- •NMEA Sentence Structure
- •A Closer Look at NMEA Sentences
- •Examining NMEA Sentences
- •NMEA Checksum
- •SiRF
- •Using NMEA Sentences
- •GPS NMEA LOG
- •GPS Diagnostic
- •RECSIM III
- •Using NMEA
- •GpsGate
- •Recording Actual NMEA Sentences with GpsGate
- •Recording Simulated NMEA Using GpsGate
- •Data Playback
- •Why Bother with NMEA?
- •Ensuring That Your GPS Works
- •Avoiding Data Corruption
- •Summary
- •More Data Tricks
- •Screenshots
- •G7toWin
- •G7toCE
- •Turning Your PC into a High-Precision Atomic Clock
- •Setting Up the Software
- •Setting Up the Hardware
- •Hooking Up Hardware to Software
- •Bringing a GPS Signal Indoors
- •Other Uses for GPS Data
- •Azimuth and Elevation Graphs
- •Surveying
- •Navigation
- •Signal Quality/SNR Window
- •NMEA Command Monitor
- •Experiment for Yourself
- •Summary
- •Playtime
- •Hacking Geocaching
- •GPS Accuracy
- •The Birth of Geocaching
- •Geocaching Made Simple
- •What Is Geocaching?
- •Geocaching from Beginning to End
- •The Final 20 Yards
- •Geocaching Hacks
- •Go Paper-free
- •Plan Before You Leave
- •Sort Out Cabling
- •Power for the Trip
- •Better Antennas
- •Protecting the GPS
- •Summary
- •GPS Games
- •The Dawn of GPS Games
- •Points of Confluence
- •Benchmarking/Trigpointing
- •GPS Drawing
- •Hide-and-Seek
- •Foxhunt
- •Other Games
- •Summary
- •GPS Primer
- •The GPS Network
- •How GPS Works
- •GPS Signal Errors
- •Summary
- •Glossary
- •Index

Examining the Data
When you connect a GPS to another device (such as a PC or an iPAQ) or to a software application, it is quite probable that the communication protocol used by this connection will be based
on a standard known as NMEA. NMEA is crucial to this communication, and by understanding the format that NMEA takes and how the data is structured, you are in a position to directly examine the data stream. If you can read NMEA, you can troubleshoot GPS problems, directly examine the data retrieved, and also check for corrupted data.
In this chapter, we are going to take a close look at the NMEA protocol and the format in which the data is output by a GPS receiver. By the end of this chapter, you will be familiar with the following topics:
Communicating with other devices
Software applications that enable you to capture and store NMEA data
Troubleshooting
The more you know about and understand the data, the more you can do with it.
NMEA
NMEA is the protocol most used by GPS receivers to communicate with other devices — either for data transfer to and from the unit, or for communication with other devices. The fact that this standard is used for GPS betrays its marine roots.
NMEA stands for National Marine Electronics Association, which is the body that sets and defines the standard. The full name of the standard most commonly used by GPS receivers is NMEA 0183. This standard covers not only GPS receivers but a variety of other electronic devices.
Most computer programs that provide real-time position information are capable of understanding the NMEA format. Some can only understand the NMEA plaintext format, while others use a variety of different data formats.
NMEA data sent from a GPS contains full PVT (Position, Velocity, and Time) data calculated by the GPS unit.
chapter
in this chapter
˛Introduction to NMEA
˛NMEA sentence structure
˛A tour through common NMEA sentences
˛A different standard: SiRF
˛NMEA tools
˛Recording real and simulated NMEA data
˛Troubleshooting with NMEA

196 Part III — Data Hacking
NMEA Sentences
The concept behind NMEA is to send data one line at a time. Each line of data (called a sentence) is completely standalone — self-contained and independent from other sentences. There are two kinds of sentences:
Standard sentences for each device category
Proprietary sentences for use by the individual devices and manufacturers
All of the standard sentences have a two-letter prefix defining the device that uses that sentence type. For GPS receivers, the prefix is always GP — most sentences that a GPS receiver understands are prefixed by these two letters. They are followed by a three-letter sequence that defines what the sentence contains.
As I’ve already mentioned, the NMEA standard permits hardware manufacturers to define and use their own proprietary sentences for any purpose they see fit. The only prerequisite is that all proprietary sentences must begin with the letter P, and are followed with three letters that identify the manufacturer controlling that sentence. For example, Garmin sentences start with “PGRM,” while Magellan sentences begin with “PMGN.”
Proprietary sentences vary from receiver to receiver and over time and are not covered here. Proprietary sentences contain more, and more specific, information than NMEA does, which is considered the lowest common denominator.
NMEA Sentence Structure
Each NMEA sentence begins with a dollar sign ($) and ends with a carriage return/line feed sequence. Most sentences can be no longer than 80 characters. All the data is contained inside this single line, and data items are separated by commas. The data itself is in the form of ASCII text, and the data can, especially if it’s complex, be spread over many separate NMEA sentences, but it is normally fully contained in just one sentence.
The precision of different sentences varies depending on the data. For example, time information might be given in seconds correct to one decimal place, while positional information might be given to three or even four digits after the decimal place. NMEA uses commas to separate individual fields of data. If the field doesn’t contain data, it’s left blank, but a comma is still required.
To improve accuracy, there is a provision to include a checksum at the end of each sentence, which may or may not be checked by the unit that reads the data. The checksum field consists of an * and two hex digits representing the exclusive OR of all characters between, but not including, the $ and *. The checksum is used to validate the contents of the sentence.
A checksum is required on some sentences, and optional on others.

Chapter 9 — Examining the Data 197
A Closer Look at NMEA Sentences
No detailed study of GPS is complete without a study of the most commonly used protocol for communication between the GPS and other devices. Even if you have no intentions of writing applications that process or work with GPS data, and instead plan on using only readymade applications, a basic knowledge of NMEA is very handy when it comes to diagnosing GPS problems and understanding what goes on between the GPS and the device with which it is communicating.
Here is a list of the current NMEA sentences relating to GPS receivers along with a description of what they do:
String Type |
Description |
|
|
$GPAAM |
Waypoint Arrival Alarm |
|
|
$GPALM |
GPS Almanac Data |
|
|
$GPBEC |
Bearing & Distance to Waypoint, Dead Reckoning |
|
|
$GPBOD |
Bearing, Origin to Destination |
|
|
$GPBWC |
Bearing & Distance to Waypoint, Great Circle |
|
|
$GPFSI |
Frequency Set Information |
|
|
$GPGGA |
*Global Positioning System Fix Data (Time, Position, Elevation) |
|
|
$GPGLC |
Geographic Position, Loran-C |
|
|
$GPGLL |
*Geographic Position, Latitude/Longitude |
|
|
$GPGRS |
GPS Range Residuals |
|
|
$GPGSA |
*GPS DoP (Dilution of Precision) and Active Satellites |
|
|
$GPGSV |
*GPS Satellites in View |
|
|
$GPHDG |
Heading, Deviation & Variation |
|
|
$GPHDT |
Heading, True |
|
|
$GPHSC |
Heading Steering Command |
|
|
$GPMWV |
Wind Speed and Angle |
|
|
$GPRMC |
*Recommended Minimum Specific GNSS GPS/TRANSIT Data |
|
(Time, Position, Velocity) |
|
|
$GPROT |
Rate of Turn |
|
|
$GPRPM |
Revolutions |
|
|
$GPRTE |
Routes |
|
|
Continued

198 Part III — Data Hacking
String Type |
Description |
|
|
$GPSTN |
Multiple Data ID |
|
|
$GPTRF |
Transit Fix Data |
|
|
$GPVBW |
Dual Ground/Water Speed |
|
|
$GPVDR |
Set and Drift |
|
|
$GPVLW |
Distance Traveled through the Water |
|
|
$GPVPW |
Speed, Measured Parallel to Wind |
|
|
$GPVTG |
*Track Made Good and Ground Speed ( Course over ground and ground speed ) |
|
|
$GPWCV |
Waypoint Closure Velocity |
|
|
$GPWNC |
Distance, Waypoint to Waypoint |
|
|
$GPWPL |
Waypoint Location |
|
|
$GPXTE |
Cross-Track Error, Measured |
|
|
$GPXTR |
Cross-Track Error, Dead Reckoning |
|
|
$GPZDA |
UTC Date/Time and Local Time Zone Offset |
|
|
$GPZFO |
UTC & Time from Origin Waypoint |
|
|
$GPZTG |
UTC & Time to Destination Waypoint |
|
|
NMEA consists of sentences; and for each of these sentences. the first word, called a data type, defines how the rest of the sentence is interpreted. Each data has its own unique interpretation, as defined by the NMEA standard.
For example, take the GGA sentence shown here:
$GPGGA,180432.00,4027.027912,N,08704.857070, W,2,07,1.0,212.15,M,- 33.81,M,4.2,0555*73
This NMEA sentence shows an example that provides fix data information.
Sentences vary in the information they contain. Some sentences will repeat some of the information already provided, while others provide new data. Devices attached to the GPS can look for the NMEA sentence they want and choose to ignore others.
Normally, there are very few ways to control which NMEA sentences are sent from a GPS and which aren’t. The usual state of affairs is that each GPS receiver simply transmits all of the data and lets the attached device pick and choose what to read and what to ignore. Some receivers can be set to send only certain types of sentences, but there is little benefit to doing this. There is no way for the receiving device to acknowledge receipt of the data or to request that the data be retransmitted because it was lost or garbled — if the receiving unit checks the checksum on a sentence and finds it is corrupted, the receiver must wait until the next time a similar NMEA sentence is transmitted.