AWS AWS IoT Core Integration

Connect your LINK485 Modbus devices to AWS IoT Core for enterprise-scale cloud analytics

⏱️ Setup Time: 25-30 minutes | 📚 Prerequisites: AWS Account, LINK485 gateway configured | 🔒 Security: TLS 1.2+ with X.509 certificates

Overview

AWS IoT Core is a managed cloud platform that lets connected devices interact with cloud applications and other devices. This guide shows how to connect LINK485 devices to AWS IoT Core using MQTT over TLS, enabling you to leverage AWS services like Lambda, S3, Timestream, and QuickSight for industrial IoT analytics.

Architecture

LINK485 Gateway
Modbus Devices
AWS IoT Core
MQTT/TLS
AWS Services
S3, Lambda, Timestream

LINK485 publishes Modbus data to AWS IoT Core via secure MQTT. IoT Rules can then route data to various AWS services for storage, processing, and visualization.

Prerequisites

  • AWS Account: With IoT Core enabled in your preferred region
  • LINK485 Gateway: Firmware v2.0+ with MQTT support
  • Network Access: Outbound HTTPS (443) and MQTTS (8883) allowed
  • AWS CLI: Optional, but helpful for automation

Step 1: Create IoT Thing in AWS Console

  1. Log in to AWS Console and navigate to AWS IoT Core
  2. Create a Thing:
    • Go to Manage → Things → Create things
    • Select "Create single thing"
    • Name it (e.g., link485-gateway-001)
    • Click "Next"
  3. Generate Certificates:
    • Select "Auto-generate a new certificate"
    • Click "Next"
  4. Download Certificates: You'll need these files:
    • Device certificate (xxx-certificate.pem.crt)
    • Private key (xxx-private.pem.key)
    • Amazon Root CA 1 (click download link)
  5. Create Policy: Go to Secure → Policies → Create policy
    • Name: link485-policy
    • Add these statements:
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "iot:Connect",
      "Resource": "arn:aws:iot:REGION:ACCOUNT:client/link485-*"
    },
    {
      "Effect": "Allow",
      "Action": "iot:Publish",
      "Resource": "arn:aws:iot:REGION:ACCOUNT:topic/link485/*"
    },
    {
      "Effect": "Allow",
      "Action": "iot:Subscribe",
      "Resource": "arn:aws:iot:REGION:ACCOUNT:topicfilter/link485/*"
    },
    {
      "Effect": "Allow",
      "Action": "iot:Receive",
      "Resource": "arn:aws:iot:REGION:ACCOUNT:topic/link485/*"
    }
  ]
}

Attach Policy to Certificate: Go back to Secure → Certificates → Select your certificate → Attach policy

Step 2: Get Your AWS IoT Endpoint

In AWS IoT Core console, go to Settings and copy your Device data endpoint.

Example: a3qexampleepfg-ats.iot.us-east-1.amazonaws.com

Step 3: Configure LINK485 Device via Mobile App

For Link485 Air (WiFi)

  1. Power on your Link485 Air device
  2. Download Link485 App:
  3. Open App and Add Device: Tap "Add New Device"
  4. Enter WiFi Credentials:
    • SSID: Your WiFi network name
    • Password: Your WiFi password
  5. Choose Integration Type: Select "AWS IoT Core" from dropdown
  6. Enter AWS IoT Details:
    • AWS IoT Endpoint: Paste your endpoint from Step 2
    • Thing Name: link485-gateway-001
    • Device Certificate: Copy/paste the certificate content
    • Private Key: Copy/paste the private key content
    • Root CA: Amazon Root CA 1 (auto-selected)
  7. Tap "Connect" - Device will configure and connect automatically

For Link485 4G (Cellular)

  1. Power on your Link485 4G device with SIM card inserted
  2. Download Link485 App (same as above)
  3. Optional: Enter WiFi credentials if you want WiFi as backup connectivity
  4. Choose Integration Type: Select "AWS IoT Core"
  5. Enter AWS IoT Details (same as above)
  6. Tap "Connect" - Device uses 4G for primary connection

💡 Pro Tip: The mobile app simplifies setup - you don't need to manually configure MQTT topics or ports. Everything is handled automatically based on your integration selection.

Understanding Data Flow & Topics

1. Data FROM Device (Telemetry)

Device publishes Modbus data to:

{server_url}/{app_name}/telemetry

Your server/application should subscribe to:

aws iot-data subscribe --topic "link485/data/#" --region us-east-1

2. Commands TO Device

Device subscribes to commands at:

{server_url}/{device_mac}/commands

Your server/application should publish commands to:

aws iot-data publish \
  --topic "link485/AA:BB:CC:DD:EE:FF/commands" \
  --payload '{"command":"read_registers"}' \
  --region us-east-1

📝 Note: Replace {device_mac} with your device's MAC address (shown in the mobile app). The {app_name} is configured during device setup.

Step 4: Test Connection

  1. Open AWS IoT Test Client: In AWS IoT Core, go to Test → MQTT test client
  2. Subscribe to Topic: Enter link485/data/# (# is wildcard for all devices)
  3. Click "Subscribe"
  4. Verify Data: You should see messages arriving every few seconds with Modbus data

Example Message:

{
  "device_id": "link485-gateway-001",
  "timestamp": "2025-10-29T10:45:23Z",
  "slaves": [
    {
      "slave_id": 1,
      "name": "Energy Meter 1",
      "registers": {
        "voltage": 230.5,
        "current": 12.3,
        "power": 2835.15,
        "energy": 1234.56
      }
    }
  ]
}

Step 5: Create IoT Rules for Data Processing

Use AWS IoT Rules to route data to various AWS services:

Rule 1: Store Raw Data in S3

Archive all incoming data for compliance and long-term analysis:

SQL:
SELECT * FROM 'link485/data/#'

Action: S3 bucket (s3://link485-raw-data/)

Rule 2: Process with Lambda

Trigger Lambda for real-time processing, alerts, or calculations:

SQL:
SELECT * FROM 'link485/data/#' WHERE slaves[0].registers.power > 5000

Action: Lambda function (e.g., SendAlertFunction)

Rule 3: Store in Timestream

Store time-series data in AWS Timestream for fast queries:

SQL:
SELECT device_id, timestamp, slaves[0].registers.* FROM 'link485/data/#'

Action: Timestream database

Data Format Reference

LINK485 publishes JSON messages with the following structure:

Field Type Description
device_id string Unique gateway identifier
timestamp ISO8601 UTC timestamp of reading
slaves array Array of Modbus slave devices
slaves[].slave_id integer Modbus slave address (1-247)
slaves[].name string Human-readable device name
slaves[].registers object Key-value pairs of register data

Troubleshooting

❌ Connection Refused

  • Verify endpoint URL is correct (check for typos)
  • Ensure port 8883 is not blocked by firewall
  • Check that Client ID matches Thing name in AWS

❌ TLS Handshake Failed

  • Verify you uploaded the correct certificate files
  • Ensure the certificate is activated in AWS IoT Console
  • Check that Root CA certificate is Amazon Root CA 1

❌ Not Authorized to Publish

  • Check that policy is attached to certificate
  • Verify policy allows publish to the topic you're using
  • Ensure ARN in policy matches your region and account

❌ No Data Appearing in Test Client

  • Check LINK485 gateway shows "Connected" status
  • Verify Modbus slaves are configured and responding
  • Ensure subscription topic includes wildcard (#) correctly

Next Steps & Advanced Use Cases

📊 Visualize with QuickSight

Connect Timestream data to AWS QuickSight for business intelligence dashboards and reports

🤖 Machine Learning

Use SageMaker for predictive maintenance and anomaly detection on your industrial data

🔔 SNS Alerts

Route alerts from Lambda to SNS for email, SMS, or mobile push notifications

🔄 Device Shadow

Use AWS IoT Device Shadow for bidirectional communication and remote configuration

Need Help with AWS Integration?

Our team can help you design and implement custom AWS IoT solutions for your industrial IoT applications

Get Support Contact Sales

More Integration Guides

Node-RED Integration Grafana & InfluxDB All Guides