HOW TO CREATE AN AZURE IoT HUB AND CONFIGURE THE HUB TO AUTHENTICATE A CONNECTION TO AN IoT DEVICE USING RASPBERRY PI SIMULATOR

The Azure Internet of Things (IoT) is a collection of Microsoft-managed cloud services, edge components, and SDKs that let you connect, monitor, and control your IoT assets at scale. An IoT solution is made up of IoT devices that communicate with clo…


This content originally appeared on DEV Community and was authored by Toluwani Oluwaloseyi

Image description

The Azure Internet of Things (IoT) is a collection of Microsoft-managed cloud services, edge components, and SDKs that let you connect, monitor, and control your IoT assets at scale. An IoT solution is made up of IoT devices that communicate with cloud services.

Azure IoT Hub is a managed service hosted in the cloud that acts as a central message hub for communication between an IoT application and its attached devices. You can connect millions of devices and their backend solutions reliably and securely. Almost any device can be connected to an IoT hub.

Raspberry Pi Simulator can serve as the 'Internet Gateway' for IoT devices. When powered by a Cloud network, it acts as a web server for uploading and transiting sensor data on IoT platforms.

Step 1:

Visit portal.azure.com, login or sign up if you don't have an account, you can get a free account at azure.microsoft.com/en-us/free/

Step 2:

Search for IoT Hub and click on create

Image description

Step 3:

1.Subscription: Choose the subscription where you wish to create the resource.
2.Resource group: Choose the resource group where you wish to create the resource. If you wish to create a new group click on create a new option.
3.IoT Hub name: Enter a preferred unique name.
4.Region: Select the location where you wish to create the account.
Click on "Review and Create"

Image description

Step 4:

Click on "create"

Image description

Step 5:

Your IoT Hub has been created, so click on "Go to Resource"

Image description

Step 6:

To connect an IoT Device, Click on "Devices", then "add device"

Image description

Image description

Step 7:

Choose a device ID name(I used my name). Every other thing should be left on default, then click on save.
Your IoT Device has been created.

Image description

Image description

Step 8:

To Connect your IoT device to a Raspberry Pi Simulator, open a new tab and search for Raspberry Pi Azure IoT Online Simulator. After opening it, you'll notice that there's no blinking on the red stuff and that's because it is switched off but after we work with, it'll be switched on and begin to blink.

Image description

Step 9:

Go back to Azure Portal, Click on the IoT Device that was added.
1.Go to 'primary connection string'.
2.Click on it to show then copy to clipbord

Image description

Image description

Step 10:

Go back to the Raspberry Pi Simulator, look at line number 15 - remove the place holder Your IoT hub device connection string without touching the apostrophes

Image description

Step 11:

Paste in between the apostrophes, what was copied from the 'primary connection string in step 9.

Image description

Step 12:

Click on run, you'll also notice that the red button is now switched on and blinking and the Raspberry Pi is now sending messages to the IoT device and Hub.

Image description

Image description

Please note: To be sure that the device has been connected, go back to the azure portal and click on the IoT hub you created, then click on "overview", you'll be able to monitor the IoT hub usage and the number of messages coming in.

Image description

Thanks for reading...


This content originally appeared on DEV Community and was authored by Toluwani Oluwaloseyi


Print Share Comment Cite Upload Translate Updates
APA

Toluwani Oluwaloseyi | Sciencx (2023-05-09T19:15:11+00:00) HOW TO CREATE AN AZURE IoT HUB AND CONFIGURE THE HUB TO AUTHENTICATE A CONNECTION TO AN IoT DEVICE USING RASPBERRY PI SIMULATOR. Retrieved from https://www.scien.cx/2023/05/09/how-to-create-an-azure-iot-hub-and-configure-the-hub-to-authenticate-a-connection-to-an-iot-device-using-raspberry-pi-simulator/

MLA
" » HOW TO CREATE AN AZURE IoT HUB AND CONFIGURE THE HUB TO AUTHENTICATE A CONNECTION TO AN IoT DEVICE USING RASPBERRY PI SIMULATOR." Toluwani Oluwaloseyi | Sciencx - Tuesday May 9, 2023, https://www.scien.cx/2023/05/09/how-to-create-an-azure-iot-hub-and-configure-the-hub-to-authenticate-a-connection-to-an-iot-device-using-raspberry-pi-simulator/
HARVARD
Toluwani Oluwaloseyi | Sciencx Tuesday May 9, 2023 » HOW TO CREATE AN AZURE IoT HUB AND CONFIGURE THE HUB TO AUTHENTICATE A CONNECTION TO AN IoT DEVICE USING RASPBERRY PI SIMULATOR., viewed ,<https://www.scien.cx/2023/05/09/how-to-create-an-azure-iot-hub-and-configure-the-hub-to-authenticate-a-connection-to-an-iot-device-using-raspberry-pi-simulator/>
VANCOUVER
Toluwani Oluwaloseyi | Sciencx - » HOW TO CREATE AN AZURE IoT HUB AND CONFIGURE THE HUB TO AUTHENTICATE A CONNECTION TO AN IoT DEVICE USING RASPBERRY PI SIMULATOR. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2023/05/09/how-to-create-an-azure-iot-hub-and-configure-the-hub-to-authenticate-a-connection-to-an-iot-device-using-raspberry-pi-simulator/
CHICAGO
" » HOW TO CREATE AN AZURE IoT HUB AND CONFIGURE THE HUB TO AUTHENTICATE A CONNECTION TO AN IoT DEVICE USING RASPBERRY PI SIMULATOR." Toluwani Oluwaloseyi | Sciencx - Accessed . https://www.scien.cx/2023/05/09/how-to-create-an-azure-iot-hub-and-configure-the-hub-to-authenticate-a-connection-to-an-iot-device-using-raspberry-pi-simulator/
IEEE
" » HOW TO CREATE AN AZURE IoT HUB AND CONFIGURE THE HUB TO AUTHENTICATE A CONNECTION TO AN IoT DEVICE USING RASPBERRY PI SIMULATOR." Toluwani Oluwaloseyi | Sciencx [Online]. Available: https://www.scien.cx/2023/05/09/how-to-create-an-azure-iot-hub-and-configure-the-hub-to-authenticate-a-connection-to-an-iot-device-using-raspberry-pi-simulator/. [Accessed: ]
rf:citation
» HOW TO CREATE AN AZURE IoT HUB AND CONFIGURE THE HUB TO AUTHENTICATE A CONNECTION TO AN IoT DEVICE USING RASPBERRY PI SIMULATOR | Toluwani Oluwaloseyi | Sciencx | https://www.scien.cx/2023/05/09/how-to-create-an-azure-iot-hub-and-configure-the-hub-to-authenticate-a-connection-to-an-iot-device-using-raspberry-pi-simulator/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.