Taxonomy Icon

IoT

Tracking assets and visualizing sensor data from a long-range IoT system that uses LoRaWAN networking

Get the code

Summary

In this code pattern, we’ll demonstrate how to track assets and visualize incoming sensor data from the Watson IoT Platform on a mapping application using Leaflet and ArcGIS.

Description

By completing this code pattern, you’ll learn how to track moving assets. A moving asset is any IoT device that can have a GPS module attached to it, such as a shipping truck (or the contents in the shipping truck) or even a wild animal that has been tagged. You’ll also learn how to visualize sensor data associated with various connected IoT devices. This sensor data can represent any measurable physical property, such as temperature, sound, air quality, or humidity.

This pattern assumes that you’ve set up the hardware to collect sensor data, similar to this code pattern, “Setting up the hardware platform for long-range IoT systems that use LoRaWAN networking.”

When you have completed this pattern, you’ll understand how to:

  • Publish sensor and location data to the Watson IoT Platform
  • Import historical CSV datasets for visualization
  • Persist data in a Cloudant database
  • View the status of IoT assets on a map

Flow

flow

  1. User registers end nodes (IoT devices) by using the mapping UI or an MQTT message. These end nodes represent trackable assets that are capable of publishing location and sensor data.
  2. Express back end subscribes to Watson IoT Platform channel corresponding to one or more end nodes.
  3. The end nodes continuously publish JSON objects that contain location, time, and sensor data to Watson IoT Platform.
  4. Watson IoT Platform persists the data to the Cloudant DB.
  5. Using Leaflet, the mapping UI updates the marker location on map.

Instructions

Please see detailed instructions in the README.