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

220 Part III — Data Hacking

The file created will contain NMEA data similar to the output from a GPS, but this data is simulated and has not been generated by a GPS.

Data Playback

Now that you have the NMEA files, you can output the data. While some applications will accept NMEA directly, with GpsGate, as long as the application can take the data and output it to a virtual port from which the application can take the data, the application will treat the data as though it’s coming directly from a GPS, when it fact it’s coming from a log file.

To set this up, follow these steps:

1.Choose the output virtual port for the data by right-clicking on the GpsGate icon in the System Tray and choosing Settings.

2.Fire up the application you want to send the data to and choose the virtual port and the incoming GPS data port (how you do this will vary from application to application, so consult your manual for details).

3.Right-click on the GpsGate icon and choose Source NMEA Log. This will bring up the window shown in Figure 9-21.

FIGURE 9-21: GpsGate NMEA Log playback window

You can now control the playback of the log using the Play, Stop, Pause, Rewind, and Forward buttons. Clicking Play will output the NMEA log to the application listening to the virtual port.

Why Bother with NMEA?

You might be wondering why so many applications enable you to examine and record the NMEA sentences that come from a GPS. Are all these software programs and utilities driven purely by curiosity?

Chapter 9 — Examining the Data 221

Well, partly, yes! However, there is a serious side to examining NMEA. Let’s look at two aspects now.

Ensuring That Your GPS Works

A GPS, like all other electronic gadgets, is prone to failures. If, one day, you are unable to switch on your GPS even after you change the batteries for fresh ones, then you know it’s dead. But electronic devices are just as prone to erratic problems as a result of failures.

A good way to determine whether your GPS (or antenna) is picking up satellites properly is to hook the device up to a PC or portable device and look at the NMEA being produced. Does what you see look like valid NMEA? Do all the sentences look okay or do you find that there are blank lines being displayed onscreen?

If your GPS is outputting valid NMEA that contains accurate positional information, then the GPS is working (even if other components of the GPS, such as the screen or input buttons, aren’t). I’ve seen GPS receivers with broken screens or nonfucntioning buttons put to excellent use when connected to another device.

If your NMEA sentences seem wrong or cut off or include blank lines, before you condemn your GPS to the trash can (or recycling depot), check all the cables and connections. Follow the instructions in the cable chapters to test your cables (remember that heat and vibration can affect cables, so test them under these conditions if possible). If possible, try a different cable to see if the problem persists.

Avoiding Data Corruption

When you have a GPS connected to a PC or portable device for navigating with (in-car especially), you’ll likely notice that most of the track information for your journey is smooth and accurate and follows the road closesly. However, you might also find that occasionally you get what are known as spikes in the data. Spikes are when you appear to have moved a great distance very fast indeed. Sometimes the jumps can be very small (a few hundred meters), while at other times the spikes can be huge, momentarily propelling you hundreds, if not thousands, of miles off course before bringing you back to where you are suppoed to be.

These can be irritating and make you lose faith in your system, and it’s a good idea to try to pinpoint the cause of the problem.

This kind of problem usually indicates one of two root causes:

A problem with the GPS

A problem with the device to which the GPS is connected

If the problem is with the actual GPS itself, then the way to test it is simple: First make a log of the NMEA sentences. Then, when you see a problem with the tracklog produced, look through the NMEA sentences for data that corresponds to the glitch. You can save yourself a lot of time by only looking at the $GPGGA sentences that contain the position, velocity, and time data.

With practice, just a cursory look through the listing will highlight problems. Generally, the numbers represeting coordinates and velocity change gradually over time, and sudden changes are