Building an Industrial IoT platform using AWS IoT by Shivaji Rithekar An American Manufacturing Leader wanted a cloud-enabled IIoT platform to connect, track and monitor its Enterprise Gateways (EG), that connects up to 30 end-devices that are installed across the manufacturing facilities. The company needed smart device management and secure data management system that can manage connected end-devices and measurement & control data; including Temperature, Humidity, Dew point or Pressure. It would also provide real-time visibility of the collected EG data for the end-customers to take corrective actions based on the alarms/configurations. The company engaged Saviant to build the solution that would help them overcome all their challenges. Let’s dive into the anatomy of this robust IoT platform devised using AWS IoT. AWS IoT Hub Setup Every device must have a certificate, private key and root CA certificate to authenticate with AWS IoT. AWS IoT Hub Setup is leveraged to register the device to the Registry. Device X.509 Certificate was created and activated for secure communication (Authentication) between device and AWS IoT Hub, thus attaching a Certificate to a Thing. AWS recommends to attach the device certificate to your device(thing) to represent your device in AWS IoT. This allows you to create AWS IoT policies that grant permissions based on certificates attached to your things. Setting the AWS IoT Rules Engine AWS IoT Rules Engine was set to listen and match the incoming MQTT messages with a rule. When a received message matches with the set rule, it takes some action on the data present in MQTT message (for instance, sending messages to an Amazon SNS topic, or writing some data to an Amazon S3 bucket, using a Lambda function). Since there are no .NET workers currently supported in AWS, push mechanism of IoT Rule Engine was used where in the incoming messages are pushed on to AWS Lambda function for processing. Writing AWS Lambda Functions There is no SDK available for .NET Workers (background service) and hence AWS Lambda Functions have been used for processing the messages. The AWS Lambda Functions can only be written in .NET Core and AWS provides the Visual Studio Toolkit through which the AWS Lambda Functions can be written and published to the AWS Cloud without much hassle. Creating AWS SQS Queue Messaging AWS SDK for .NET supports Amazon SQS, which is a message queuing service that handles messages or workflows between components in a system. Considering that the AWS Lambda function needs to be executed in 300 seconds, we divided the processing of the incoming message in different AWS Lambda functions. Using AWS Storage All the data gets stored in AWS RDS DB and Dynamo DB. We leveraged the .NET SDKs provided to communicate with the Dynamo DB for storing the telemetry data and used the AWS RDS for storing the aggregated data required for reporting. Configuring AWS Elastic Beanstalk We used AWS Elastic Beanstalk to deploy the ASP.NET MVC. AWS has Visual studio Toolkit which makes developing, managing and deploying from Visual Studio IDE simple and the .NET community can develop applications and the ToolKit handles all other aspects seamlessly. Why the customer wanted to build Industrial IoT platform using AWS IoT? Quick device connectivity: Connecting your hardware device or your mobile application to AWS IoT Core quickly is simple and easy using AWS IoT Device SDK. Secure data ingestion: Ingest millions of data records/messages collected from multiple devices securely and easily using AWS IoT Core. Easy device management: With AWS IoT Device Management, organizing, monitoring, and remotely managing the IoT devices is easy and simple. Supports Multiple protocols: AWS Device Gateway supports the MQTT, WebSockets, and HTTP 1.1 protocols. Simple codebase management: Application code base can be easily managed with your current team of .NET developers. No need of additional expertise to handle the code base.