Testing GPS applications requires a gps receiver and an antenna in a position to receive the satellite signals. This, however, is rarely the case when doing software testing at a computer's keyboard. This is where gpsfeed+ can be of help.
gpsfeed+ is a utility that feeds the PC with continuous GPS data as if a GPS were moving in a car or airplane. NMEA 0183 GPS sentences are sent to the application through a socket (TCP/IP) connection or a UDP multicast message. It also outputs the same NMEA data to a serial port of the PC. Polling applications can query the embedded lightweight http server to obtain gps data either in text form or as an XML data snippet. The IP connection offers significant advantages over a serial port connection:
gpsfeed+ is in development. Please submit bug reports through the SourceForge bug tracking facilities.
The GPS data provided by gpsfeed+ are calculated by very simple mathematical formulas and the results are just presented in the NMEA 0183 sentence format, so use the program on your own risk.
If by examining the code you feel that you can add a feature you like or you can make it function better, then you are free to do so. Contributing your code will help improve gpsfeed+.
gpsfeed+ is free software, written in tcl. It is provided in source code, under the GPL license. Linux and Windows binaries are also provided for the x86 architecture.
gpsfeed+ features two zoom modes: a fixed zoom all mode, and an experimental autozoom. In autozoom mode (icon ), the zoom level changes automatically, in inverse proportion to the speed of the vehicle; the slower the vehicle moves, the higher the zoom level; the area zoomed becomes smaller and more track detail can be seen. If the vehicle moves faster, the area zoomed becomes larger and less track detail is seen.
The reasoning behind the autozoom mode is simple:
In autozoom, the map is centered on the current fix.
Simulated gps tracks are calculated around user defined center coordinates and range. gpsfeed+ offers, at the moment, the following track shapes:
The velocity in circle is not absolutely constant because the circle is drawn in Cartesian and not spherical coordinates and is therefore not a circle if drawn on the surface of the earth.
For recorded GPS track operation, files containing captured NMEA 0183 sentences can be played back by gpsfeed+ (configuration panel, Mode pane).
Pressing play a second time (icon ) causes gpsfeed+ to stop outputting valid fixes; NMEA sentences are still sent to the output, however data fields are empty and the "fix" field is set to "V" (i.e. fix data invalid). When in pause mode, the play button momentarily flashes red (icon ) and the fix mark (icon on the map) turns to , indicating the "no signal" condition.
If screen space is precious but gpsfeed+ controls should be present, the compact mode (icon ) minimizes gpsfeed+ so that only the toolbar icons are displayed.
The Monitor panel in the configuration window shows exactly what is being sent to the output. You can use monitor even if you have no connection to an output port of any king. Monitoring output this way may be useful when editing your own NMEA sentences, or if you want to see what is coming in from the serial port in Serial-to-IP forwarding.
The NMEA panel has an option Prevent no signal. gpsfeed+ has been written so that satellite visibility is variable. Although this might never happen in real life, there is a need when testing the GPGSV NMEA sentences to have satellites rising and setting. gpsfeed+ allows a condition where all 32 satellites are visible and also where none of them is visible. The Prevent no signal option simply makes all satellites visible by inverting their elevation if it becomes negative.
The NMEA panel includes the option User defined, together with a text box. If this option is selected, whatever is entered in the textbox, gets output to the ports. Prefixing a word with a ’$’ makes it a variable. If the system knows the variable entered, it will substitute it before it sends the sentence to the output. Otherwise it will consider the sentence in error and will not output anything from that sentence. The available gps variables are evident in the code. Some examples of existing and test sentences are by default present in the NMEA textbox. Relative documentation about the system variables will be made available in the future.
gpsfeed+ implements a lightweight http server for applications that use GET or POST funtionality to get gps coordinates. Examples of this functionality are the getURL and postURL functions that some SVG implementations offer or the XMLHttpRequest object in various browsers.
To use the http server in gpsfeed+, a free IP port will have to be set. By default this port is set to 80. If port 80 is occupied by another web server, any other free port (e.g. port 81) will do. If you plan to serve also documents (e.g. SVG documents using the getURL or postURL functions to get gps coordinates from the same server), then a root directory, where these documents reside, will also have to be set.
gpsfeed+ http queries have the following syntax:
http://localhost/gpsfeed
will cause a reply in the form
lon=dd.ddd;lat=dd.ddd;alt=dd.ddd;
bear=dd.ddd;speed=dd.ddd;
Specific data query:
http://localhost/gpsfeed?time=;msec=;
http://localhost/gpsfeed?type=xml
http://localhost:81/gpsfeed?type=xml
Testing the http server is simple: Start gpsfeed+ and press the play button. Cut and paste a query of the ones shown above to the address bar of a browser and hit enter. The server should reply with the gps data requested.
You can easily test the TCP NMEA output of gpsfeed+ by connecting to it with a web browser (Firefox and IE work. Mozilla doesn’t: it waits forever for the socket to be closed).
Enter the following address to the address bar
(assuming TCP/IP port 2222
has been configured):
http://localhost:2222
You will see a welcome connection message and then NMEA sentences will start printing on the page as they come in. The welcome message is only output when using the http protocol to get a connection, i.e. when connecting to gpsfeed+ with a browser.
Minimal (emergency) remote control of gpsfeed+ is provided through the TCP http interface.
Typing:
http://localhost:2222/exitor
http://your.remote.address:port/exitin a browser’s address bar, will close gpsfeed+.
A side effect of opening a serial port as a stream is that, if you enter a serial port that does not exist, or any other name in place of a serial port, all output of gpsfeed+ will be dumped to a file with that name. This may be useful in some situations, where the output of gpsfeed+ needs to be inspected afterwards.
Most GPS receivers come with a serial interface of some sort. None of the popular ones comes ready with an IP interface, so, how is one supposed to connect a gps with a serial interface with an application that has been written to use IP sockets?
To overcome this issue, small software utilities called serial-to-ip port forwarders can be used. One of these utilities, which has been around for many years, is gpsd, written by Emmanuel Mogenet as a part of his gps3d project. You can use gpsd to relay anything that comes into the serial port to a local IP port.
If you are a Windows user, put your gps in NMEA mode, then run the following in a command window, or create a shortcut to gpsd.exe and put the following as target string in its properties:
gpsd.exe -serial COM1 -speed 4800 -port 2222
You can test gpsd’s functionality the same way you test gpsfeed+ with a browser.
gpsfeed+ includes a serial-to-IP forwarder to facilitate monitoring and sharing of serial gps data. However, in production environments, the use of gpsd is recommended, since it is smaller in size and requires less resources for its operation.
There is another very interesting gpsd project, here, which also discusses a number of technical GPS issues and ideas. There is also a proposal for a new GPSTVP sentence that will include all basic GPS location and motion parameters. gpsfeed+ can simulate this proposal very easily and it includes it as a user defined sentence from version 0.53 on. This gpsd code runs only on Unix (Linux) machines.