Скачиваний:
142
Добавлен:
15.03.2015
Размер:
10.83 Mб
Скачать

Chapter 9 — Examining the Data 213

FIGURE 9-11: Adding errors to the simulated GPS data

Using NMEA

But what can you actually do with NMEA? All these sentences containing information are a method of communicating the data displayed on the screen of the GPS. For what other, possibly more useful, purpose can we use NMEA?

You can do two very interesting things with NMEA data:

You can store the NMEA output of your GPS on an electronic device and use this as a record of the journey. As you will see, there are advantages to storing the data in NMEA format that aren’t immediately obvious.

You can create your own NMEA data and store it in a file that can later be played back to other applications, which will believe that they are receiving data live from a GPS, when in fact they are receiving only fake data.

GpsGate

A variety of applications can effectively work with NMEA, but one of the best and most versatile in called GpsGate.

GpsGate is published by Franson Technology AB, and is available for download from http://franson.biz/gpsgate. GpsGate is a commercial application available in two versions: Windows, shown in Figure 9-12, and the Pocket PC, shown in Figure 9-13.

214 Part III — Data Hacking

Figure 9-12: GpsGate for Windows

FIGURE 9-13: GpsGate for Pocket PC

A single commercial license for Windows or Pocket PC is $30, but you can download a fully functional 14-day trial version.

Installation of the Windows version is very straightforward:

1.Download the zipped package from the website.

2.Extract the setup file contained within the zip file.

3.Run the setup file. This will install the application.

Chapter 9 — Examining the Data 215

Once the application is installed, it puts an icon in the Start Menu. If you choose to run the application after installation, you will notice than an icon is placed in the Windows System Tray (on the right-hand side of the taskbar).

The icon in the System Tray is the main control center for GpsGate. Right-click on this icon and you will be presented with a comprehensive menu of functions (see Figure 9-14).

FIGURE 9-14: GpsGate menu

Click Settings and a settings window will be displayed, as shown in Figure 9-15.

FIGURE 9-15: GpsGate settings window

216 Part III — Data Hacking

In this screen, you can specify the input that the application should receive and process. Inputs include the following:

COM port (a GPS attached to the PC)

Gate Direct (data passed through the application directly)

NMEA Log (this processes data from a log)

Simulator (GpsGate can act as a virtual GPS)

Virtual Port (processes data received from a virtual port)

TCP/IP (data received over a network)

UDP (data received over a network)

You can also set up virtual ports to which the data can be sent. Any virtual ports created appear in the list of ports available for most applications, and enable you to take one GPS input and send it to a number of ports. Generally, the GPS can only be accessed by one application, because applications lock a port when using it. GpsGate enables you to take one signal and send it to multiple applications on both a Windows PC and a Pocket PC device, as shown in Figure 9-16.

FIGURE 9-16: GpsGate can send a GPS signal to multiple virtual ports.

Recording Actual NMEA Sentences with GpsGate

If you have a GPS connected to your PC, you can use GpsGate to record the NMEA sentences from the GPS to a file on the PC. There is an advantage to storing the GPS data in an NMEA file, rather than in a proprietary format: An NMEA file can be imported into a variety

Chapter 9 — Examining the Data 217

of applications, whereas proprietary formats (such as TomTom or Memory-Map logfiles) require specific software.

Capturing NMEA sentences for storage in a file is easy:

1.Connect your GPS to the PC as normal.

2.Switch the GPS on.

3.In GpsGate, set the source to COM Port (see Figure 9-17).

FIGURE 9-17: Setting the input to COM

Port in GpsGate

4.Right-click on the GpsGate System Tray icon and choose Settings.

5.In this window, choose the input port that matches the one to which the GPS is connected.

6.Once again, right-click on the GpsGate System Tray icon and choose NMEA Log (see Figure 9-18).

FIGURE 9-18: Choosing

NMEA Log in GpsGate

218 Part III — Data Hacking

7.To record the input, click the Record button. This brings up a dialog box asking you to choose a location in which to save the NMEA output file.

8.To stop recording, click Stop.

9.Once you are done, you can examine the NMEA output file. A sample is shown in Figure 9-19.

FIGURE 9-19: Sample NMEA output

NMEA output files are plaintext files that can be processed by a variety of GPS applications. For example, you can import a file into an application such as Memory Map and have the NMEA data translated into a route that appears on the map as an overlay. However, unlike a real-time signal from a GPS, the file can be replayed without requiring a clear view of the sky.

In theory, this enables you to separate the tracking and mapping elements of recording the data. This would enable you to create a simple yet effective tracking system (for, say, a car). All you need is a GPS and a Pocket PC device running GpsGate.

Connect the GPS to the Pocket PC and set up GpsGate to log the NMEA (the software is the same as the Windows version). This will create a log file that you can later examine. Because each NMEA sentence contains a checksum, tampering with the actual log is unlikely (hide the system well and no one need know it was fitted to the vehicle!).