Prerequisites for Azure IoT

Simuli Virtual Lab

First, log in to your Simuli account and navigate to the Simuli Virtual Lab. Here we will create a new emulated instance of the Raspberry Pi. Click on the Launch button under Raspberry Pi to get started.

This will open the configuration menu. First, provide a name for the project. Then we will select the OS which will be Buster. Next, we will select SHT2X Temperature and Humidity Sensor. Finally, we will review that all the details are correct and click on the Launch button.

Once we have clicked on the Launch button, a new instance of Raspberry Pi will be created. It can take a few minutes for this process to be completed.

While our new instance is being created, let's move forward to creating a Microsoft Azure account and configure it.

Azure IoT Hub

Before we start, a Microsoft account is required. If you do not have that you can simply sign up for one. Then, an Azure subscription is required which can be created for free. Finally, go to your Azure portal and login.

Once you have reached the Azure homepage, select the +Create a resource button, and then search for IoT Hub. Select IoT Hub from the search results, and then select Create.

Now under the Basics tab, you need to select a subscription to use it for your hub. If you are a student using a student account, the "Azure for Students" subscription will be available.

Next, for the resource select an existing one. Otherwise, if you do not have one, you can create a new one by clicking on the Create new and then entering the name of the resource you want.

For the Region section, you can select your preferred region, and for the IoT Hub Name section, enter a unique name.

Under the Networking tab, select public access.

Under the Management tab, select F1: Free tier and leave the other settings to the default selection.

Note: Only one free tier IoT Hub is available for an account.

Finally, click on Review+Create, check all the details entered and then click Create.

Now, to create a new Device under IoT Hub, Click on Devicesunder the Device Management section. In the Device Explorer pane, click on +Add Device to add a device to the hub.

Enter a unique ID for your device, for Authentication Type select symmetric key and leave the other to setting to the default selection.

Once the device is created, you can find your newly created device in the Device Explorer section. Click on the name of the device. Note down the Primary key and the Connection string-primary key of the Device. This will be important as we need it for communication.

We need to create an Azure cloud shell (CLI) in the Azure portal as this will come in handy in many ways. For that, click on the Azure cloud shell button in the portal present, located just right to the search bar on the top. Then click on the create storage option, select your subscription and Create.

Once done, you can run the following command to install the Azure add-on which will be used to show the live transmission of sensor data.

az extension add --name azure-iot

Our Azure IoT setup is complete. We will now move on to our instance in Simuli Virtual Lab.

For more information on setting up, you can refer to Azure Documentation.

Last updated