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. Image description
  4. Search for "IoT Hub":
  5. In the "Search the Marketplace" box, type "IoT Hub" and press Enter. Image description
  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. Image description
  10. Fill the basic information
  11. select your subscription
  12. select or create a resource group Image description
  13. create the IoT hub name
  14. Select region Image description
  15. click Review + create Image description
  16. After validation, click create and wait for it to deploy. Image description Image description
  17. once the deployment is complete, click go to resource Image description
  18. Select devices Image description
  19. Click add device Image description
  20. Choose and type a Device ID and leave the rest as default. Image description
  21. Click save Image description
  22. Click on your device under Device ID Image description
  23. Copy primary connection string Image description

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/ Image description
  • On line 15, remove what is written between the '' and paste your copied primary connection string. Image description 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
    Image description

  • You can also check for the message in IoT overview
    Image description

Top comments (0)