GPS Logging

Molly is destined to wander. We use GPS or Global Positioning System to track and log exactly where she is wandering. We log our position to two databases within Molly and a lower fidelity database in the cloud. These logs make it easy to look back in time to see where we have been. The following is all about the electronics we have to log our position.

A little background first. Back in 2013, 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. We had to manually download the tracks from the memory card. For Molly, we wanted the system to be much more automatic, quietly and constantly logging in the background. More details on how we use to do it on this post.

Navigation devices used to travel through China, and other places.
The GPS Sensors

Molly has a four GPS sensors for logging, they are:

  • Cradlepoint IBR900 Router
  • Garmin 18x receiver
  • SPOT Trace
  • Garmin inReach Mini1

The number of GPS sensors has grown over time, making the overall system quite robust, tolerant of failures and probably a little more complex than it needs to be.

Below is a description of each sensor and how it is electrically connected.

Sensor 1 : Cradlepoint Router

One of the very first item of electronics we added to Molly was the Cradlepoint router. This was to give us local area wifi network, and at the time, had no idea it could also receive a GPS signal. This type of router is typically used for fleet management including vehicle tracking, and turns out it comes with a built in GPS sensor. Which makes complete sense.

While the specification for the GPS chip is very impressive, in reality the router 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 its location. Over the years Cradlepoint has updated its software to correct some of these issues, but it still does not work that well. Regardless, here are the specifications of the GPS chipset in the router:

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 router is located in the electrical cabinet, which is a pretty bad place to receive a GPS signal. The good news, the router is connected to an external active GPS antenna, which is located near the house entry door. In this location the antenna is far away from the electrical cabinet and as a reasonable view of the sky, even while driving.

The rear of the router with the GPS antenna connection.

The software in the router can be configured to send the GPS information to an external servers. In our case we send the location coordinates to our computers for processing and storage. These messages are sent over the network, and no further wiring is required.

Sensor 2 : Garmin 18x LVC

Only because the GPS system in the Cradlepoint router performed so badly, we added another GPS receiver, being the Garmin 18x LVC. And this device is performing very well indeed. Not bad considering the chipset specifications aren’t that impressive.

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 giving it an excellent view of the sky but is nicely hidden from our view.

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.

Garmin 18X LVC

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 voltage format with a FTDI serial to usb cable.

Wiring Diagram, from the Garmin manual with an addition in the future for a Pulse Input.

Power for the 18x comes from the 12 volt distribution system for the computer infrastructure, protected with the recommended 1 Amp fuse. The serial connector is connected to the Raspberry Pi via an RS232 to USB converter cable.

We have plans to change how the 18x is connected to the computer infrastructure, just have not got around to doing this yet. The idea is to run 12 volts to a ATOM RS232 Voltage Converter from M5 Stack. This will allow us to send location information over wifi using MQTT, and remove all of the cabling. The only cable will be the 12 volts.

Sensor 3 : SPOT Trace

SPOT makes a variety of devices, with the Trace model intended for vehicle and asset tracking. It is subscription based service, sending location 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 or the specifications.

The SPOT trace is mounted in the ceiling void space alongside the Garmin receiver. It has a permanent power supply from the 12 volt distribution system a protected by a 1 Amp fuse, so the internal batteries do not need to be changed. The SPOT runs continuously.

Power cable for SPOT Trace.
Sensor 4 : Garmin InReach Mini

The final GPS logging device. The Garmin Inreach is similar to the SPOT trace, in that it sends location coordinates 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 or 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 Garmin Overlander navigator and the navigator can stop and start tracking feature on the Inreach.

GPS Logs

Molly has three databases to hold the GPS logs, they are

  • InfluxDB, a time-series database.
  • Traccar, open source vehicle tracking software.
  • A home grown logging system using AWS S3 file based data store, processed by lambda functions.

The first two databases are located on the computer in Molly, while the home grown AWS S3 database is in located in the cloud as part of Amazon’s AWS infrastructure.

The following table shows which sensors are connected to which databases

SensorInfluxDBTraccarAWS S3
Cradlepoint IBR900 Router
Garmin 18x Receiver
SPOT Trace
Garmin inReach Mini
Log Accuracy and Fidelity

For our purposes, we do do not need highly accurate location coordinates, or even a high sampling rate. For us, it is more important that we have a continuous series of location coordinates, with as few gaps in the entire record as possible. This way we can always determine where we were. In terms of accuracy, the GPS is typically accurate to 5 to 20 meters, which is more than good enough for us.

The logs contain location coordinates with a sampling interval that is anywhere between 10 seconds to 5 minutes. The following table shows maximum sampling rate.

SensorInfluxDBTraccarAWS S3
Cradlepoint IBR900 Router10 secs10 secs
Garmin 18x Receiver10 secs
SPOT Trace5 mins
Garmin inReach Mini2 mins

It is important to note, that only the Cradlepoint IBR900 Router and the Garmin 18x Receiver continuously log. While the SPOT Trace is continuously powered on, it will only log location coordinates when motion is detected. The Garmin inReach Mini will continuously log, but only when it is turned on and in tracking mode, which is not a normal case.

GPS Communication Protocol

The software local to Molly can receive the messages from the Cradlepoint Router and Garmin 18x devices and extract location coordinates and other GPS information. They both support the NEMA 0183 sentence format, 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. It is old, but it is good.

Cradlepoint GPS NEMA Sentences

The Cradlepoint router is quite flexible on how it can transmit the location coordinates to our computers, via a tcp connection. We use NEMA 0183 GPS sentences. Cradlepoint has made a few vendor specific extensions, like the addition of a station identifier.

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

  • $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 being used.
  • $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.

Below is an example of the two sentences we use.

$GPGGA,214824.00,3607.223654,N,12128.322347,W,1,9,0.8,629.6,M,-29.0,M,,*54\r\n

$GPVTG,180.9,T,180.7,M,20.0,N,30.0,K,A*25\r\n
Cradlepoint MQTT

The Cradlepoint also has the ability to send mqtt message with the location information. These can be sent at a maximum rate of once per minute. And this is what we configured. The Cradlepoint record is not logged to the influxDB, and instead we use the tcp connection mentioned above

Garmin 18x Sentences

The Garmin 18x uses NEMA 0183 as well. The manual documents the protocol very well, so need to say anymore here.

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 and once the checksum of each sentence is validated, the output then placed into influxdb. 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 it 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.

Visualization Software
Traccar creates tracks from GPS waypoints.
Node-red also tracks based on the same GPS waypoints.
The node-red dashboard. Button presses changes the format of the item being displayed. Latitude can be in decimal degrees, degrees and decimal minutes or degrees minutes and seconds .
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.

Garmin vs Cradlepoint, and the number of satellites in view.
  1. In the future we will replace of Garmin Overland device with a Garmin Tread device, which has built in inReach. ↩︎