Difference between revisions of "Azure IoT Hub cloud connection"

From Teltonika Networks Wiki
Line 5: Line 5:
  
 
This article contains instructions on how to configure an RUT router in order to connect to the Azure IoT Hub.
 
This article contains instructions on how to configure an RUT router in order to connect to the Azure IoT Hub.
 
* [[Prerequisites|Prerequisites.]]
 
* [[Azure account creation.]]
 
* Managin Azure services.
 
* Configuring RUT955 Azure IoT Hub.
 
* Checking if Data reaches Azure IoT Hub.
 
** Linux
 
** Windows
 
  
 
==Prerequisites==
 
==Prerequisites==
Line 135: Line 127:
  
 
</ul>
 
</ul>
 +
 +
==Configuring RUT955 Azure IoT Hub==
 +
==Checking if Data reaches Azure IoT Hub==
 +
==**Linux==
 +
==**Windows==
 +
  
 
==Configuring the device==
 
==Configuring the device==

Revision as of 23:03, 5 February 2020

Azure IoT Hub is an open and flexible cloud platform that supports open-source SDKs and multiple protocols.

Introduction

This article contains instructions on how to configure an RUT router in order to connect to the Azure IoT Hub.

Prerequisites

You will need:

  • A router from the RUT2xx, RUT9xx series or RUTX09
  • An Azure IoT Hub account

Azure account creation

Visit https://azure.microsoft.com/en-us/ and create an account that will suit your needs, for testing purposes we will be using free Azure account.

Managing Azure services

  • First you will want to create a Resource group for easier management of resources that you will add later. In Microsoft Azure home page.
    • Select Resource groups
      If it is not in very first page, click More services and locate it there.
    Azure01.png
  • In new window, select Add
  • Azure02.png
  • And then finish creating yours Resource group
  • Select your subscription, we are using Free Trial for this test.
    1. Name your group
    2. Finally, choose server location for meta data. We will choose (South America) Brazil South and will use it during test where available.
    Azure03.png
  • At this moment we will skip adding Tags since we will be able to do that later if needed, so simply press Review + create at the bottom of screen and then click Create to finish setup.
  • Azure04.png
    Azure05.png
  • You will be redirected to Homepage, then click on Resource groups. You should see yours newly created group, select it, and press Add.
  • Azure06.png
  • Select Internet of Things or simply search IoT Hub and press Create.
  • Azure07.png
  • We leave default subscription and resource group and choose:
    1. Region – (South America) Brazil South as before
    2. Create a name for IoT Hub
    3. Then go to Size and scale tab
  • Azure08.png
  • For testing purposes, we are using F1: Free tier
  • At the bottom of the screen Review + create
    Azure09.png
    And finally, Click on >> Create
    Azure10.png
    Note: Wait until resource deploys and press Go to Resources


  • Inside IoT Hub list:  
    Scroll down to Explorers and select IoT devices
    Azure11.png
  • Press New
  • Azure12.png
  • In new device creation
    1. Enter Device ID
    2. Leave everything else on default and press Save
  • Azure13.png
  • After you finish creation, you will be redirected back to IoT devices select yours newly created Device ID
  • Azure14.png
  • In your device window you will find information needed to connect RUT devices to Azure IoT Hub.
  • For now, we will only need connection string. Copy Primary Connection string by pressing copy icon next to it.
    Azure16.png

Configuring RUT955 Azure IoT Hub

Checking if Data reaches Azure IoT Hub

**Linux

**Windows

Configuring the device

  • Login to the router's WebUI and go to the System → Administration → Azure IoT Hub page.

  • Configure the main connection settings:
    Azure iot hub 1.png
    • The "Connection string" should be provided by Azure. The format of the string should something like this:
      HostName=aics-prod-hub.azure-devices.net;DeviceId=6eLklROrG5;SharedAccessKey=xcRgQpJtY13laOumje3DrxJw1R3LlqnKmVxPFA0Z7Rw=
    • Take note that a lower sending interval value will mean more data usage.

  • Below the main connection settings there is a list of parameters that will be sent to the Azure IoT Hub. Place check marks next to parameters that are relevant you (once again take into account that more parameters will mean more data usage).
    Azure iot hub 2.png
    Note: the parameters in the figure above are selected for demonstrative purposes. Select the parameters that are relevant to your solution.

  • Don't forget to save the configuration:
    Azure iot hub 3.png