GPS Logging

Molly is destined to wander. And we use GPS or Global Positioning System to track and log exactly where she is wandering. We log to two different databases within Molly and to two different yet lower fidelity database in the cloud. Our Garmin Overland navigator also logs our tracks, but that is part of navigation. These logs make it easy to generate tracks and look back in time to see where we have been. Logging belongs to the Monitoring section of the Technical Series, while tracking belongs to Mapping section. So this page is about how we log the GPS tracks.

When we did our big trip around the world, we had a little 5 inch Garmin nüvi 52LM. This was a great device, and we used it to record all of our tracks. However, we would put it away each night, meaning we had to re-connect it every morning. And we had to manually download the tracks from the memory card. For Molly, we wanted the system to be fully automatic, quietly and constantly logging in the background. More details on how we use to do it on this post.

The GPS Sensors

Molly has a completely unreasonable four GPS sensors, they are:

  • Cradlepoint IBR900 router
  • Garmin 18x receiver
  • SPOT Trace
  • Garmin Inreach Mini

The number of GPS sensors has grown over time, making the overall system quite robust and tolerant of failures.

Cradlepoint Router

One of the very first items of electronics we added to Molly was the wifi router. This device is typically used for fleet management including tracking, and therefore comes with a built in GPS sensor. And while the specification for the GPS chip is very impressive, in reality it fails to deliver good results. It has great trouble acquiring a signal unless it has good coverage of the sky. And sometimes, even when it has good coverage, it still fails to determine it’s location. Probably a bug in the service..

Satellite channels

— Maximum of 55 channels with simultaneous tracking

Supported Satellite Systems

— GPS

— GLONASS

— BeiDou

— Galileo

Accuracy

— Horizontal: < 2 m (50%); < 5 m (90%)

— Altitude: < 4 m (50%); < 8 m (90%)

— Velocity: < 0.2 m/s

Speed

— 1 Hz refresh rate

— Hot start: 1 second, Warm start: 29 seconds, Cold start: 32 seconds

The Cradlepoint has an external antenna, including a GPS antenna, which are all located at the rear of Molly as part of an antenna array for wifi and cellular. In this location the antenna should have an excellent view of the sky while driving.

The software in the router can be configured to send the GPS information to external servers. In our case we send the GPS information to node-red for logging to influxdb and to the traccar which is also logging software. But more on that later.

Garmin 18x LVC

Only because the Cradlepoint GPS performed so badly, we added another GOPS receiver, being the Garmin 18x LVC. And this device is performing very well indeed. the 18x is a dedicated GPS receiver intended for the automotive sector. It would have been easier to get the 18x USB model, which could be plugged straight into the computer. But the LVC model has more features, including PPS or a Pulse Per Second output. This output will pulse each second, with the rising edge of the pulse being timed to the very start of the second. One day we might wire this pulse up for an accurate local time server.

Satellite channels

— Maximum of 12 channels with simultaneous tracking

Supported Satellite Systems

— GPS

— WAAS

Accuracy

— Horizontal: < 15 m (95%); < 5 m (95%) with WAAS

— Velocity: < 0.05 m/s (rtms)

Speed

— 1 Hz refresh rate

— Hot start: 1 second, Warm start: 38 seconds, Cold start: 45 seconds

This little GPS receiver is installed in the ceiling void space affording it an excellent view of the sky but is nicely hidden from our view.

The manual for this device is excellent, and it was not too hard to wire it up. The output is RS232, and this is converted to a computer friendly format with a FTDI serial to usb cable.

Molly’s house is made of fiberglass, which is virtually invisible to high frequency radio waves. So the GPS antenna can see right through the house material

SPOT Trace

SPOT makes a variety of devices, with the Trace model intended for vehicle and asset tracking. It is subscription based service, sending GPS coordinates to satellites and storing them on cloud servers. SPOT uses the Globalstar network, which has near global coverage with a few spots like the poles and parts of South America not covered.

No information is available on the GPS chip used and the specifications.

The SPOT trace is mounted in the ceiling void space alongside the Garmin receiver. It has a permanent power supply so the batteries do not need to be changed. The SPOT runs continuously.

Garmin InReach Mini

The final GPS logging device. The Garmin Inreach is similar to the SPOT trace, in that it sends GPS information or tracking points to satellites. The satellite network used is the Iridium network with global coverage. It is a subscription based service like the SPOT Trace.

No information is available on the GPS chip used and the specifications.

The Garmin is not permanently fixed anywhere as we use it when we go hiking. So it can track us when out and about. When driving, the Inreach is paired with our Overland navigator and the navigator can stop and start tracking feature on the Inreach.

The Local Software

The software local to Molly can receive the messages from the Cradlepoint router and Garmin 18x devices and extract GPS coordinates and other GPS information. They both can support the NEMA 0183 sentence, which is a very old serial based format, dating back to 1983. It is a good choice, being so old, NEMA 0183 is compatible with many GPS logging systems. While not technically an open standard, it has been successfully reversed engineered and is in very common use.

Cradlepoint GPS Sentence Transmission

The Cradlepoint modem is quite flexible on how it can transmit the GPS location information to other computers. In our case we have configured the Cradlepoint router to send the GPS coordinates to the computers mounted in Molly. In fact, we send the signal twice for receipt by two different applications, one application running on our main computer and the to a different application running on the raspberry Pi.

The GPS information is sent in a sentence based protocol. There a few protocols available in the Cradlepoint modem, and as mentioned above, we use configure the router to use NEMA protocol. Cradlepoint makes a few vendor specific extensions, like the addition of a station identifier.

We have configured our router to send the following GPS sentences.

  • $GPGGA provides fix data like latitude, longitude, altitude, time of fix, fix quality, number of satellites used to establish the fix, precision of fix and height of geoid above WGS84 ellipsoid
  • $GPRMC includes some of the values from $GPGGA, but adds date of fix, speed over ground in knots), course made good (relative to true) and magnetic variation.
  • $GPPGNS like GPGGA, but indicates which global positioning system is beingused.
  • $GPVTG includes the above with speed over ground also reported in Kilometers per hour being added.

We send all four sentences and extract parts from $GPGGA to determine location and parts form $GPVTG to determine motion. Sentences are sent every 30 seconds, even if Molly has not moved.

Below is an example of the two sentences we use, with the station identifier of Molly42 prefixed to each sentence.

Molly42,$GPGGA,214824.00,3607.223654,N,12128.322347,W,1,9,0.8,629.6,M,-29.0,M,,*54\r\n
Molly42,$GPVTG,180.9,T,180.7,M,20.0,N,30.0,K,A*25\r\n
Sentence Decoding in node-red

A small javascript program in node-red is able to decode the messages and store the results in influxdb, see here for further details. The software is actually a little more complicated than shown, as there are two message types involved, $GPGGA and $GPVTG. Each are processed, because they contained different useful items.

The sentences are decoded using a node-red function with the output then placed into influxdb. The checksum of each sentence is validated, and then the following values are extracted and stored in the database every 10 seconds.

$GPGGA
- latitude [degrees]
- longitude [degrees]
- altitude [in meters]
- quality of fix [index]
- number of satellites used in fix [number]
- horizontal dilution of precision [index]
- time of fix [hhmmss UTC]

$GPVTG
- course made good (true) [degrees]
- speed over ground [Kilometers/hour]
Sentence Decoding in Traccar

The GPS sentences are also decoded by Traccar which is an open source GPS tracking platform. Traccar does not support Cradlepoint, so we added to the platform with some new code. Unfortunately Taccar is not very good at combining information from different GPS sentences and has no framework to shared information across messages. Regardless, we got it working.

The following values are stored in the Traccar database.

$GPRMC
- latitude [degrees]
- longitude [degrees]
- speed [knots]
- course [degrees]
- Validity of fix
- time of fix [hhmmss UTC]
- date of fix [ddmmyy]

$GPGGA
- altitude [in meters]
- number of satellites used in fix [number]
- time of fix [hhmmss UTC]

That’s it for the logging. The log entries are retained indefinitely. Of course the log entries can be display onto a map, but that is discussed in the various posts about mapping.

GPS Antenna is located on the rear bumper.
Garmin 18X LVC
Wiring Diagram, from the Garmin manual with an addition in the future for a Pulse Input.
Traccar creates tracks from GPS waypoints.
Node-red also tracks based on the same GPS waypoints.
Satellite GPS Logging

Of course we can also track our location via the Spot Trace satellite tracker we have. These waypoints are stored in the cloud in our AWS account. So even is everything in Molly falls apart, then we still have logs stored in the cloud.

Maybe in the future when Amazon launches their time-stream service, we will send data from Molly to the cloud. But more on that later.