How to connect EG5120 with Edge2Cloud Pro to AWS IoT SiteWise

How to connect EG5120 with Edge2Cloud Pro to AWS IoT SiteWise

 

Overview

This guide provides a comprehensive walkthrough for establishing an industrial data pipeline using the Robustel EG5120 industrial gateway. By leveraging Edge2Cloud Pro, you will collect data from Modbus devices (such as the S6000U sensor), transmit it securely via MQTT over TLS to AWS IoT Core, and finally visualize that data using AWS IoT SiteWise and Amazon Managed Grafana.

These steps are essential for building scalable Industrial IoT (IIoT) solutions that require real-time monitoring and historical data analysis.

 

What You'll Need

Hardware:

 1 x Robustel EG5120 Industrial Gateway.

 1 x S6000U Sensor (or similar Modbus-enabled device).

 Power supply for the gateway and sensor.

 Ethernet cable with internet access.

Software/Firmware:

 RobustOS Pro firmware.

 Edge2Cloud Pro (E2C Factory App) installed on the EG5120.

 An active AWS Account with permissions for IoT Core, SiteWise, IAM, and Managed Grafana.

Prerequisites:

 Basic familiarity with the AWS Management Console.

 Gateway is powered on and connected to the internet.

 

Step-by-Step Configuration Guide

Step 1: AWS IoT Core Configuration

Before the gateway can send data, you must define it as a "Thing" in AWS.

1.  Create an IoT Thing:

 Navigate to IoT Core > Manage > All devices > Things.

 Click Create things > Create single thing.

 Name: EG5120-Gateway.

2.  Generate Certificates:

 Select Auto-generate a new certificate.

 Download the Device Certificate, Private Key, and Amazon Root CA 1.

 Activate the certificate.

3.  Create and Attach Policy:

 Go to Security > Policies > Create.

 Name it EG5120-Policy and use the following JSON to allow connections:

 { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": ["iot:Connect", "iot:Publish", "iot:Subscribe", "iot:Receive"], "Resource": "*" } ] } Attach this policy to your downloaded certificate.

4.  Retrieve Endpoint:

 In IoT Core, go to Settings and copy the Device data endpoint (e.g., xxxxx-ats.iot.us-east-1.amazonaws.com)

Step 2: Edge2Cloud Pro Configuration

Now, configure the local data collection on the EG5120.

1.  Device Access: Log into the EG5120 web interface and open the Edge2Cloud Pro app.

2.  Southbound Collection: Create a new device profile for the S6000U sensor. Define the Modbus registers for the variables you wish to collect (e.g., Temperature, Pressure).

3.  Northbound Cloud Connection: * Select AWS IoT as the cloud platform.

 Enter the Endpoint retrieved in Step 1.

 Upload the Certificate, Private Key, and Root CA.

 Set the upload topic to gateway/EG5120/data.

4.  Verify Connectivity: Ensure the status shows "Connected" and data is flowing.

Step 3: AWS IoT Rule & SiteWise Integration

To move data from the MQTT topic into SiteWise, an IoT Rule is required.

1.  Create IAM Role: Create a role named IoTRuleToSiteWiseRole with a trust policy for iot.amazonaws.com and permissions for iotsitewise:BatchPutAssetPropertyValue.

2.  Create IoT SiteWise Model:

 In SiteWise, go to Models > Create model.

 Name: IndustrialGatewayModel.

 Add Measurements: temperature (Double) and pressure (Double).

3.  Create Asset:

 Create an asset from the model named EG5120-Gateway-Asset.

 Note down the Asset ID and Property IDs from the asset details page.

4.  Create IoT Rule:

 In IoT Core > Message Routing > Rules, create a rule: Edge2Cloud_To_SiteWise.

 SQL: SELECT temperature, pressure, timestamp() as ts FROM 'gateway/EG5120/data'.

 Action: Select Send message to IoT SiteWise. Map the JSON fields to the SiteWise Asset and Property IDs recorded earlier.

Step 4: Visualization with Amazon Managed Grafana

1.  Setup Workspace: Create an Amazon Managed Grafana workspace. Ensure IAM Identity Center is enabled for authentication.

2.  Permissioning: Grant your user the Admin role within the Grafana workspace settings and ensure the workspace has the AWSIoTSiteWiseReadOnlyAccess policy.

3.  Configure Data Source:

 Log into Grafana, go to Connections > Data sources.

 Add AWS IoT SiteWise. Select your region and use Workspace IAM Role.

4.  Build Dashboard: Add a new panel, select the SiteWise data source, and choose your EG5120-Gateway-Asset to visualize the temperature and pressure trends.

 

Verification & Testing

 MQTT Test: Use the MQTT Test Client in AWS IoT Core to subscribe to gateway/EG5120/data and verify the JSON payload is arriving.

 Grafana Refresh: Set your Grafana dashboard to refresh every 5 seconds to observe real-time industrial data.

 

Troubleshooting / FAQ

 Q: Data is appearing in IoT Core but not in SiteWise.

 A: Verify the IAM Role attached to the IoT Rule. Ensure it has iotsitewise:BatchPutAssetPropertyValue permissions and that the Asset/Property IDs in the rule match your SiteWise setup exactly.

 Q: Grafana cannot find the SiteWise Data Source.

 A: Ensure you have assigned your IAM Identity Center user to the Grafana workspace and that the "Admin" role is explicitly granted.

 Q: Edge2Cloud Pro shows "Disconnected".

 A: Check the gateway's internet connection and verify that the AWS Endpoint and Certificates are correctly uploaded without extra spaces or formatting errors.

 

Revision History

Revision

Date

Author

Notes

v.1.0

2025/10/17

Anson Feng

Initial Release


 

    • Related Articles

    • How to deploy AWS IoT SiteWise Edge on EG5120

      Overview The EG5120 is a high-performance industrial edge gateway based on ARM Debian 11 (Bullseye) 64-bit OS. This guide provides a step-by-step procedure to deploy AWS IoT SiteWise Edge on the device. By utilizing the open Debian ecosystem and ...
    • Edge Gateway Main Page

      Edge Gateway Configuration & Development Your central hub for mastering Robustel Edge Gateways, tailored for developers and system integrators. From basic device configuration to advanced application development and third-party integration, find the ...
    • RobustOS Pro SDK

      Robustel's router allows 3rd party to develop their applications. We provide a Software Development Kit (SDK), which offers a simple and fast way to implement customer-specific functions and applications. This SDK is compatible with EG5100, LG5100, ...
    • How to Integrate WhatsApp Alarm Systems on RobustOS Pro Gateways

      In today's interconnected industrial environments, timely notifications about critical events can prevent costly downtime and rapid response to potential issues. As a leading provider of industrial IoT solutions, Robustel continues to innovate with ...
    • How to Configure APN on RobustOS Pro Gateways (EV8100, EG5100 Series, R1520LG, LG5100, EG5200, MG460)

      Overview This guide provides step-by-step instructions for configuring a custom Access Point Name (APN) on Robustel gateways running the RobustOS Pro system, including models such as EV8100, EG51xx series, R1520LG, LG5100, EG5200, and MG460. It ...