Messages

The Things Enterprise Stack publishes uplink messages to AWS IoT Core MQTT. An IoT Core rule triggers a Lambda function which processes the message, creates a new IoT Core thing if it doesn’t exist, and updates the shadow state with metrics. Device activations and uplink messages get republished so your application can act on them.

Your application can schedule downlink messages by publishing a JSON object to an AWS IoT Core MQTT topic. An IoT Core rule triggers a Lambda function which performs an API call to The Things Enterprise Stack to enqueue the downlink message.

See Architecture for the flow.

The AWS IoT Integration for The Things Enterprise Stack uses the following topics for upstream traffic:

  • Activations: lorawan/<thing>/join
  • Uplink: lorawan/<thing>/uplink

See Manage Things to learn about the thing names.

Use Rules for AWS IoT to act on these messages for storage, analytics, alarms and API calls.

This guide uses AWS IoT Core MQTT client for demonstration purposes only.

In the AWS Console, open Services and go to IoT Core.

In the menu on the left, click Test. This opens the MQTT client.

Subscribe Uplink

In Subscription topic, enter lorawan/# to subscribe to all events from all LoRaWAN things in your account.

Click Subscribe to topic.

Uplink Message

The AWS IoT Integration for The Things Enterprise Stack uses the following topic for downstream traffic:

  • lorawan/downlink

Publish downlink messages from your application to IoT Core using AWS IoT Data Plane using the Publish action.

This guide uses AWS IoT Core MQTT client for demonstration purposes only.

Still in the AWS IoT MQTT client, enter the downlink topic lorawan/downlink.

The message is a JSON object with the following format:

{
  "thingName": "<stack>_<device-id>",

  "bytes": "AQ==", // Base64 encoded FRMPayload
  // or
  "payload": {     // JSON encoded payload (requires payload encoder)
    "field1": 42
  },

  // Optional fields
  "fPort": 10,         // FPort (default: 1)
  "confirmed": true,   // Confirmed data downlink (default: false)
  "highPriority": true // High priority (default: false)
}

See Manage Things to find the thingName for the end device.