AWS Logo
Menu
How I built a satellite-based tracking app for the Tour du Mont Blanc

How I built a satellite-based tracking app for the Tour du Mont Blanc

In this post I explore how a commercially available, off-the-shelf satellite communication device can be integrated with AWS services to create your very own serverless cloud-based tracking application!

Alan Peaty (AWS)
Amazon Employee
Published Sep 16, 2024
I have a personal passion for all things outdoors... and gadgetry. So I rarely skip the opportunity to combine the two hobbies whenever they arise.
This is a short, informal blog post on how I used a commercially available GPS device, alongside several cloud services from AWS, to help me stay safe during a recent adventure.

Tour du Mont Blanc (TMB)

This September, my friend and I decided to walk the Tour du Mont Blanc (TMB) in 8 days. For those unfamiliar with this famous European long-distance hiking trail, it is a 160km+ circular route that passes through the mountainous regions of Switzerland, France and Italy. And with over 10,000m of total ascent, it is almost as exhausting as passing every single one of the AWS Certification exams.
Since our preference has always been to camp overnight, I completed the walk with a bulky 15kg rucksack full of camping gear, clothes, water, food and - of course - the gadgets.
And one such gadget I brought along me was the Garmin inReach Mini 2.

Garmin inReach Mini 2

The inReach Mini 2 is an off-the-shelf satellite communication device manufactured by Garmin which provides two-way communication using the Iridium satellite constellation. At the time of writing, an inReach Professional subscription can be used to register and manage multiple devices which also provides you with access to the Garmin IPC developer interfaces.
In short, if I want my family to keep track of my location across remote terrain at 10-minute intervals using my very own (custom) app, the combination of both the inReach Mini 2 and AWS provides the perfect ingredients to make this a reality.
And as a Solutions Architect at AWS, this was an opportunity I simply didn't want to miss.
This photo shows a Garmin inReach Mini 2 device attached to my rucksack strap.
My Garmin inReach Mini 2 during testing in the Scottish Highlands
Note: For the remainder of this blog post, I will be focusing on the inReach Mini 2's tracking capabilities. Device offers other features such as 2-way messaging, navigation, weather forecasting and SOS alerts. Moreover, if you don't have a reason to build your very own tracking app, Garmin's out-of-the-box MapShare functionality allows your contacts to track your progress using a password-protected webpage.

Solution overview

So how did I go about building this solution? Here is what the final architecture looks like.
An AWS architecture diagram showing the AWS services used by the solution.
Architecture diagram

AWS services used

  • Amazon API Gateway - Provides a fully managed API management service that allows you to create, publish, maintain, monitor, and secure APIs. In this solution, API Gateway is used to provide the single point of interaction for Garmin's IPC Outbound interface and the front-end single page application (SPA).
  • Amazon Cognito - Handles user authentication and authorisation for your web and mobile apps. In this solution, through its integration with API Gateway, Cognito is used to authenticate both a) front-end users of the SPA, and b) back-end API access by the Garmin IPC Outbound interface using the OAuth2 protocol.
  • AWS Lambda - Provides a serverless compute service which executes your code in response to events. The solution uses a Lambda function to run code that forwards incoming data to other AWS services, namely AWS IoT Events and Timestream.
  • Amazon Location Service - Adds location functionality, such as maps, points of interest, geocoding, routing, tracking, and geofencing, to your applications. In this solution, Location Service is simply used to deliver map tiles to the front-end SPA.
  • AWS IoT Events - Helps monitor your equipment or device fleet for failures or changes in operation and starts necessary actions. In this solution, AWS IoT Events is used to track responsiveness and battery level of the device and is configured to notify a user of significant status changes by email.
  • Amazon Timestream - Provides a fully managed, purpose-built time-series database engine. In this solution, Timestream is used to store incoming data from the devices alongside timestamps.
  • AWS Amplify - Provides front-end libraries, UI components, and back-end building for fullstack applications on AWS. In this solution, Amplify is used to host the front-end SPA.
Using an AWS Serverless Application Model (SAM) template, this solution can be deployed in around 5 minutes.

How the solution works

  1. The InReach Mini 2 device communicates with the satellite constellation and exchanges information. Out-of-the-box functionality is unaffected by this solution as no configuration changes are required on the device itself, other than enabling the tracking to take place at 10-minute intervals at the start of each day.
  2. In order to authenticate with API Gateway, Cognito's OAuth2 token endpoint is used by the Garmin Gateway IPC Outbound service to receive an access token. The client credentials grant type is used to retrieve an access token using a pre-generated client ID and secret. Cognito OAuth2 token endpoint details, client ID and secret, and API Gateway URL are all configured under the Outbound Settings of Garmin Explore's inReach Portal Connect configuration to complete this integration.
    Screenshot of the Garmin Explore settings screen showing the IPC Outbound configuration.
    Enabling the Garmin IPC Outbound settings in Garmin Explore
  3. At regular intervals, the Garmin Gateway IPC Outbound service submits the latest tracking information to the API Gateway endpoint using an HTTP POST request. As well as WGS84 coordinates, the payload contains additional information such as altitude, course, speed, GPS fix status and battery warning. The unique imei key/value identifies the device.
  4. Through a Lambda proxy function integrated with the API Gateway REST API, the data contained in the POST request is retrieved and committed to a Timestream table.
    Screenshot shows API Gateway GET, POST and OPTIONS methods configured.
    Configuring API Gateway GET, POST and OPTIONS methods
  5. Afterwards, the Lambda proxy function enters the data as an input into an AWS IoT Events detector model as a heart-beat. In this way, the detector model is able to conclude that the device is unresponsive if payloads have not been received for a particular device in the past hour. Another detector model will monitor the battery status (lowBattery key/value).
    Screenshot shows AWS IoT Events detector model with status changes between states.
    Configuring an AWS IoT Events detector model for responsiveness
  6. When authenticated users of the Vue.js 3 front-end single page application (SPA) request tracker details, these are returned as JSON payload by the API Gateway's HTTP GET method.
  7. When receiving an HTTP GET request, tracker details are returned from the Timestream table by the Lambda proxy function.
  8. To provide visitors an interactive map populated by tracker details, Location Service's Maps API is used. Tracker location markers and routes are placed across the map tiles using the maplibre-gl-js-amplify and maplibre-gl JavaScript libraries. In this example, I have used HERE as the data provider.
    Screenshot of the Amazon Location Service showing HERE as the data provider.
    Configuring HERE as the data provider for map tiles
  9. In the event that there has been no data received from the Garmin IPC Outbound service, the AWS IoT Events detector model changes the state of the device to Unresponsive and sends out a notification to an email address via an Amazon Simple Notification Service (SNS) topic. Similarly, if the battery level is low, the state of the device is changed to LowBattery and a notification is sent.
    Screenshot shows an email notifying user of an unresponsive device.
    Viewing an unresponsive device email
Note: Further details on the Garmin IPC Outbound data push service is documented in the Developer Guide for IPC Outbound provided by Garmin. If you prefer a pull-based approach, the Garmin IPC Inbound API could alternatively be used.

Walkthrough

So how did the solution fare the literal walk through a small number of countries, and over countless mountain passes?

West Highland Way

Back in September 2023, we completed the West Highland Way, a 154km long-distance hiking route through the Scottish Highlands, in 5 days. This gave me an early opportunity to test the concept in the wilderness.
While blisters and infamous midges tried their best to spoil my trip, I survived the journey with my inReach Mini 2 and tracking data intact.
Photo shows a valley of the West Highland Way.
A quiet valley along the West Highland Way
Here is how my family tracked my progress using my very own front-end SPA hosted on Amplify.
A screenshot of a browser showing the positions recorded along the West Highland Way.
Viewing the tracker data along the West Highland Way
A screenshot of a browser showing the positions recorded along the West Highland Way.
Viewing the tracker data along the section between Kinlochleven and Fort William (WHW)

TMB

As for the TMB, the entire trip (including variants and itinerary modifications) was reliably recorded using the same solution.
A screenshot of a browser showing the positions recorded along the TMB.
Viewing the tracker data along the TMB
A screenshot of a browser showing the positions recorded along the TMB.
Viewing the tracker data along the crossing of the Fenêtre d'Arpette (TMB)
...And if you were in any doubt, please ensure that you invest in appropriate clothing and hiking gear to enjoy the outdoors safely! While the AWS golden jacket scores exceptionally high on the visibility scale, I decided to sensibly rely on my tried-and-tested kit for what transpired to be 50+ hours of walking across the breathtaking (but unpredictable) Alpine landscape.
A photo of the Mont Blanc mountain range behind me.
Mont Blanc mountain range making an appearance on day 8 of the TMB

Real life use cases

Beyond use in a hobbyist's project, when might integration like this be useful?
Organisations around the world frequently work in remote environments, or locations impacted by natural disasters where immediate connectivity to land-based telecommunication infrastructure is not possible. Under these challenging conditions, it is vital that they can accurately geolocate their staff to drive deployment decisions, and to safeguard their well-being.
For example, an outdoor competition organiser may want to track the progress of participants across a mix of land and maritime routes to ensure their safety, while an international relief organisation involved in rescue efforts after a catastrophic event may want to make time-critical resourcing decisions based on the teams' current positions.
In other words, by relying on a constellation of satellites, we remove the critical dependency on any ground-based infrastructure, such as cellular or low-power wide-area networks, that might not be reliably accessible. And developing your very own cloud-based app to surface this data alongside other organisational data about your personnel and assets makes the experience more personalised, and the findings more actionable... all while safeguarding the resiliency and security of your business logic and data in the cloud.
Furthermore, with immediate access to your data inside your AWS environment, you can enrich it and start to employ techniques such as machine learning to uncover new insights, such as predicting when someone might be expected at a certain waypoint, or simulating much broader mission outcomes.

Conclusion

In this post I demonstrated how a commercially available, off-the-shelf satellite communication device (such as the Garmin inReach Mini 2) can be securely integrated with AWS services using the industry-standard OAuth2 protocol. This allowed me to create my very own serverless cloud-based tracking app which I then used during my recent adventures.
Thank you for reading this blog post. Let me know your thoughts and ask any questions about the solution using the comments below.
I'm also more than happy to answer questions about our trip itinerary and wider kit list!
An assortment of photos showing various stages of the TMB.
Varying terrain and conditions found along the TMB

 

Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.

Comments