NMEA Server

It's almost certainly a foregone conclusion by now to anyone who might be paying attention, but I'll make it official. I no longer maintain this software. Use it with my best wishes, but my responsibilities and priorities have led me to abandon this tool.

Since the serial port on a computer system is a scarce resource, and since I would like to use several tools simultaneously to analyze the NMEA-0183 sentences output by my GPS receiver, I'm developing a simple server application that distributes NMEA data to a number of listeners.

Details

This software is under development in my spare time, and it still lacks some of the capabilities I personally need, but I've achieved good results already with Garmin and Motorola GPS receivers and listener applications ranging from telnet sessions to custom Java visualization and analysis tools.

I intend to have the finished product support the following requirements:

Capabilities

Of the capabilities listed above, only the last one remains to be implemented.

One capability that is intentionally not a requirement is to support applications that are designed to work directly with a serial port. This application is intended to support custom analysis tools running on a local-area network. It will use standard IP stream sockets for communication.

I'm not the first one to invent this wheel; see the Similar Software by Others section for a few of the alternatives I've discovered.

Performance Issues

In the design I'm currently pursuing, I emphasized the need for the server to avoid being adversely affected by slow or faulty connections. On connections that are too slow or are experiencing severe transmission problems, the server will allow messages to be lost. Other connections will not be made to suffer from difficulties on a problem connection.

Documentation

This is it:

    nmead -h

Since the server is still under development in my spare time, what time I do spend on the project is still spent either on the server itself or on client applications. Once I've reached a good stopping point with the server, I'll provide better user documentation.

Get the Source

The software can be freely distributed under the terms of the GNU General Public License (GPL). The reference platform is Red Hat's Fedora Core 1.0, but I expect the software to be compatible with other UNIX workalikes as well.

This software is still under development. Command-line options, default values, and program behavior are all subject to change. Comments, bug reports, and criticism are welcome (use this contact form).

4 November 2010: I have an update shared by Jon Miner that I need to post here (as I've needed to do since early this year). Once I do that, I'll likely not update this resource again.

The latest version (01.03.00, 26 July 2004) is here (gzipped tar). This update includes changes kindly shared by Carl Worth. His changes should eliminate the warnings reported by many compilers.

The previous version (01.02.00, 26 June 2004) is still here too, and includes changes shared by Martin Mersberger and Jon Miner. Martin's changes should make the code compile on FreeBSD systems, and Jon's changes make it somewhat easier to stop and restart the server by avoiding the need to wait for the operating system to release the socket when the server is stopped.

Those of you who use NTP might be interested to know that Jon Miner has published a patch to ntpd that lets it use the NMEA Server as a time source.

Version 01.01.00 is here (gzipped tar). This update was intended to eliminate some portability problems that were discovered in the previous version.

The original version is here (gzipped tar).

Browser Unzipping

The files referenced above are stored on the server in gzipped tar format, but I've learned that some browsers, if so configured, will automatically unzip the file upon downloading, making it an ordinary tar file even if it retains the .gz extension.

If you use the command

    tar xzf nmead.src.01.01.00.tar.gz
and get errors, try omitting the z argument.

Prerequisites

You'll need a Linux system or a similar UNIX-like system with a C compiler and linker. You'll also need zlib if it isn't already installed on your system.

Fedora Core 5 Patch

Jon Miner shared this patch that's necessary for Fedora Core 5 systems. I'm ashamed that I haven't found time to incorporate it and release an updated version of the source code, but at least you can apply these changes to use the code on recent Fedora distributions. This is the output of diff -u:

--- ../dist/nmead-01.03.00/listeners.c  2004-07-26 20:28:32.000000000 -0400
    ./listeners.c       2007-08-19 10:24:11.000000000 -0400
@@ -113,7  113,7 @@
 {
     union sock sock, work, peer;
     int wsd, sd;
-    int addlen, peerlen;
     socklen_t addlen, peerlen;
     listenerinfo_t * listenerinfo;
     pthread_t * listener;
     int threadresult;
@@ -149,7  149,13 @@
     }

     do {
         addlen=sizeof(work.s);
         memset(&work.s,0,addlen);
         wsd = accept (sd, &(work.s), &addlen);
         if (wsd == -1 ) {
           perror("accept");
           exit(1);
         }
         peerlen = sizeof (struct sockaddr);
         getpeername (wsd, &(peer.s), &peerlen);
         time (&now);

Clients

Most of the client tools I use aren't suitable for publishing, but here's an example client application.

Similar Software by Others

I'm not the only one who's had the bright idea of distributing navigation data via IP. Some of the alternatives include:


Chuck Taylor -- (Copyright) -- (Contact)