Looking for a possibility to emulate some GPS data for testing some balloon tracking software I found the nice tcl application called gpsfeed+ . That is very useful for feeding simulated GPS data into a device using a serial port. My usecase is testing software with GPS data on the computer itself. The way to go is to use pseudo TTY devices that is a piece of software pipe that you can put data in on the one end and read of from the other end.
For creating such a TTY pipe on my Ubuntu Trusty I used socat to create a bidrectional pipe. It creates two devices that can be used to write GPS raw data from gpsfeed+ to and read from the other end. Here I used it to simluate an attached GPS receiver to dl-fldigi in order to test the tracker. The pseudo TTY pipe can be set up as follows:
After that you have two devices. You can attach gpsfeed+ to /dev/pts/28 for example and dl-fldigi to /dev/pts/29. After configuring this dl-fldigi can read the simluated GPS data from /dev/pts/29. The siumlated GPS position is shown in the preferences window on the right. By default gpsdeed+ emulates some circles around a configured GPS position. Here we are drawing some circles around Athens in Greece.
Playing a pre-recorded Track
Another option is to let gpsfeed+ play a GPS track that way previously recorded with a handheld GPS device. In my case I have some tracks that were exported from a Garmin GPS device. Apparently that is not NMEA raw data as gpsfeed+ expects. But there is another nice piece of software called gpsbabel. That can be used to convert GPS data from any known format to almost every other format. Here I converted a .gdb file to NMEA raw data:
The converted file needs some rework because the time fild is obviously a little different from what is expected. And the other reason is that there is no information about satellite fixes in the file. That causes some program to ignore the GPS data.
1 2 3
This can be edited with some sed magic. For example:
1 2 3
The resulting file can be opened in gpsfeed+ and replayed. The result is shown in the following image.