RUTX Azure IoT Hub cloud connection
Azure IoT Hub is an open and flexible cloud platform that supports open-source SDKs and multiple protocols.
- 1 Introduction
- 2 Prerequisites
- 3 Azure account creation
- 4 Managing Azure services
- 5 Configuring RUTX Azure IoT Hub
- 6 Checking if Data reaches Azure IoT Hub
- 7 Setting router to Forward MQTT messages/commands to Azure IoT Hub
- 8 Checking if MQTT messages are being forwarded to Azure IoT Hub
Introduction[edit | edit source]
This article contains instructions on how to configure a RUT router in order to connect to the Azure IoT Hub.
The information in this page is updated in accordance with the RUTX_R_00.02.01.1 firmware version.
Prerequisites[edit | edit source]
You will need:
- A router from the RUTX09 or RUTX11
- An Azure IoT Hub account
Azure account creation[edit | edit source]
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[edit | edit source]
- First you will want to create a Resource group for easier management of resources that you will add later. In Microsoft Azure home page.
- In new window, select Add
- And then finish creating yours Resource group Select your subscription, we are using Free Trial for this test.
- Select Resource groups
If it is not in very first page, click More services and locate it there.
- Name your group
- Finally, choose server location for meta data. We will choose (South America) Brazil South and will use it during test where available.
Configuring RUTX Azure IoT Hub[edit | edit source]
- First open router WebUI, go to System > Package Manager and install Azure IoT Hub package
- Now navigate to Services > Cloud solutions > Azure IoT Hub
Checking if Data reaches Azure IoT Hub[edit | edit source]
- From router side, connect to it with CLI or SSH client and write in command azure_iothub and press Enter
- From Azure IoT Hub side you can check if it receives data. Go to IoT Hub that you created previously. Select Overview, there you can see:
- To capture logs you will need Device Explorer for IoT Hub Devices.
- Now you will need connection string of yours Azure IoT Hub, Not device. Navigate to IoT hub in your browser, then:
- After that go back to Device Explorer:
- Open Management tab
- Go to Data tab
- Go to Services > MQTT > Broker
- Go to Services > Cloud solutions > Azure IoT Hub
Setting router to Forward MQTT messages/commands to Azure IoT Hub[edit | edit source]
Checking if MQTT messages are being forwarded to Azure IoT Hub[edit | edit source]
Linux[edit | edit source]
- Open terminal and publish to MQTT Broker message with previously chosen topic.
For our example we are using example: mosquito_pub -h 192.168.1.1 -p 8883 -m ‘testing Azure MQTT messages’ -t test
Windows[edit | edit source]
- Install a MQTT client software to do the test, for this example we used MQTT.fx
- If you did everything right this message will be shown in the device explorer