Logo

dev-resources.site

for different kinds of informations.

Building a Practical IoT Solution with Azure IoT Hub: From Device Setup to Telemetry Data Storage

Published at
12/14/2024
Categories
azure
iot
cloudcomputing
Author
unique-tea
Categories
3 categories in total
azure
open
iot
open
cloudcomputing
open
Author
10 person written this
unique-tea
open
Building a Practical IoT Solution with Azure IoT Hub: From Device Setup to Telemetry Data Storage

Introduction

In an era where connectivity is the heartbeat of modern innovation, the Internet of Things (IoT) stands at the forefront, linking billions of physical devices and enabling seamless data exchange. Azure IoT Hub is pivotal in this ecosystem as a managed cloud service that provides reliable and secure communication between IoT applications and devices. With over ten billion devices already connected worldwide and multiplying, Azure IoT Hub simplifies scaling to manage vast networks efficiently. This service is the foundation for numerous applications, from smart homes to industrial automation and healthcare, helping businesses enhance productivity, drive data-driven decision-making, and open up new revenue streams.

Architectural diagram

Image description

Step 1: Set Up an Azure IoT Hub

  1. Create an Azure IoT Hub Instance:

    • Sign in to your Azure portal. Azure portal
    • In the left sidebar, click on Create a resource > Internet of Things > IoT Hub. IoT Hub
    • Fill out the basic details:
      • Subscription: Choose your subscription.
      • Resource Group: Create a new resource group or select an existing one.
      • Region: Select the region closest to you or your data center.
      • IoT Hub Name: Provide a unique name for your IoT Hub.
      • Pricing and Scale: Choose the Free tier or any suitable tier based on your needs. Basics
    • Click Review + Create and then Create. Review + Create
  2. Access Your IoT Hub Connection String:
    Go to resources

    • Once the IoT Hub is deployed, go to the Overview section and copy the Connection string from the Access keys tab. You’ll need this later to connect the simulated device. Connection string

Step 2: Register a Device

  1. Navigate to the Device Management Section:
    • In your IoT Hub instance, click on IoT devices under Device Management.
  2. Add a New Device: New Device
    • Click + New to add a new device.
    • Provide a Device ID (e.g., my-iot-device).
    • Set the Authentication type to Symmetric key (this is the default option).
    • Click Save to register the device. Device ID
  3. Copy the Device Connection String:
    • After registering the device, select it and go to Device details. Device details
    • Copy the Primary connection string as you will use it to simulate the device. Primary connection string
    • Access Raspberri Pi online simulator, consisting of the Assembly Area, Coding Area and the Integrated console window via the link
https://azure-samples.github.io/raspberry-pi-web-simulator/#GetStarted
Enter fullscreen mode Exit fullscreen mode
  • Edit line number 15 of the coding area by replacing [Your IoT hub device connection string]with the Primary connection string Primary connection
  • Select run
  • On the existing Azure IoT hub space created, send a message to Raspberri Pi by selecting Message to device Message to device
  • Type the message in the Message Body box, then Click Send Message
  • Stop the Raspberri Pi Integrated console window to view the message sent. Message Raspberri Pi

Create IoT Hub, connect Android IoT Plug and send File data

Step 1: Download IOT Plug and Play App

https://apkpure.com/iot-plug-and-play/com.iot_pnp
Enter fullscreen mode Exit fullscreen mode
  • Install the IoT App> Scan OR code > Connect via IoT device connection string> Upload a file Connect IoT Upload image Telemetry

Step 2: Create an Azure Blob Storage Account

  1. Add Message routing
    • In Hub settings icon, select Message routing then click +Add Message routing
    • Fill out Endpoint details. In the Azure storage container, Pick a container Pick a container
  2. Set Up Blob Storage (if not available):

    • Navigate to Create a resource > Storage > Storage account. Storage account
    • Complete the form with:
      • Subscription: Your subscription.
      • Resource Group: Choose the existing resource group or create a new one.
      • Storage account name: Provide a unique name.
      • Region: Match it with your IoT Hub region.
      • Performance and Redundancy: Choose the desired options (e.g., Standard and Locally redundant storage (LRS)). Locally redundant storage (LRS)
    • Click Review + Create and then Create.
  3. Create a Container:
    Container

    • Go to your newly created storage account. Click Containers under Data storage. Data storage
    • Click + Container, name it (e.g., myiotcontainer1), and set the access level to Private. + Container File Upload
  4. Upload a file (from step 1 Android App)

    • Go to your Azure IoT Hub> Container Container check
    • IoT Hub iotdevice

Under Device-to-cloud messages, you can check if the telemetry data is being received.

  • Verify that JSON files are appearing as the device sends telemetry data. Blob Image Image Blob uploaded

Conclusion

Building an IoT solution with Azure IoT Hub shows how technology can enable real-time data transfer and transform industries. By connecting millions of devices securely, it supports smarter, safer, and more connected environments. With this foundation, you can explore other Azure capabilities like IoT Central, IoT Edge, and Digital Twins to expand your IoT ecosystem. Embracing IoT with Azure means leading in innovation and operational excellence.

iot Article's
30 articles in total
Favicon
IOT: Dynamic Deep Sleep Configuration for ESP8266 and ESP32 Boards
Favicon
Edge Computing: The Future of Scalable and Low-Latency Applications
Favicon
POST ABOUT THE TRENDS IN WEB DEVELOPMENT
Favicon
Home Assistant: How to Fix API Disconnection and False Positive Sensor Readings with ESP8266 Boards
Favicon
Smart Manufacturing with Industrial IoT Solutions
Favicon
Theta Technolabs Recognized as One of the 10 Most Prominent IoT Solutions Providers to Watch – 2024 by Insights Success
Favicon
Prototipos rápidos con Wokwi, ESP32 y AWS IoT Core
Favicon
Pumpkins in the Cloud: control your Jack-o-Lantern with Azure IoTHub!
Favicon
Smart Home Security: Advanced Motion Detection with CCTV
Favicon
How IoT Device Management Improves Energy Efficiency in Smart Homes
Favicon
Tech Innovations of 2024 That Will Shape 2025
Favicon
The Future of Water Management: Innovations in Water Level Monitoring Systems
Favicon
Optimizing Environmental Resource Management with IoT and AI Integration
Favicon
The Future of CNC Machining in 3PL and Its Potential to Drive Innovation and Efficiency
Favicon
The Role of IoT Device Management in Smart Water Systems
Favicon
Benefits of a Smart Irrigation System Using IoT for Sustainable Farming
Favicon
Securing IoT Devices: Challenges and Solutions
Favicon
How I Used LLMs to Make IoT Devices Understand Any Language
Favicon
Serverless self-service IoT certificate management - Part 2
Favicon
What Are IoT SIM Cards, and Why Are They Revolutionizing Connectivity?
Favicon
The Future of IoT Consulting in an AI-Driven World
Favicon
Matter protocol on a budget
Favicon
Simplify IoT Device Updates with Azure Device Update for IoT Hub
Favicon
Building a Practical IoT Solution with Azure IoT Hub: From Device Setup to Telemetry Data Storage
Favicon
Phone connection
Favicon
Why Choose the MQTT Protocol for your IoT Devices (with some caveats)
Favicon
InfluxDB: Optimize your Data with Data Retention Policies and Continuous Queries
Favicon
2025: IoT in Healthcare Revolutionizing Patient Care
Favicon
Secure Updates Drive Efficiency in Smart Energy Systems
Favicon
Bootable USB Drive Linux Streamlining OTA Updates for Smart Energy

Featured ones: