How to integrate TagoIO with AWS IoT Core

How to integrate TagoIO with AWS IoT Core

This tutorial provides a step-by-step guide to integrate AWS IoT (Network Server) with the TagoIO Platform. By following these instructions, you will enable uplink and downlink operations, allowing data exchange between your LoRaWAN devices and the TagoIO application.

Prerequisites

Before proceeding with the integration, ensure you have the following:
  • TagoIO Account: An active TagoIO account. If you don't have one, sign up here.
  • AWS Account: An active AWS account with access to AWS IoT Core.
  • LoRaWAN Device: A LoRaWAN-compatible device ready for integration.
  • Internet Connectivity: Ensure your device and gateway are connected to the internet.
  • Region Information: Determine your deployment region (e.g., us-e1, eu-w1). Refer to the TagoIO Network Integration Regions for available regions.

Alert
Official Downlink support from TagoIO SDK is not included for this integration. You are going to need to use TagoIO Analysis to manually perform endpoint request to AWS.

Step 1: Create Authorization in TagoIO

  1. Access Authorizations:
    1. Go to Devices.
    2. Click on Authorizations at the top of the page.
  2. Create a New Authorization:
    1. Click the Create Authorization button.
    2. Provide a meaningful name for the authorization (e.g., AWS-Integration).
    3. Click Save.
  3. Copy the Authorization Token:
    1. After creation, copy the authorization token. You will need this in later steps.
NotesNote : you need to create only one Authorization for all your devices.


Step 2: Set Up Integration in AWS Console

Set up AWS IoT Core to forward data from your LoRaWAN devices to TagoIO.

  1. Access AWS IoT Core:
    1. Log in to your AWS Management Console.
    2. Navigate to AWS IoT Core under the Services menu.
  2. Create a New Rule:
    1. In the AWS IoT Core dashboard, select Act from the sidebar.
    2. Click on Create to initiate a new rule.
  3. Define Rule Details:
    1. Name: Enter a descriptive name for the rule (e.g., TagoIOIntegrationRule).
    2. Description: Provide a brief description.
  4. Set Rule Query Statement:
    1. In the Rule query statement section, define the SQL-like statement to filter incoming MQTT messages.
      SELECT * FROM 'device/+/data'
    2. Explanation: This statement forwards all messages from topics matching device/{assetID}/data.
    3. Reference: For advanced filtering, consult the AWS IoT Rule SQL Reference.
  5. Add Action to Forward Data:
    1. In the Set one or more actions section, click Add Action.
    2. Select Send a message to a downstream HTTPS endpoint and click Configure action.
  6. Configure HTTPS Endpoint:
    1. Endpoint URL: Use the following format, replacing REGION with your deployment region:
      https://awsiot.middleware.REGION.tago.io/uplink
      Example:
      https://awsiot.middleware.us-e1.tago.io/uplink
    2. Confirmation URL:
      https://awsiot.middleware.REGION.tago.io/
  7. Headers:
    1. Key: authorization
    2. Value: Paste the authorization token obtained in Step 1.
      {
        "authorization": "123e4567-e89b-12d3-a456-426614174000"
      }
    3. Note: Ensure the endpoint URL matches your deployment region.
  8. Specify Endpoint Configuration Based on AWS IoT Service:
    2.1 AWS IoT LoRaWAN
    If you are using AWS IoT LoRaWAN, configure the HTTPS endpoint as follows:
    https://awsiot.middleware.REGION.tago.io/uplink

    2.2 AWS IoT Core Broker
    If you are using AWS IoT Core Broker, determine how to extract the Asset ID for each device:
    1. Option 1: Extract from Topic
      1. Topic Structure: device/{DeviceUID}/data
      2. HTTPS Endpoint:
        https://awsiot.middleware.REGION.tago.io/uplink/${topic(2)}
    2. Option 2: Extract from MQTT Client ID
      1. HTTPS Endpoint:
        https://awsiot.middleware.REGION.tago.io/uplink/${clientid()}
        Recommendation: Use this method if you're utilizing AWS IoT LoRaWAN.
  9. Finalize and Create the Rule:
    1. After configuring the HTTPS endpoint, click Create to finalize the rule.
    2. Verification: Ensure the rule status is Enabled in the AWS IoT Core dashboard.

Now you can create the rule. After creating the rule, TagoIO will authorize your downstream and you should see “Enabled” in the rule list for your rule at AWS IoT.


Step 3: AWS IoT LoraWAN Additional Steps

With your rule created at Step 2, we are assuming you’re using the endpoint for MQTT ClientID.
  • Access your Wireless Connectivity section and click on the Destinations option.
  • Click to Add a new destination.
  • Enter a Destination name and Destination description of your choice.
  • Select Enter a rule name as an option.
  • Enter the same rule name from the rule you created at step 2.
  • You can skip Rule Configuration as you already did in step 2.
  • Set the permissions or create a new service role. It will grant the permissions needed for your device to send data to TagoIO.
  • Press Add Destination and you’re done.


Step 4: Add Device in TagoIO

To integrate your device with the TagoIO Platform, follow these guidelines:
  1. Ensure Device EUI Consistency:
    1. When creating the device in TagoIO, use the exact same Device EUI that is configured in AWS IoT.
    2. The Device EUI must match exactly to establish a successful connection between AWS IoT and TagoIO.
  2. Select the Appropriate Network and Device Type:
    1. Choose the AWS IoT Network during the device setup process.
    2. Select the correct device type from the available options. If your device is not listed, you can add support through connectors.
  3. Add Device Support via Connectors (If Necessary):
    1. If your device type is not available in the default list, enhance its compatibility by utilizing connectors.
    2. For more information on available connectors and how to use them, refer to the Connector Overview.
For detailed instructions on adding devices, visit the Adding Devices page.



Finalizing Setup

  1. Power On Your Devices:
    1. Turn on your LoRaWAN device and gateway to initiate data transmission.
  2. Verify Data Reception:
    1. In TagoIO, navigate to the Device and into the Data tab to confirm that data is being received.
    2. Alternatively, use the Live Inspector within your device settings to monitor incoming data in real-time.
With data successfully flowing into TagoIO, you can start creating dashboards, add notifications, and create scripts to process your data. 

Learn how to perform downlink for LoRaWAN.