Microsoft Azure offers Azure IoT Hub, a robust managed service that serves as a single hub for managing and connecting Internet of Things (IoT) devices. Let us examine the specifics:
Objective and Usability: Central Hub: The foundation of all IoT applications developed on the Azure platform is Azure IoT Hub. It makes it easier for cloud services and Internet of Things devices to communicate seamlessly. Secure and consistent connectivity is guaranteed between your IoT application and the devices it is linked to.
Scalability: An IoT Hub instance may be linked to millions of devices.
Device Management: The IoT Hub has tools for managing, authenticating, and provisioning devices.
Important characteristics:
Device-to-Cloud Telemetry: Gather information from gadgets to comprehend their condition and actions.
Cloud-to-Device Messages: Notifications and orders can be sent to linked devices from the cloud.
Security and Authentication: To improve security, authenticate every device separately.
Automate the registration and provisioning of devices.
Over-the-Air Updates: Update firmware and software on devices to keep them current.
Integration with Azure Services: You can effortlessly include Event Grid, Azure Functions, and other Azure services with ease.
IoT Edge Integration: Use Azure IoT Edge to expand your solution from the cloud to the edge.
Use Cases:
Smart Cities: Keep an eye on and control traffic signals, trash cans, lamps, etc.
Industrial IoT: Monitor the condition of machinery, enhance productivity, and raise security.
Healthcare: Keep an eye on hospital facilities, medical equipment, and patient vitals.
Agriculture: Gather information with sensors in cattle, greenhouses, and fields.
Retail: Track assets, keep an eye on inventories, and improve customer service.
Practical steps using a mobile device (Samsung phone).
Set Up Azure IoT Hub.
Register a Simulated Device (Samsung phone).
Simulate the Device
Azure Blob Storage Integration.
Step 1: Set Up Azure IoT Hub
Log in to your Azure account.
Search for “IoT Hub” and click “+ Add.”
Configure the settings below:
Name: Choose a unique name for your IoT Hub.
Pricing Tier: Select the appropriate tier based on your requirements.
Resource Group: Create a new one or use an existing group.
Region: Choose a region close to your devices.
- Click on Review + Create
Step 2: Register a Simulated Device.
Create a Simulated Device:
- From your IoT Hub overview page:
Click Device from the Device management blade.
- Select + Add device.
Provide the Device ID
Choose an authentication type (e.g., symmetric key).
Leave the default values of the other fields and select Save.
- Go to the Device Overview page and click the newly created device (Samsungphone).
On your device (The smart phone in this case the Samsung phone), go to Playstore and download the app called IoT PnP
On the landing page, click on Scan QR code as indicated below.
- Click on Manually connect.
- Select the IoT Hub device connection string radio button.
- Paste the Primary Connection String in the IoT Hub device connection string field and click the Connect button.
- The telemetry data of the phone is displayed.
Azure Blob Storage Integration
- Navigate to the IoT device overview page and select Message routing from the Hub settings blade.
Select + Add to add a route.
Select Storage as the Endpoint type, provide the Endpoint name and select the Jason as the encoding type.
Click on the Pick a container button to begin creating a storage account.
- Click the + Storage account option to create a storage account.
- Provide the Storage details as indicated in the screenshot below and click the Ok button:
- Select the created storage account (phonestorage).
- Create a Container.
- Click on Create to provision the container (phonefiles) .
- Select the container created.
- Click the Create + next button to proceed.
- Enter a route name and select a Device Telemetry message in the Data source drop-down and click Test to test the route.
- Click the _Create + add enrichment button.
- Click the Add button.
- Navigate to the created IoT hub212 and select File upload from the Hub settings blade.
- Select Azure storage container.
- Select the created container (phonefiles).
- Turn on file notification settings then click save.
- From your mobile phone, click on Image upload.
- Upload an image from your phone.
- Navigate to your Blob Storage to view the uploaded file.
The uploaded files.
Viewing the telemetry data using Visual studio code.
Navigate to the storage folder and download the Json files and view them in Visual studio code editor.
- For Bi-directional data, from your mobile phone, click on the Properties tab from the IoT plug n Play app.
- Click on the Editable property tile, edit it with any word or sentence and click on Send.
- Navigate to the IoT hub and select the created device (Samsungphone) .
Click on device twin.
The edited string now appears in line 37 of the Json code.
This simulation demonstrated the seamless integration between our device and Azure IoT Hub. Here are the key takeaways:
Data Persistence in Azure Blob Storage:
Our device successfully saved telemetry data to Azure Blob Storage.
This demonstrates the reliability and scalability of our chosen solution.
Telemetry Monitoring:
We monitored the telemetry data from our mobile device, gaining valuable insights, and archived logs for auditing and troubleshooting.
Real-time monitoring allows us to make informed decisions promptly.
Exploring Further Use Cases:
Beyond this simulation, there are numerous other scenarios we can explore: Image Storage: Store images captured by our devices.
Streaming Data: Process real-time streams from sensors.
Data Archiving: Long-term storage for compliance or historical analysis.
Kindly comment, like and share.