DEV Community

Cover image for How to create IoT Hub and connect it Raspberry Pi Simulator
Olalekan Oladiran
Olalekan Oladiran

Posted on Edited on

How to create IoT Hub and connect it Raspberry Pi Simulator

What is IoT?

IoT stands for Internet of Things.
Secure and dependable connectivity between your IoT solution and the devices it controls is made possible by Azure IoT Hub. In order to connect devices, IoT Hub offers a cloud-hosted solution backend with scaled provisioning, device management, and per-device authentication.

How does it works?

Main Azure PaaS (Platform as a Service) that facilitates bidirectional connectivity between IoT devices and a cloud solution is Azure IoT Hub. Any IoT solution begins with the IoT Hub, which also includes certain crucial features that are shared by all IoT implementations. These include security, networking, computing, and storage capacities.

Creating IoT Hub on Azure portal

  1. Sign in to the Azure Portal: -Open your web browser and go to the Azure Portal. -Sign in with your Azure account.
  2. Navigate to "Create a resource":
  3. In the left sidebar, click on "Create a resource" or the "+" icon.
  4. Search for "IoT Hub":
  5. In the "Search the Marketplace" box, type "IoT Hub" and press Enter.
  6. Select "IoT Hub" from the results:
  7. In the search results, click on "IoT Hub" from the list of services.
  8. Click "Create":
  9. On the "IoT Hub" page, click the "Create" button to start the creation process.
  10. Fill the basic information
  11. select your subscription
  12. select or create a resource group
  13. create the IoT hub name
  14. Select region
  15. click Review + create
  16. After validation, click create and wait for it to deploy.
  17. once the deployment is complete, click go to resource
  18. Select devices
  19. Click add device
  20. Choose and type a Device ID and leave the rest as default.
  21. Click save
  22. Click on your device under Device ID
  23. Copy primary connection string

How to connect IoT Hub to Raspberry pi Simulator

  • Use this link to go directly to Raspberry Pi Simulator https://azure-samples.github.io/raspberry-pi-web-simulator/
  • On line 15, remove what is written between the '' and paste your copied primary connection string.  Notice that the led light does not blink before connecting, also the message used today and IoT devices in the IoT overview page before connect must 0 and 0 respectively.
  • Click run
  • The light on the simulator will start blinking and you will see sending message column

  • You can also check for the message in IoT overview

Top comments (0)