The Internet of Things on AWS – Official Blog

Patterns for building IoT based asset tracking solutions with AWS IoT Core Device Location

Introduction

Businesses are recognizing the potential of location based systems, which gives them the ability to track and manage their assets, improving operations. By having a robust asset tracking system in place, organizations gain the capability to capture real-time insights and make informed business decisions. Some common Internet of Things (IoT) use cases for AWS IoT Core Device location includes:

  • Locate and monitor livestock remotely
  • Geofencing for vehicle
  • Tracking high-value equipment
  • Monitoring assets as they move through a supply chain
  • Reducing loss and theft

Traditionally, Global Positioning System (GPS) hardware is primarily used for location tracking use cases. GPS is a satellite-based navigation system which provides time and location-based information to a GPS receiver, located on the Earth. Once the GPS receiver has an unobstructed line of sight communication with 4 or more GPS satellites, it calculates its distance from the satellites, and figures out the location.

GPS is more applicable for outdoors since positioning is less accurate within indoors environments, and requires more space and power as it detects the location locally. All these points makes it a less preferred option for constrained devices and certain cases, such as indoor or underground location tracking . Therefore, new geolocation technologies, such as cloud-assisted Global Navigation Satellite System (GNSS), Wi-Fi, IP reverse look up, and cellular network have become popular alternatives to obtain location data for power constrained IoT devices.

In this blog post, you will learn about the different patterns for building IoT based asset tracking solutions with AWS IoT Core Device Location feature. These patterns makes it possible for customers to track and manage IoT devices using geolocation technologies mentioned above, without relying on a GPS hardware.

Solution Overview

To address the problem of secure connectivity and transmitting messages to and from IoT devices and applications, AWS customers are already leveraging AWS IoT Core which can support billions of devices and trillions of messages.

However retrieving the location of devices using technologies like cloud-assisted GNSS, Wi-Fi, IP reverse look up, and cellular network requires writing custom code to integrate with third party services. This integration becomes even more complex when you plan to use multiple geolocation technologies where you also need to choose the location with the highest accuracy. To address these challenges and simplify the integration, you can leverage AWS IoT Core Device Location.

AWS IoT Core Device Location is integrated with solutions offered by AWS Partners, such as Semtech, HERE, and MaxMind, enabling you to use cloud-assisted GNSS, WiFi scan, cellular triangulation, and reverse IP lookup techniques to determine geo-coordinates for your device. When multiple geolocation technologies are used, it compares the results and  returns the geolocation results with the highest accuracy.

How AWS IoT Core Device Location resolves location

AWS IoT Core Device Location uses algorithms that implements geolocation technologies to resolve the location of your IoT devices connected over the internet. These algorithms are called as Location Solvers. At the time of publishing the blog, AWS IoT Core Device Location supports the location solvers based on following geolocation technologies:

  • Cloud-assisted Global Navigation Satellite System (GNSS): GNSS works on the concept of Global Navigation Satellite System (GNSS) technology where a constellation of satellites provides signals from space that transmit positioning and timing data which is used to accurately determine your location on Earth.

Traditional GNSS IoT positioning solutions compute the location on the sensor itself which requires a certain amount of computational resources and thus consumes a certain amount of power. To mitigate this challenge, cloud-assisted GNSS migrate computational tasks typically carried out on-chip to a cloud server, lowering energy consumption and hence enhancing the sensor’s battery lifetime without compromising the performance.

In order to use GNSS solver as geolocation technology, you can use any IoT device which supports location estimation using GNSS or integrates with module having GNSS engine like Teseo-LIV3 module. Based on the module, you can fetch the required metrics, like navigation data frame and, pass it to GNSS solver to get the location details. Overall Cloud-assisted GNSS  is suitable for outdoor location and performs with great accuracy for asset tracking use cases.

  • Cellular triangulation: A technology where any IoT device with cellular connection use signals from three or more cell towers, helping in estimating the location of the IoT device based on its distance from three or more towers.

In order to use cellular triangulation as a geolocation technology, you can use any IoT device with cellular connection without worrying about any additional hardware. If the IoT device doesn’t support cellular connection, a cellular modem like LTE Standard EC20 R2.1 can be used. These cellular modems comes with AT command set to retrieve the required fields like Mobile Country Code (MCC), Mobile Network Code (MNC) which needs to be passed to cellular-based solver.

  • Wi-Fi positioning system (WPS): WPS is a geolocation method where any Wi-Fi-enabled sensors/devices can scan information from nearby Wi-Fi access points to resolve the location of the device. The devices are not required to be connected to Wi-Fi networks, but they need to define availability and be able to measure signal intensity. The Wi-Fi hotspot database gets filled by correlating mobile device location data with Wi-Fi hotspot MAC addresses. The average accuracy of WPS could vary between 10m – 100m and is suitable for indoor tracking.

In order to use Wi-Fi positioning system as a geolocation technology, you can use any Wi-Fi-enabled sensors/devices without any additional hardware requirements. If the IoT device doesn’t support cellular connection, a RF Module like Telit WE310F5 can be used. Each RF Module comes with an AT command set to scan access points which needs to be passed to Wi-Fi based solver.

  • Reverse IP lookup: Also known as IP geolocation technology, it resolve the IP address to the geographic location in an IP-based Geolocation database.

You can use the IP reverse lookup solver to resolve the location using the IP address as input using a format that’s either the IPv4 or IPv6 standard pattern, or the IPv6 hex compressed pattern. You then obtain the resolved location estimate, including additional information, such as city and country where the device is located.

Since  IoT devices will be deployed under a network, it will have an IP address using a solver that can obtain location information. Please note that Reverse IP lookup does not provide accurate information and hence you shouldn’t consider it for the purpose of identifying or locating a specific household or street address. 

The above understanding of various geolocation technologies enables you to choose the technology within your business and engineering constraints. Once the geolocation technology is decided, you can start planning how to integrate it with you IoT Device. Next, I will explain 2 different architectural patterns that can be followed to build an asset tracking system based on the protocol supported by device :

Pattern 1: AWS IoT Core for LoRaWAN + AWS IoT Core Device Location

Architecture diagram showing how to resolve device location using AWS IoT Core for LoRAWAN and AWS IoT Core Device Location

AWS IoT Core for LoRaWAN enables you to activate positioning to identify location of your LoRaWAN device using third-party Wi-Fi and GNSS solvers in seamless way. This means you don’t have to write any additional layer of code to retrieve and route geolocation data from third party resolver. At the time of publishing the blog, this integration with third-party solvers works only with LoRaWAN devices that have the LoRa Edge chip. The following steps show you how to implement asset tracking solution for LoRaWAN devices:

  1. While adding the LoRaWAN device to AWS IoT Core for LoRaWAN, activate positioning and add geolocation FPort through which device can communicate with GNSS and WiFi Scan data. When your LoRaWAN device sends an uplink message, the Wi-Fi and GNSS scan data contained in the message is sent to AWS IoT Core for LoRaWAN using the geolocation frame port.
  2. AWS IoT Core for LoRaWAN retrieves the estimated device position from the solvers computed based on the scan results from the transceivers. If the position information was computed using both Wi-Fi and GNSS scan results, AWS IoT Core for LoRaWAN selects the estimated position that has the higher accuracy.
  3. An IoT Rule is triggered upon the incoming geolocation data from the resolver which triggers Location Action to route the Geo-coordinates to Amazon Location Service where you can add maps and points of interest, track resources, define geo-fencing models, and visualize device location information.

To learn more about how to create geolocation solution for LoRAWAN devices with Amazon Location service, check out Introducing the new AWS IoT Core Device Location feature to support Asset Tracking solutions blog post.

Pattern 2: AWS IoT Core + AWS IoT Core Device Location

Architecture diagram showing how to resolve device location using AWS IoT Core and AWS IoT Core Device Location

For this pattern to work, your device should have interfaces which returns certain measurement data to identify geolocation. These measurement data could be MAC Address, GNSS scan information, cellular measurement data and IP address.

To get familiar with the pattern, it is important to understand GetPositionEstimate API. As part of AWS IoT Wireless API,  GetPositionEstimate API action accepts one or more measurement data from the list mentioned above as an input. This input is passed to AWS IoT Core Device Location, which eventually chooses the solver with the highest accuracy to report the device location. Once the location is resolved, it returns the estimated position information in GeoJSON format.

In this pattern, you will learn how to implement asset tracking solution for devices that are securely connected with AWS IoT Core and communicate using protocols like MQTT, HTTP, and WebSocket. For these protocols, AWS IoT Core only supports third party integration with AWS IoT Core Device Location where to identify the location of device you are required to build a lambda Function. This Lambda function transform the payload in the format which is accepted by GetPositionEstimate API and eventually acts on the geo-location data.

The following steps will show you how to implement asset tracking solution for devices using AWS IoT Core specifically using protocols like MQTT, HTTP, and WebSocket:

  1. The device publishes the payload measurement data containing one or more of MAC address, IP address, GNSS scan data, and cellular-based measurement data to AWS IoT Core service via a topic.
  2. The AWS IoT Core rules engine retrieves the payload data from the topic and sends it to a Lambda function to resolve the geolocation.
  3. The Lambda function retrieves the payload, transforms it and calls GetPositionEstimate API to retrieve an estimated device position. Once the location is retrieved in GeoJSON format, Lambda function publishes it to another topic.
  4. An IoT Rule is triggered upon the incoming geolocation data from the Lambda function, which triggers Location Action to route the geo-coordinates to Amazon Location Service where you can add maps and points of interest, track resources, define Geo-fencing models, and visualize device location information.

If you like to try the pattern described above, please check out How to get started with the new AWS IoT Core Device Location service  blog post.

Conclusion

In this post, you learned how to use AWS IoT Core Device Location, and the underlying geolocation technologies supported by it. You also learned different patterns for building an asset tracking solution with AWS IoT Core. By using diferent geolocation technologies it is possible to overcome business and engineering constraints, without relying on GPS hardware.

About the author

Vishal Gupta

Vishal Gupta is a Senior Solutions Architect at AWS India. Vishal works with AWS Digital Native Business (DNB) customers and is passionate about helping customers to transform their business through strategic technology adoption. Outside work, he enjoys traveling to new destinations and spending time with his family.