How to interface Groov EPIC (Edge Programmable Industrial Controller) with AWS for a cloud application using node-red
Opto 22's Groov EPIC (Edge Programmable Industrial Controller) is a Programmable Logic Controller (PLC) that makes the electrical connections to real-world industrial "things." These connections are inputs for sensors, switches, electrical loads, and outputs for actuators, motor controllers, etc. Many options are available for real-time management in demanding industrial environments.
The edges need strong industrial equipment from the factory to the remote location and need not worry about processing power in difficult places. The enterprise-hardened Groov EPIC platform securely connects operational technology (OT) and information technology (IT) through the collection, processing, visualisation, and exchange of information at the edge of the network. . The device has built-in software including Groov Manage, PAC Project Basic, CODESYS, Groov View, Node-RED, Ignition Edge®. It provides publish-subscribe data communication options using QTT/Sparkplug.
This blog will explain how to configure this device for MQTT data communication with AWS (Amazon Web Services) using built-in Node-Red, an open-source software program.
Figure 1: Groov EPIC Device and Software Architecture
Configuring Groov EPIC device for MQTT with AWS using Node-Red:
Node-RED provides an easy way to connect edge computing systems such as industrial automation controllers and edge I / O to cloud services such as Amazon Web Services ™ (AWS) IoT, IBM Watson IoT ™, and Microsoft® Azure®. The Node-RED flow downloads data to the groove EPIC over the Internet (cloud-to-device) and also transmits data from the Groove EPIC to the cloud (device-to-cloud), connecting pre-assembled nodes (provided by device manufacturers or software developers) working together to make a flow. The flow provides the logic to achieve your goal.
Follow the steps below to configure node-red on the GroovEPIC device for the AWS server to send and receive data.
To launch Node-RED with Groov EPIC, use your computer and GroovManage. If you log in to Grove EPIC as an administrator, you will see the following screen.
Figure 2: Selecting Node-Red environment
From Groov Manage, select Node-RED.
Figure 3: Open Node-Red editor
Click on Open Node-RED Editor. Since you've already gone through the authentication process by logging into Groove Manage, the Node-Red editor opens like the screenshot directly below. To open this Node-Red on your computer, use the EPIC Groov hostname / node-red as shown in the following figure.
Figure 4: URL to open localhost (Groov EPIC device) on the remote system (computer)
Finally, we get below node-red environment.
Figure 5: Node-Red environment
Select the MQTT subscription node from the node menu and drag it into the flow diagram. Double click on this node to configure.
Figure 6: Configuring Node-Red for MQTT (AWS server)
Copy the host from the Amazon AWS console and add it as shown below. The host is unique for each user, and the port is 8883. Give any name here; we will take it as a public broker.
Figure 7: Adding AWS server address
Click on the TLS and edit. Upload the Downloaded certificates from the AWS. The following steps will help you to download the certificates.
Figure 8: Adding certificates
Linking device with AWS and downloading certificates:
Go to things as shown below. Things represent the device. There can be multiple devices added to things. Here we have only one device that, is Groov EPIC. We will create a thing, and we will use that thing from the Node-Red to send some of the MQTT messages on the AWS IoT core. Click on the "create things" button and give any name to that thing. Click on next; it will generate the certificate needed to interact with the Groov EPIC. Download all the certificates and upload them to the TLS-config nodes.
Figure 9: Creating Things device
Figure 10: Generating certificates
After generating the certificates, click on create policy.
Figure 11: Adding Polices
Edit the policies as shown in the below figure:
Figure 12: Editing Policies
Select the created Groov policy and click on the button create. After that, you can download the certificates.
Figure 13: Download certificates and key files
Making an application to toggle a digital output:
Once the certificates are added, broker setup is completed, the next thing to look at is the topic. The topic namespace is an unmanaged way to identify your messages. Each client determines the topic of that device's messages. Let us add the topic "workshop/switch," as shown below.
Figure 14: Setting the MQTT topic to control digital I/O
After setting up the client, we use the switch method to toggle a light. To do that, we will use the SNAP PAC write node. These interface with the I/O modules installed on the Groov EPIC chassis. This will connect to the local host device since Node-RED is running on the Groov EPIC.
Figure 15: Creating SNAP PAC write node
Now edit the PAC write and fill the following as shown below:
Figure 16: Editing SNAP PAC write node
Now you can publish and subscribe to any topic; in this case, the topic is "Workshop/switch." The client for subscribing and publishing can run on any field device or cloud application.