DEV Community

Hyacienth Ugochukwu
Hyacienth Ugochukwu

Posted on

Configure an IoT device using the Raspberry Pi device simulator.

What is IoT Hub?
Azure IoT Hub - Microsoft
IoT Hub is a Platform-as-a-Services (PaaS) managed service, hosted in the cloud, that acts as a central message hub for bi-directional communication between an IoT application and the devices it manages.

Step 1. Create an IoT Hub

  • Go to your Azure Portal, on the dashboard, you will see IoT Hub, click on it.

Image description

  • On the IoT Hub page, click on create. For your first time, you would be required to create a new resource group. Create a name for your IoT Hub also then click on Review + Create.

Image description

Click on Create and wait for it to successfully deploy.

Image description

After the deployment must have been completed, go to resource.

Image description

Step 2. Add an IoT device.

  • Scroll down to the usage section and you will see that all message counts are zero. Click on the device section to add a device.

Image description

Image description

Give your IoT Hub device a name and save. When it must have saved completely, click on the device you just created.

Image description

When you open the device, copy the primary connection string.

Image description

Step 3. Test the device using the Raspberry Pi Simulator.

  • What is a Raspberry Pi used for? The Raspberry Pi is a low cost, credit-card sized computer that plugs into a computer monitor or TV, and uses a standard keyboard and mouse. It is a capable little device that enables people of all ages to explore computing, and to learn how to program in languages like Scratch and Python. Search Raspberry Pi online simulator on Google. When the simulator comes up, check the code section in line 15. Clear everything inside the quote sign and paste your primary connection string, then run the code; you will notice that the red bulb that was not blinking before starts blinking. Then go back to the resource of your IoT Hub device, under the usage section and you will see that the message counts that were zero before have increased. This means that you did the right thing.

Image description

Image description

Top comments (0)