As a part of the Manufacturing sector’s digitization course of, Business 4.0 automation drives real-time, knowledge acquisition from industrial tools on the plant ground. This knowledge and rapid suggestions have grow to be a mission-critical requirement. As well as, latest provide chain disruptions have elevated the lead time to obtain edge {hardware} leading to a number of months delays to modernization initiatives. A few of the most difficult elements of the modernization course of contain organising machine connectivity, establishing a number of communication protocols, and buying the correct {hardware} to deploy at scale and throughout industrial websites. This weblog put up explains how one can deploy a number of cases of edge software program on a single machine. On this answer, we deploy one occasion for every setting (improvement and high quality) to keep away from needing to obtain extra {hardware} for every setting. The sting software program that we talk about embody AWS IoT SiteWise Edge utilizing AWS IoT Greengrass because the runtime setting and runs in a Docker container. You deploy the software program utilizing the AWS Cloud Development Kit (AWS CDK) and the GNU Make utility.
Stipulations
- AWS Accounts_ – Two AWS accounts with default Amazon Digital Personal Cloud (Amazon VPC) subnet configuration. The accounts have to have ample AWS Identity and Access Management (IAM) permissions to launch Amazon EC2 cases, provision IoT Greengrass devices, and arrange AWS IoT SiteWise fashions and property. Word that the Amazon Machine Picture (AMI) we use within the setup is offered solely within the Northern Virginia (us-east-1) Area. You have to to repeat the AMI for deployment to different Areas.
- Set up Docker and Docker Compose in your edge gateway machine to construct and deploy containers.
- In your native improvement machine,
- Set up and configure the AWS Command Line Interface (AWS CLI) following the steps offered at Set up the AWS CLI.
- Set up AWS Cloud Development Kit (AWS CDK) to provision cloud assets. Confer with the AWS CDK Workshop to achieve hands-on expertise utilizing the AWS CDK.
- Clone the run-multiple-sitewise-gateways-using-containers pattern repo from GitHub following the steps offered at Cloning a repository.
Answer Walkthrough
For demonstration functions, let’s take into account an automotive manufacturing plant with a stamping manufacturing line comprising of two stamping presses. You ingest real-time measurement knowledge from every stamping press into two AWS environments (named improvement and high quality) utilizing two cases of the sting software program working on the identical edge {hardware}.
First, you simulate temperature and stress measurement values each 1 second utilizing Ignition software program put in on an Amazon Elastic Compute Cloud (Amazon EC2) instance. Subsequent, you create a digital illustration of the 2 stamping presses in AWS IoT SiteWise in each the event and high quality environments.
Lastly, you put together the sting gateway machine and deploy two cases of AWS IoT SiteWise Edge. You check the end-to-end knowledge movement from the Stamping Presses to AWS IoT SiteWise in each the event and high quality environments. Beneath is the structure diagram of the answer that we simply described:
Steps
-
Put together your environments
Use two AWS accounts to signify the event and high quality environments. You may both use present accounts or create new ones.
Word: Write down the 12-digit AWS account ID for every account as you have to them within the following steps.
2. Simulate real-time measurement knowledge for industrial tools
Use the Ignition software program to arrange an OPC Unified Structure (OPC UA) simulator server. Set up the software program on an Amazon EC2 occasion, and configure pattern tags to simulate temperature and stress knowledge for the stamping presses.
2.1 Select your goal setting
Choose the setting the place you’ll deploy your cloud assets. First, you select the AWS account that represents your improvement setting.
While you return to this part for deploying the answer a second time on the standard setting, choose the AWS account that represents your high quality setting.
To decide on the goal setting, replace the account
and area
parameters within the iot-factory-cdk/cdk.json file.
Word: The Group Amazon Machine Picture (AMI) for Ignition is at the moment accessible solely within the us-east-1
Area. In the event you want to deploy the answer in one other Area, you may copy the AMI utilizing the steps offered at Copy an AMI.
2.2 Set up Ignition software program
Launch an Amazon EC2 occasion and set up the Ignition software program utilizing AWS CDK. (In a real-world state of affairs, as an alternative of an Amazon EC2 occasion, you could possibly use edge {hardware} inside your manufacturing facility.)
Change the listing to iot-factory-cdk and problem the next command to deploy a CDK stack, which incorporates all of the assets wanted to run Ignition.
cdk deploy OPCUAInstanceStack
Navigate to the AWS CloudFormation Console to confirm the deployment and search for a stack named OPCUAInstanceStack.
Word: Write down the EC2IP
, EC2PublicIP
, and EC2Port
parameter values. You’ll use them within the following steps.
2.3 Configure the Ignition software program to simulate knowledge
Now that you’ve got put in Ignition software program, let’s configure it to simulate the info for the stamping presses. (In a real-world state of affairs, Ignition sometimes collects knowledge from industrial tools, akin to stamping presses, via Programmable Logic Controllers (PLCs).
To configure Ignition, entry an internet browser. Permit inbound HTTP visitors to the underlying Amazon EC2 occasion internet hosting Ignition by following the directions at Authorize inbound traffic for your Linux instances. Alternatively, chances are you’ll take into account organising port forwarding as demonstrated in this blog post to keep away from entry to the occasion from the general public IP tackle by securely create tunnels between your cases.
Launch Ignition utilizing the URL http://<EC2PublicIP>
and log in utilizing the default credentials (username: admin
, password: password
). Exchange EC2PublicIP
with the worth famous in step 2.2.
You might need to change the default credentials following the directions at Gateway Security earlier than continuing.
Now, create a knowledge simulator machine to signify manufacturing line 1 and two stamping presses following the steps under:
- Navigate to Config > OPC UA > System Connections.
- Create a brand new machine utilizing Create new System > Programmable System Simulator > Subsequent and use
Manufacturing Line 1
as its identify. Then, select Create New System. - Load an present program to simulate knowledge for temperature and stress measurements.
- Select Extra > edit program > Load Simulator Program > Load from CSV possibility.
- Browse to iot-factory-cdk/iot_factory_cdk/stacks/opcua_datasource /simulator_program_instructions.csv and choose Load Simulator Program.
- Select Save Program.
Your knowledge simulator machine is prepared. Ignition begins simulating knowledge for all 4 measurements each 1 second.
3.Create a digital illustration of commercial tools
Create asset models and assets to digitally signify your stamping line and two stamping presses.
Challenge the next command to deploy a CDK stack. This consists of all of the assets wanted from AWS IoT SiteWise.
cdk deploy SiteWiseAssetStack
Confirm the AWS IoT SiteWise assets by navigating to the AWS IoT SiteWise console → Property. You need to see the property arrange as proven within the following screenshot.
4.Provision the required edge and cloud assets to ingest knowledge from OPC UA Server
Arrange the AWS IoT SiteWise Edge Gateway on the sting gateway machine and set up connectivity with the Ignition OPC UA server you arrange earlier.
Replace the iot-factory-cdk/env.sh with the next parameters
Atmosphere
: Any lowercase string that represents your setting, akin todev
.OPCUAIP
: The IP tackle of the OPC UA server.EC2IP
from Step 2.2OPCUAPort
: The port used for the OPC UA server. That is the AmazonEC2Port
from Step 2.2
Use the next instructions to deploy the assets:
supply iot-factory-cdk/env.sh
cdk deploy IotFactoryCdkStack
Confirm the deployment by navigating to the [AWS CloudFormation Console](https://console.aws.amazon.com/cloudformation/dwelling) and on the lookout for a stack named IotFactoryCdkStack
4.1 Put together the Docker compose file
Challenge the next command to create a Docker compose file.
Make sure you run the script from the identical setting the place your ran cdk deploy
within the prior step.
The python script depends on parameters from the cdk.out
, which is a duplicate of the asset created by AWS CDK. Learn extra about CDK property at Assets.
python3 greengrassv2-installation/docker/config_docker.py
Evaluate the docker-compose.yml
file that’s created belowgreengrassv2-installation/docker
listing.
The docker-compose file accommodates a reference to the Docker image for IoT Greengrass v2, together with the required configurations akin to setting variables, file path for the certificates required for IoT Greengrass v2 to register a core machine.
4.2 Construct a Docker picture and run the container
Word: You need to copy the greengrassv2-installation/docker
folder to your edge gateway machine as a result of it accommodates the required configurations and certificates to register the IoT Greengrass v2 core machine.
Challenge the next instructions on the sting gateway machine the place the Docker daemon runs. It sometimes runs on edge {hardware} in your on-premises knowledge middle that has network connectivity with each your knowledge supply (Ignition or any OPC UA suitable server) and the AWS Cloud.
Challenge the next to construct a Docker picture
cd greengrassv2-installation/docker/
make construct
Run the Docker container
cd greengrassv2-installation/docker/
make begin
4.3 Permit incoming visitors to the OPC UA server
Permit incoming connections from the AWS IoT SiteWise gateway (working on the sting gateway machine) to the Ignition OPC UA server.
Confer with the Gateway Port Reference to know the ports you need to open.
5.Validate the Knowledge Movement
Thus far, you deployed and configured all of the assets wanted to gather knowledge out of your industrial tools at edge and ship it to AWS IoT SiteWise. Now, check the end-to-end knowledge movement utilizing the AWS IoT SiteWise console.
- Navigate to AWS IoT SiteWise console > Property.
- Navigate to Sample_Site1 > Sample_Area1 > Sample_Line1 > Pattern StampingPress1.
- Swap to the Measurements tab and search for values below the Newest worth column.
- Be sure that you discover the real-time temperature and stress values.
- Repeat these steps for the Pattern StampingPress2 asset.
6.Create a brand new machine simulation for the High quality setting
Repeat steps 2 via 5 within the second AWS account to signify your High quality setting.
After you validate the outcomes, you may delete the deployed CDK stacks to keep away from incurring extra prices.
cdk destroy IotFactoryCdkStack
cdk destroy SiteWiseAssetStack
cdk destroy OPCUAInstanceStack
Conclusion
On this weblog, you realized tips on how to use a single edge gateway machine for a number of environments, akin to improvement and high quality. This answer prevented the necessity to dedicate extra {hardware} to every setting. Whereas finishing the method, you deployed a number of cases of the software program on the identical edge machine – one occasion for every setting. Utilizing the sting software program, you have been in a position to ingest real-time knowledge from an OPC UA server on the edge and ship it to AWS IoT SiteWise. To Study extra, checkout AWS IoT SiteWise Resources.
Creator biographies