Step 4 – deploying the OPC UA Connector

To deploy the OPC UA Connector, we need to create a Lambda function. Follow these steps:

  1. From the menu on the left on the Greengrass site, click on Lambdas and then Create new Lambda, as shown in the following screenshot:

  1. From the Lambda interface, we need to provide a name such as my-iiot-book-opcua-lambda and add a new role:

  1. We need to allow the role to execute Lambda, as shown in the following screenshot:

  1. We need to upload the opcuaLambda.zip file that we created before. We have to save the function and publish the version:

  1. From the IoT Greengrass console, click on the Use existing Lambda button and link to the function that we just created. We have to make this function permanent, so we need to edit the function and choose the Make this function long-lived and keep it running indefinitely option, as shown in the following screenshot:

  1. Then, click on Deployas shown in the following screenshot:

Greengrass will connect the OPC UA server and will send data to the data IoT Hub for the topic /opcua/server/node/Temperature. The topic will be created automatically.

For troubleshooting, you can check the log files located at /greengrass/ggc/var/log/system. From the command line, run the following command: tail -f /greengrass/ggc/var/log/system/*.log.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset