DEV Community

Cover image for HOW TO SET UP AN IoT HUB IN AZURE.
Godwin Oyindamola
Godwin Oyindamola

Posted on

HOW TO SET UP AN IoT HUB IN AZURE.

Do you have trouble with Azure IoT Hub?
Here's a simple guide to help you set it up if you're new to IoT Hub, let's start with a quick introduction.

What is Internet of Things(IoT)?
The Internet of Things (IoT) refers to a network of physical devices, vehicles, appliances, and other objects embedded with sensors, software, and network connectivity. These devices, often called β€œsmart objects,” can collect and share data with each other and with other internet-enabled devices.

What is Azure IoT Hub?
This is a cloud service from Microsoft that connects, monitors, and manages IoT (Internet of Things) devices. It helps you securely communicate with and control IoT devices, collect data, and integrate with other Azure services.

Steps involved in setting up an IoT Hub in Azure:

Step 1: Sign in to azure portal at https://portal.azure.com/ with your details.
sign in

Step 2: In the Search box, type IoT and select IoT Hub from the services suggestions.
search

Step 3: On the IoT Hub page, press Create.
Create

Step 4: Fill the basic details, then click Review $ Create with the default settings and await deployment.
create

Step 5: Once deployment is complete, click Go to resource to view your new IoT Hub.
GtR

NOTE: The newly created IoT Hub has no connected devices, so all information and messages will be empty(0).
Usage

Step 6: From the Overview menu, select Device management dropdown and choose Devices and then choose Add device to create one.
Add device

Step 7: Enter the device ID and save.
Device ID

Step 8: Click on the added IoT device, note the primary connection string copy it.
PCS

Step 9: Search for Azure Raspberry Pi simulator in your browser and click on the Raspberry Pi Azure IoT simulator option.
RASPBERRY
NOTE: There is display of Raspberry Pi with the LED off, suggesting it hasn't been connected.
RASD

Step 10: Next to the Raspberry Pi diagram, edit the placeholder in line 15 and paste the primary connection string. Then click Run at the bottom of the script.
RUN
NOTE: Once you run it, the device will blink the LED to indicate a successful connection.
BLK

Step 11: Check the response script for message count and refresh the IoT Hub overview page to see the messages sent.
Coonnected

CONGRATULATIONS! You've successfully created an IoT Hub and connected a device.

Top comments (2)

Collapse
 
olashubomi_rahman_79ed5dc profile image
Olashubomi Rahman

Nice πŸ‘

Collapse
 
god_win profile image
Godwin Oyindamola

Thanks my boss πŸ™