Skip to content

A sample integration of The Things Network and Azure IoT Hubs/Central

Notifications You must be signed in to change notification settings

KiwiBryn/AzureIoTTheThingsNetworkIntegration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AzureIoTTheThingsNetworkIntegration

A The Things Network HTTP Integration for Azure IoT Hubs or Azure IoT Central instances

The repo has the source code for the series of blog posts written as I built this solution. There are also overviews of configuring the integration to work with Azure DPS + IoT Hubs and Azure IoT Central

  1. Infrastructure and payloads
  2. Basic JSON Deserialisation
  3. When Serialisation goes bad-payload_fields
  4. Out stupiding myself
  5. First TTN payload to the cloud
  6. Provisioning Devices on demand
  7. Queuing uplink messages
  8. Logging and the start of simplification
  9. Simplicating and securing the HTTP handler
  10. Assembling the components

Then depending on your target platform I have an overview of configuration required

The solution uses the Azure Device Provisioning Service(DPS) Group Enrollments with Symmetric Keys to "automagically" provision devices in Azure IoT Hus and Azure IoT Central instances.

Azure Device Provisiong Service

Azure Storage Explorer

The application has had some soak and stress testing

For more comple configuration scenarios the AzureIoTHubMessageV2Processor supports

For example, a TTN solution has two Applications one for Smart Building sensors the other for tracking maintenance staff vehicles. The smart building sensor data could be routed to an Azure IoT hub for a room utilisation system. The vehicle position information could be routed to an Azure IoT Central instance for displaying on a dashboard. In the second scenario the maintenance vehicles e.g. John Deere Gator could be reporting location with messages with the port id set to 10 and usage data from built in sensors on port 15 for use in a predictive maintenance system.

The key projects are a pair of Azure Functions.

TTNHttpIntegrationUplinkEndpoint which places uplink messages from TTN into a Azure Storage Queue and AzureIoTHubUplinkMessageProcessor which processes the queue provisioning devices and sending telemetry events.

Azure IoT Central Dashboard