DEV Community

Cover image for A Beginners Guide on How to connect a Raspberry Pi Simulator to a Device on IoT Hub
Yemisi Oyesainu
Yemisi Oyesainu

Posted on

A Beginners Guide on How to connect a Raspberry Pi Simulator to a Device on IoT Hub

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

Image description

(2) Type IoT Hub in the Search box and click on the IoT hub displayed

Image description

(3) Click on Create

Image description

(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

Image description

Instance Details:I will use YemmyIoT
Region: Select the Region where you want the IoT Hub to reside. Here, I will select East US

Image description

Leave the **Tier and Daily Message Limit at default
I.e Tier: Standard
Daily Message Limit:400,000

Image description

(5) Click on Review and Create

Image description

(6) Click on Create and wait for it to be fully deployed

Image description

Image description

(7) Go To Resource

Image description

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

Image description

(8) On the IoT Hub created, click on Devices and then click Add Device

Image description

Image description

Under the Device ID, create a name for the device.I will name it Abby
Leave other parameters at default and click on Save

Image description

(9) Click on IoT device Abby just added to the IoT Hub

Image description

(10) Go to the Primary Connection String, click on the eye symbol to view the Connection String and then copy the String

Image description

(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".

Image description

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

Image description

Image description

Image description

(13) Click on Run so that the Raspberry Pi Simulator start sending messages to the IoT Hub

Image description

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

Image description

Message Used Today: 239
 IoT Device: 1
Enter fullscreen mode Exit fullscreen mode

Ohla! Messages has been sent. The Raspberry Pi Simulator has been connected to the Azure IoT Hub

Top comments (0)