The first steps in Azure IoT
Victor Karabedyants
MSDP in Software Engineering, CTO, MBA, Cloud Manager at Sitecore | AI Engineer | Azure Solutions Architect | Azure Administrator | Azure Security Engineer | Azure Developer | Azure Data Engineer and Devops| CKA
In this article, I want to talk about my first steps with Azure IoT, using Azure IoT Central to connect and do basic work with IoT devices. In the future, you can connect various IoT devices and implement any solutions for production automation and remote control. Mastering Azure IoT provides significant savings opportunities.
For the connection, I will use the MXCHIP AZ3166 and will receive data from it to Azure IoT Central and send control commands to the device. Let's start. What is Azure IoT central??
Azure IoT Central is a cloud service from Microsoft that provides tools to simplify the development, deployment, and management of IoT solutions. It allows you to easily connect devices, collect data, monitor and analyze information, as well as manage devices from a centralized web interface.?
MXCHIP AZ3166 is an Internet of Things (IoT) development platform created by MXCHIP (Shanghai MXCHIP Information Technology Co., Ltd). It is a compact device specially designed for prototyping and developing IoT projects.?
To develop our solution, we will use experience and examples from Microsoft. Who kindly provided us with the code for our experiments. You can take it here:
After cloning, you need to install the components by executing the script, the script will do everything for you:
getting-started\tools\get-toolchain.bat
To access Azure IoT central, you need an Azure account, you must go to the link, ? https://apps.azureiotcentral.com/home? and you will see the menu:
Click the "build app" button, select the name of the program and its link, as well as the tariff and billing information (your subscription and region)?
The application is created and prepared, now we need to add our device to it. Press the new button, and go to the device creation menu.
We fill in the necessary data and create devices. Go to the new device template and click connect
We copy the data, ID scope, Device IT, and Primary key because we will need them to connect our IoT device.?
Now let's start connecting our device to the cloud. Of course, we need a Wi-Fi network and the settings of our IoT central, which we will add to the configuration:
getting-started\MXChip\AZ3166\app\azure_config.h
领英推荐
Open the file edit the following lines, and add access to our Wi-Fi network:
Let's add access to Azure IoT Central:
Everything is ready! We can retrieve our image and upload it to MXCHIP by executing the command:
getting-started\MXChip\AZ3166\tools\rebuild.bat
And we are waiting for the image to be created:
after compilation, we will get an image in bin format:
getting-started\MXChip\AZ3166\build\app\mxchip_azure_iot.bin
Connect the MXChip to your laptop or PC, and we will see this device as an additional drive. Copy mxchip_azure_iot.bin to this disk, the device will automatically reboot and update its firmware from our device.?
After that, we can go to our IoT Central and see the first results of our work:
Let's try to send commands to the device, go to the Commands menu, and try to send the text:
We will see the results on the screen:
In this article, we covered the first steps in working with Azure IoT Central using the MXCHIP AZ3166 device. We started by registering with Azure IoT Central and then configured the MXCHIP AZ3166 device to connect to the cloud. Played with transferring data to the device. I hope this was useful material for beginners who would like to do Azure IoT. We also have a channel on Azure in Telegram, join the community? - https://t.me/azureuacommunity?