Some days ago I decided to start testing AWS IoT stack.
I got Allen-Bradley Micro820 Programmable CCW PLC Trainer Micro800 Training Kit, Raspberry Pi (could be Vagrant box running in the windows machine), a windows machine.
(Note this picture was taken from the book Hands-On Industrial Internet of Things, you must buy this book if you really want to understand IIoT!)
So let's implement the suggested architecture.
Data acquisition steps:- Download Raspbian
- Install Raspbian in SD Card
- Get windows machine
- Install Kepware KEPServer in the windows machine so it can be used as a device gateway. We will need it to convert Allen-Bradley PLC (Modbus TCP/IP) connection to OPC UA.
- Using the windows machine, connect to Allen-Bradley and assign it static IP through Rockwell software.
- Time to configure Kepware KEPService, create a channel and device. Import the datatags.
- In Kepware configure OPC UA to accept connections.
- Greengrass installation and configuration part. Instead of me telling you step by step how to do it. I am going to share which links I used.
https://docs.aws.amazon.com/greengrass/latest/developerguide/module1.html
https://docs.aws.amazon.com/greengrass/latest/developerguide/gg-config.html
https://docs.aws.amazon.com/greengrass/latest/developerguide/gg-device-start.html
Use OPCUA Lambda:https://docs.aws.amazon.com/greengrass/latest/developerguide/opcua.html
Configure Lambda for Greengrass:https://docs.aws.amazon.com/greengrass/latest/developerguide/config-lambda.html
Nice YouTube video if you dont want to read:Data storage steps:- Create DynamoDB table for hot path and "time series" database
Partition key ts_date
Sort key ts_time
- Create an Act in AWS IoT to insert messages into the previously created DynamoDB table
Table name tablename
Partition key ts_date
Partition key value ${parse_time("yyyy.MM.dd", timestamp())}
Sort key ts_time
Sort key value ${parse_time("HH:mm:ss", timestamp())}
Write message data to this column data
Operation INSERT
Act rule query statement example
select * from '/opcua/kepware-plc/node/input1'
Result:- Create S3 Bucket for cold storage and data lake
- Create Act in AWS IoT to store messages in the previously created S3 Bucket
S3 bucket bucketname
Key ${parse_time("yyyy/MM/dd", timestamp()) + '/' + newuuid() + '.json'}
Act rule query statement example
select * from '/opcua/kepware-plc/node/input1'
Result- Create AWS IoT Analytics Channel based on /opcua/kepware-plc/node/input1 topic
- Create Pipeline
- Create Data store
- Create data set from the data store previously created.
- In the end, you should have a new Act in AWS IoT for AWS IoT Analytics.
- Create a new data set, use AWS IoT Analytics as data source.
- Create your dashboards
- Use SageMaker for ML
- Use Athena to query cold storage (S3)
- Maybe ElasticSearch
- Use Amazon Timestream, AWS Forecast, AWS IoT ThingsGraph, AWS IoT Sitewise, AWS IoT Events
Comments