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.
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.
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)
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.
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.
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.
● 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.
● 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 |
Date |
Author |
Notes |
v.1.0 |
2025/10/17 |
Anson Feng |
Initial Release |