The Ewon Edge & Cloud solution allows users to read data from their PLC, meters, controllers,... using Siemens (S7), Allen Bradley (Ethernet/IP) and Modbus TCP protocol and forward them to Aws IoT or Azure IoT Hub cloud in MQTTS.
This article covers the configuration of the Aws IoT MQTTS connection in Ewon Cloud.
APPLICABLE PRODUCTS
Ewon Edge
Ewon Cloud
PRE-REQUISITES
Your Ewon Edge must be registered to Ewon cloud :
Your Ewon must have some tags defined :
- How to retrieve data from your Modbus PLC using Ewon Edge and Ewon Cloud.
- How to retrieve data from your Allen Bradley (or Ethernet/IP compatible) PLC using Ewon Edge and Ewon Cloud.
- How to retrieve data from your Siemens PLC using Ewon Edge and Ewon Cloud.
IN THIS ARTICLE
Configure an Aws IoT data connection
- Open the Ewon devices properties and click "Destinations"
- Click "Add Destination"
- Select "AWS IOT" as Platform.
- Now you have to enter the Endpoint, ThingName, Certificate and the Private key of your device.
We will now explain the easiest method to do and test it with Aws IoT.
- Connect your AWS IOT environment and create a new device by clicking "Connect one device"
- Below you already find the Endpoint (Here : a2epkrz323xafw-ats.iot.us-east-1.amazonaws.com ):
- Click "Next" and enter the "Thing name"
- Select "Linux/mac OS" and "Node js" for the SDK settings and click "Next"
- Download the "connection kit". This one is a zip files that contains, amongst other files, your device certificate and key : <Thingname>.cert.pem is your certificate file and <Thingname>.private.key is your key file.
- Enter the Endpoint, Thingname, certificate and key to the Ewon Cloud menu and click "Add"
- Click
to push the configuration to your device.
- Go to "Device", select the Device that you want to link to the Data export destination that you have just created, Enable the Publishing and select your destination.
- The topic you can use depends on the Security policies associated to your device in Aws IoT. By default the topic "sdk/test/js" is always whitelisted while following this procedure.
- Select the Publishing interval in seconds and click
to push the configuration to your device.
Whitelist the Device ID (and other topics) in Aws IoT
You are almost done but one step remains to make it working. Indeed the Device ID used by the Ewon Edge is the Thing name and this one is not by default whitelisted by Aws IoT.
- For this, go to your device properties in Aws IoT and select the certificate of your device :
- Then select the Policy
- Click "Edit Active version"
- There you can select the publishing & subscription topic(s) you want to allow as well as the client ids. To make it easy, you can simply delete "sdk-nodejs-" (keep the *) from the "iot:Connect" policy and "save it as a new version"
- Then set your new version as the active one