GPS Data UDP Forwarder

Summary

This demo application runs forever, reading in NMEA sentences (output data from a GPS device) and forwards a subset of the data to one or more remote hosts via UDP/IP. The hypothetical system used for the demo is a Digi CP device with GPS within the vehicle, which is to forward ALL GPS data via Ethernet to a computer mounted within the vehicle, plus only send the RMC (Recommended Minimum Navigation Information) via cellular UDP/IP to a central Vehicle-Location-System (VLS).

To save data costs, the RMC message for the central VLS is only sent once per minute when the vehicle is moving, and once per 15 minutes if the vehicle is idle or the GPS signal is in error. This is important since the GPS device used in this demo creates about 200MB of data per month - and this model is a fairly QUIET one! Other GPS devices with more features can create 5 or 10 times more traffic.

Tested with the following equipment

Note that the method used for serial data allows this script to run on EITHER a Windows computer with the GPS installed as a USB-based serial port, or on Digi ConnectPort products supporting the GPS service (X4,X8,CP-WAN and so on) Check Virtual GPS NMEA Access to make sure your model and firmware includes this service.

Files required to run

Upload all of these to your Digi product's Python directory:

Other files

When it runs, you will see SOMETHING like this (results may vary :-)

central does not want <GSA> sentences
local sending <$GPGSA,A,3,10,24,30,21,,,,,,,,,5.0,2.8,4.2*3C
>
>>SPEED: 0.98 Kts - GPS says we are IDLE - not moving
local sending <$GPRMC,183037.000,A,4453.9342,N,09324.9895,W,0.98,30.37,090209,,*20
>
central does not want <GGA> sentences
local sending <$GPGGA,183038.000,4453.9342,N,09324.9898,W,1,04,2.8,307.4,M,-31.7,M,,0000*6F
>
central does not want <GSA> sentences
local sending <$GPGSA,A,3,10,24,30,21,,,,,,,,,5.0,2.8,4.2*3C
>
>>SPEED: 1.19 Kts - GPS says we are IDLE - not moving
local sending <$GPRMC,183038.000,A,4453.9342,N,09324.9898,W,1.19,27.91,090209,,*20
>

Hopefully the comments in the file digi_gps_config.py explain what is required. Just note that you CANnot use Windows NotePad.exe to edit these files because it mixes DOS and UNIX formats. Instead, WordPad.exe (also included in Windows) does not cause this problem

ZIP of the files

Digi_gps.zip

Extensions

This design could be extended (by you) to do the following: