DEV Community

Cover image for How to Connect an IoT field device(Raspberry Pi simulator) from the field to an Azure Cloud IoT Hub for communication and data.
Henry
Henry

Posted on

How to Connect an IoT field device(Raspberry Pi simulator) from the field to an Azure Cloud IoT Hub for communication and data.

Step 1. Login into your Account, search for “IoT Hub” and click create

Image description

Image description
Step 2. Create your IoT Hub by entering the necessary details(Resource group, Hub name, region), you can choose from a resource group which you have created or create another one , depending on your project. Continue through next, then review and create.

Image description

Image description
Then wait for deployment to be complete and go to resource.

Image description

Image description
Then check the IoT Hub details to confirm details., click on devices

Image description
*Step 3 : Create devices on the IoT devices hub *

Image description
*Create (Name, select “symmetric key”), and save *

Image description

Image description
*Click on the device and copy the “Primary connection string” and make sure it is enabled to IoT Hub to enable it communicate to the field device communication port. *

Image description
Then go to https://azure-samples.github.io/raspberry-pi-web-simulator/, insert the “Primary connection string from the IoT device on azure portal into “Line 15” on the raspberry pi simulator and click run button the red indicator on the raspberry pi must blink to confirm communication

Image description

Image description
Now from above you can see your raspberry pi simulator is communicating with the IoT device in azure portal and recording messages and data, now go back to the IoT hub Below shows the communication is established and everything is fine
CONGRATULATIONS, YOU HAVE CREATED AND CONNECTED AN IoT DEVICE FROM AZURE TO A FIELD DEVICE (RASPBERRY PI SIMULATOR).

Image description

Top comments (1)

Collapse
 
memorycard profile image
Micheal Farounbi

Thinking of how I can actually replicate this for a project I have at hand already. This is indeed insightful. I have a challenge I would want to discuss with you in private though, if you don’t mind.