A Beginners Guide on How to connect a Raspberry Pi Simulator to a Device on IoT Hub
Yemisi Oyesainu
Posted on April 28, 2023
Internet of Things
IoT, Internet of Things, is the ability of connected devices to communicate with each other.
Azure IoT Hub is a bidirectional messaging centre that is hosted in the cloud where messages from an IoT application and its attached IoT devices are collected over the internet. The internet can be used to connect any device that can be compatible with the required sensor and software.
Lets move on to our task of the day!
STEPS
(1) Log in to your Azure Portal with your azure account
(2) Type IoT Hub in the Search box and click on the IoT hub displayed
(3) Click on Create
(4) Complete the following details as outlined:
Project Details
Subscription: Azure Pass Subscription(as the case may be)
Resource Group: Create a resource group .I will name it AprilWorkload
Instance Details:I will use YemmyIoT
Region: Select the Region where you want the IoT Hub to reside. Here, I will select East US
Leave the **Tier and Daily Message Limit at default
I.e Tier: Standard
Daily Message Limit:400,000
(5) Click on Review and Create
(6) Click on Create and wait for it to be fully deployed
(7) Go To Resource
At this point note the followings:
IoT Hub Usage:
Message Used Today:0
IoT Device:0
These indicates that no message has been sent and no device has been connected
(8) On the IoT Hub created, click on Devices and then click Add Device
Under the Device ID, create a name for the device.I will name it Abby
Leave other parameters at default and click on Save
(9) Click on IoT device Abby just added to the IoT Hub
(10) Go to the Primary Connection String, click on the eye symbol to view the Connection String and then copy the String
(11) At this point we will need to connect a Raspberry Pi Simulator. Go to your web browser and search for it.
Select "Raspberry Pi Azure IoT Web Simulator".
A Raspberry Pi Simulator enables you to test out your projects without the the use of a physical Raspberry Pi. This is because the Raspberry Pi and other electronic components in your project are digitally emulated.It is economical while it also saves time and effort.
(12) Go to the Raspberry Pi Simulator opened on your browser, and replace the placeholder in Line 15 with the Primary Connection String you copied in Step 10 above
(13) Click on Run so that the Raspberry Pi Simulator start sending messages to the IoT Hub
The Red light of the Simulator will start blinking indicating that messages is being sent to the Azure IoT Hub
(14) For confirmation of the messages sent as evidence that the Raspberry Pi has been connected to the Azure IoT Hub, go back to the Overview page on the IoT Hub, check the IoT Hub Usage
Message Used Today: 239
IoT Device: 1
Ohla! Messages has been sent. The Raspberry Pi Simulator has been connected to the Azure IoT Hub
Posted on April 28, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.