DEV Community

Cover image for CREATE IoT HUB TO CONNECT TO AN IOT DEVICE USING RASPBERRY PI SIMULATOR
Fred Chukwuma
Fred Chukwuma

Posted on • Edited on

CREATE IoT HUB TO CONNECT TO AN IOT DEVICE USING RASPBERRY PI SIMULATOR

STEP 1: In the smart search box, type IOT HUB and click on the grayed area which is highlighted.

Image description

STEP 2: click on create and you will be directed to a new tab

Image description

STEP 3: Fill the descriptions in the tab.

  • Resource group: If you don't have one you can create a new one but if you do have one, just select your resource group in the resource group tab.

  • IoT hub name: Give your IoT hub a name that is okay with you.

  • Region: Select a region that you want. remember to put cost in place when doing this.

then click on review + create. You wait for it to deploy

Image description

STEP 4: Open google and search for https://azure-samples.github.io/ A raspberry pi Azure simulator will open for you.

Image description

STEP 5: After it's done deploying, click on go to resource

Image description

STEP 6: Click on device

Image description

STEP 7: For you to create a new device, click on add device

Image description

STEP 8: Just give a name to your device ID and leave the rest on default and click on save.

Image description

STEP 9: Check the box and click on your device name

Image description

STEP 10: scroll down to Primary connection string and copy the key.

The primary connection string is a string of characters or text used to establish a connection to a database or other networked service. It contains information that allows a client application or program to connect to the service.

Image description

Step 11: Go to your raspberry pi simulator page, on line 15, clear what you see inside the quotes and just leave the quotes sign. then paste your primary connection string inside the quotes.

Image description

STEP 12: Click run. when you do, you wil notice the simulator blinking, it means it has started working and sending messages.

Image description

To check if it is sending messages, go back to your Azure tab and click on devices.

Image description

Click on overview

Image description

Scroll down and check IoT Hub usage box and look at the messages used today, you will notice it keeps increasing.

Image description

You are welcome!

Top comments (0)