Did you know the sensor data received on the Kerlink Wanesy Management Centre doesn’t have to be stored only there? In this blog post, I will show you how you can integrate Kerlink Wanesy with Amazon AWS.
Creating ‘Things’ in AWS
Once logged into the AWS IoT platform, go to the Manage section and click on the Things tab. Then click on Create things and select Create single thing. Press next.
In the ‘Things’ properties section give your ‘Thing’ (no pun intended!) a name.
Then expand the Thing Type tab and click on Create thing type.
You will then need to give a name to your Thing type and expand the Searchable attributes section. Add 3 attributes by clicking the Add attribute button. Name it as per the picture below, then click Create.
You should see the green ribbon on top of your screen saying that you successfully created a thing type. Wait for a second and under the thing type section you should see 3 boxes called Searchable attribute and Value – optional next to them. Fill in the values as per the picture below.
Now expand the Non-searchable thing attributes tab. Create 2 more attributes called app_eui and app_key and type the app_eui and app_key of your device. For example:
Once this is complete, scroll down and click Next. You can select Auto-generate a new certificate tab and click Create thing.
Creating the MQTT Shadow and Manage Certificates
Go to the thing you have created – Manage section > Things tab and click on the Thing name. Go to the Interact tab and click on view settings. Copy the Endpoint and save it in a safe place as you will need it to create a push config at a later stage.
Go back to your thing and click on the Device Shadows tab. Click Create shadow, give it a name and click Create. Now you can go to the shadow you’ve created and copy the MQTT topic prefix. Save it somewhere as it will be needed to configure Push config at a later stage.
Now, go back to your Thing and go to the Certificates tab. Click Create Certificate button.
In the pop-up window click Activate certificate then Download the following:
Device Certificate, Public key file, Private key file and RSA 2048 bit key: Amazon Root CA 1
Once you have that downloaded, click done.
Now from the left-hand side list, select the Secure section and choose the Policies tab.
Create a policy by clicking the button in the top right corner. Give it a name, and then make sure to sign up to all of the Policy actions starting with words iot:
The Policy effect should be set to Allow and the Policy resource should be a * symbol.
Once you have all of that, scroll to the bottom of the page and click Save.
Now, go back to the Things tab, your thing, Certificates tab, click on your certificate. On the top of the page, click the Actions button and select Attach Policy from the drop-down menu. A pop up will appear where you need to select your newly created policy and click Attach policies.
Creating a Push-Configuration on Wanesy Management Centre
Now is a good moment to add the device on to Wanesy. If you already have a device added to a different cluster and want to use it to push data to AWS, create a new cluster and move the device into it. Let’s now create a push configuration.
Go to Clusters under the Administration section. At the top of the screen choose the Push configurations tab and then click the + icon in the bottom right corner.
In the pop-up window, give your push config a name, select MQTT type of push and Payload detail level. Then click Next. In the Host box, paste the previously copied Endpoint link.
*If you can’t find it in the AWS go to the following path and copy the Endpoint: Things > Your thing > Interact > View Settings > Endpoint
In the Port box type 8883
The Client ID is the name of the thing on AWS.
You can change Keep alive to 60 seconds.
Tick Enable box under TLS section.
Then click Next
On the next page titled Security don’t type anything, just click Next.
On the following page title SSL, you need to add the Certificate, Private Key and Certificate Authorities store. All of that you have previously downloaded from AWS. Just click Choose File and select the Certificate. Repeat the process for the Private Key and Certificate Authorities store (CA). Then click Next.
On the next page called Topics you need to type the Data Up topic.
You can find it on AWS, copy and paste it here.
* To find the Data Up topic on AWS, go to the following path:
Things > Your thing > Device Shadows > Your device shadow > and copy the MQTT topic prefix
Paste it in a Data Up topic box on Wanesy and click Next.
On the next page titled Messages don’t fill any boxes, just click Validate.
Once you have completed all the steps, go to Clusters under the Administration section and find your cluster. Click on the pencil icon to edit it.
In the pop-up window, enable push and select the push config from the dropdown list. Then click Validate.
Now you can go to the Push configurations tab on the top of the screen and find your push configuration. You can click on the heart icon; this will test that the push config is configured properly. Once you click that, you should get a pop-up message on a green background saying that the push config is correctly configured.
You can now go to your device data up section and see if the data is being pushed. To check this, click End-Devices under Management, then click on the DevEui and Data Up tab. Wait for the next message to arrive and you should see the state Yes in the Pushed column.
Receiving Data on AWS
Once you have the push configuration set up correctly and you can see the data being pushed from Wanesy, to AWS.
To do view this, in AWS, go to the Things tab, Your thing, Activity tab. Then click MQTT test client.
Once you click that, a new tab should open in your browser and you should see the test client. You should already be subscribing to all IoT topics. In case that is not happening, go back to the previous AWS tab and go to the following path:
Things > Your thing > Device Shadows > Your device shadow and copy the MQTT topic prefix
Now go back to the tab where you have the MQTT test client opened and click to Subscribe to a topic. In the empty field below paste the MQTT topic prefix and click Subscribe.
Now wait until the next message arrives from Wanesy to AWS and it will sync and show up the current information and all previous messages.
You can compare messages between Wanesy and AWS to check if they are the same.
“How To” Integrate Kerlink Wanesy with Amazon AWS Video
To summarise this article up to this point you can watch the above video.
Interested in finding out more about integrating Wanesy with Microsoft Azure? Check out our previous blog on How to Integrate Kerlink Wanesy with Microsoft Azure.
To speak with a member of our team about integrating Kerlink Wanesy with your chosen cloud server call us on 01484 599544 or contact us.