How to Integrate Kerlink Wanesy with Amazon AWS

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.

Adding searchable Attributes

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.

Searchable Attributes – Values

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:

Non-searchable attributes

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.

Policy details

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

Integrate Kerlink Wanesy with Amazon AWS
Push Config details

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.

MQTT topic

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.

Data being pushed outside WMC

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.

Payload message comparison – WMC side
Payload message comparison – AWS side

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.

How to Integrate Kerlink Wanesy Management Centre with Microsoft Azure

The sensor data received on the Kerlink Wanesy Management Centre doesn’t have to be stored only there. It is possible to integrate various dashboards or other cloud servers such as Microsoft Azure with Wanesy by setting up the HTTP push.

In this blog post, I will guide you through the steps you need to take to integrate Kerlink’s Wanesy Management Centre with Microsoft Azure.

Setting up Microsoft Azure

The first step for integrating your data is to create an account on Microsoft Azure. You can do this for free by visiting the Microsoft Azure website: Create Your Azure Free Account Today | Microsoft Azure.

There are various Pricing Plans to choose from. Some features may be limited in the free variant. The account, however, is free to create and features are paid on a pay-as-you-use basis.

Once the account is created, we will need to use the IoT Central Application and the IoT Hub platform. The IoT Central Application can display data on the dashboard as well as integrate the device templates. The IoT Hub platform is used to adapt the WMC push to Azure.

Setting up the Azure IoT Central Application

In the search bar type ‘IoT Central Applications’ and hit search. You could also click on the icon if shown on the main page.

Then click on the Create button and fill in the boxes as in the picture below.

Creating the IoT Central Application

If the Resource group tab is empty, click Create new and type in a new name.

At this stage the URL is chosen, by default, it is the name of the resource .azureiotcentral.com but you can adjust it accordingly.

Once all the information is inserted, click on the Create button and give it a few minutes to deploy your application.

When you have a “Your deployment is complete” message, you can move forward to the next step.

Connecting Your Devices

Go to your IoT Central Application– the quickest way is to go to the URL chosen in the previous step.
In my example that will be kerlink-demo.azureiotcentral.com

Once you are in your dashboard, go to the Administration section and go to ‘Device Connection’. Find and copy Scope ID. Go to the IoT devices group type and copy the Primary Key. Save it in a text file as it will be required at a later stage.

Finding Scope ID and Keys
Copying Scope ID and keys

Now, go to the following link to create your custom template. https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FBenoitDuffez%2Fiotc-device-bridge%2Fmaster%2Fazuredeploy.json<

Choose ‘Kerlink Resource Group’ and paste the Scope ID here as well as the Primary Key. Paste the Primary Key in the “IoT Central SAS Key” box.

Creating a custom deployment

Click Next: Review + create. Review the options and click Create.

Wait a minute until the Deployment is done and when you have the message saying “Your deployment is complete” you can move on to the next steps.

Adding Your Devices to Kerlink WMC

Now is a great time for you to add your devices to the Wanesy Management Center. You can skip this step if you have devices already added. Just remember to create a new push configuration later and assign it to the existing cluster.

First of all, login to WMC, go to the Administration section, then select Clusters. In the bottom right corner click the plus icon and create a new cluster. A pop up window till open, in here you will need to give it a name and disable Push configuration. (later on, once we have the push configuration made, we will need to enable this).

Click Validate. Once you have done this, go to the Administration section and ‘End Devices’ tab. Click on the plus icon in the bottom right and fill in all the information. Follow instructions until you can click Validate. When you click Validate the device will be added to the WMC.

Setting up the Push URL

Go back to Microsoft Azure and go toIoT Central applications, click on the Kerlink resource group and click on the function app which has a thunder icon.

Once that is open, go to the Functions section on the left-hand side menu and click on Functions. Click on the function that triggers the HTTP event and select the Code + Test tab. Give it a minute to load and from the tabs on the top of the screen select Get function URL.

Getting the function URL

In the pop-up window leave the key as default and copy the URL.

Copying the URL

Now go to Kerlink Wanesy and click on the Administration section and Clusters tab. On top of the screen select Push Configurations and then click the plus icon in the bottom right.

In the pop-up window, type the name, select HTTP type and Payload message detail level. Click next.

On the next screen paste the URL from Azure. You need to cut the URL from its end up to the question mark symbol (including the ?). You will then need to pastethis into the Data Up route box.

For example:

This is my example link from Azure:
https://iotc-fnp7rbonitg2tyg.azurewebsites.net/api/IoTCIntegration?code=gykWSte3vai5YEaECLlm5PGuMm0fb7RWE9I10m6TLFqTWxVhmfVJCQ==

In the URL box should be this part:
https://iotc-fnp7rbonitg2tyg.azurewebsites.net/api/IoTCIntegration

And in the Data Up route the rest, that is:
?code=gykWSte3vai5YEaECLlm5PGuMm0fb7RWE9I10m6TLFqTWxVhmfVJCQ==

WMC Push Config URL

Then click Next, don’t choose any SSLs, click Next again, and click Validate without creating any custom headers.

Now go to the Clusters tab on the top of the screen. Find the cluster you have created previously (or find the cluster that you have the sensors in) and click on the pencil icon next to it to edit.

In the pop-up window under the ‘Push’ section, click Enable and from the drop-down list select the Push configuration that you’ve just created. Press Validate.

Once that is done, uplink messages will start being pushed to Azure from the next time the sensor sends the uplink.

Creating the Device and Device Template on Azure

In MS Azure go to your IoT Central Application. The easiest way to get there is to go via the URL created at the beginning – the name of the resource .azureiotcentral.com
In my case it is kerlink-demo.azureiotcentral.com.

You can start with creating a device. Click on Devices and then New. Type the name and Device ID. You can use any name and any ID, for demo purposes I’ve selected the name of the sensor as the name and its DevEui as the ID. You can leave the Template as unassigned at this stage. Then click Create.

Once you create a device, it will have a “registered” status. After it starts sending data, the status will change from “registered” to “provisioned”.

You can then go into the device screen and in the Raw data screen, you should see uplink messages. Go to the Manage template tab at the top of the screen and select the Auto-create template option. Then click on Create template button.

Once you go back to the devices tab and click the row with a message, you will see more detailed pieces of information for each message.

It is worth mentioning here, the number of messages you can see on Azure depends on the plan you’ve selected earlier. Free plans limit the number of messages quite drastically. If you exceed the number of messages they will just stop appearing in the Azure.

If you have a device sending the uplink every few minutes, you will most likely exceed the limit in no time.

“How To” video

To summarise this article up to this point you can watch the above video.

Further Steps

Further steps to use the decoder and fully decode the data will be researched soon. The way to do it is by creating the IoT Hub in Azure and registering the device there along with linking the decoder to it. The further steps of how to do it are currently under development.

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.

Choosing The Correct IoT Solar Panel For Your Application

Selecting the bet IoT Solar Panel

The sunlight is a great source of power, and it can be used to charge various kinds of batteries. Parametric offers a solution that uses solar panels to charge batteries in their People and Traffic Counters. However, while the solution works great, it is important to remember that the choice of the IoT Solar panel in the right size matters.

The main criterium that determines if the solar solution will even be possible is the place of use. Additionally, things like fog, dust and even cloudy weather may affect the performance of the IoT solar panel system.

Parametric has in their portfolio a wide range of products suitable for various use cases. They have a range of solar panels with integrated charges and batteries for solar panels from 5V up to 20V.

As mentioned before, it is critical to properly select the correct solar solution. This article may help with that choice a little.

PVGIS – Photovoltaic Geographical Information System

The PVGIS is a great tool that can be used for the simulation of the solar power system. It uses meteorological data at the desired location. This is a free online tool and can be accessed at the link below.

JRC Photovoltaic Geographical Information System (PVGIS) – European Commission (europa.eu)

Simulation

The first step for the simulation is to type the address or select the desired place by clicking on the map. Once the place is selected, you need to enter the technical data of the solar panel.

Choosing the location of the solar panel.

Go to the Off-Grid tab and type the correct details of the solar system. For example, parametric offers the 17W solar panel with a 40° mounting bracket. In this case, settings should look like this:

Entering details of the solar system

Parameters and values

Parameters and Values explanation.

Once all values are entered, it is time to run the simulation. Click on the Visualise results button.

The 1st visualisation

The most important output from the simulation is the Percentage days with empty battery.

In this example, at the chosen location, the value is 1.8%.

If the value is 0, there is a very good chance the solar powered system will work in the desired place. If it is not, like in this case, a more powerful system should be chosen.

To simulate if the solution would work with the bigger IoT solar panel in this location, we need to go back to the table with details of the solar system and change the Peak power to a higher value. Let’s try a 60W panel instead of 17W.

Adjusting the solar panel power.

And simulate the results again…

The 2nd visualisation

Now, the value of percentage days with an empty battery is 0, which means the 60W solar system should work fine for this location.

Disclaimer

The PVGIS simulation is based on a meteorological data model (PVGIS-NSRDB solar radiation database). There can always be unpredictable weather situations where too little solar energy is stored and the system will switch off. Alliot nor Parametric can be responsible for any miscalculations or mis-purchases that may result from using this tool.

Contact us today for assistance in assessing your IoT Solar Panel requirements or to discuss your IoT projects in more detail.

A Short Guide to Creating a LoRaWAN Enabled Christmas Tree

There are virtually an endless amount of uses for the Netvox R809AG Smart Plug. With the festive season upon us, our team have created a smart solution, enabling us to remotely control the lights on our office Christmas Tree. Discover how you too can create your own LoRaWAN enabled Christmas Tree with our short guide.

So you have your tree trimmed to the nines, your lights are perfectly placed, all you need now is a way to remotely control and programme when your tree is illuminated. With LoRaWAN, this couldn’t be simpler. To get started, you will need the following parts:

  • Netvox R809AG smart plug.

Installation process

Simply connect the smart plug into the power socket and then plug your Christmas Tree lights into it.

Then, add the Netvox R809AG into the LoRa Network Server of your choice.

LoRaWAN Enabled Christmas Tree - How to
(Wanesy LNS used in this example)

Once the device has successfully joined the network, it is ready to operate.
Find your device in the LNS and send the following message 910E000000000000000000 on the port 7.

Switching lights on

Voilà – you have switched on your Christmas Tree lights!

To switch off lights, simply send the following message 900E000000000000000000 on the port 7.

Switching lights off

See our LoRaWAN Enabled Christmas Tree Live in Action

And that’s it! You’ve just made your Christmas Tree LoRaWAN enabled!

Merry Christmas!