Reader small image

You're reading from  The Azure IoT Handbook

Product typeBook
Published inDec 2023
PublisherPackt
ISBN-139781837633616
Edition1st Edition
Right arrow
Author (1)
Dan Clark
Dan Clark
author image
Dan Clark

Dan Clark is a senior developer and data engineer specializing in Microsoft technologies. He is focused on learning new AI and data technologies and training others on how to best implement those technologies. He has worked as an Azure Technical Trainer (ATT)for Microsoft and has over 25 years of experience as a Microsoft Certified Trainer. Dan has published several books and numerous articles on Microsoft technologies. He is a regular speaker at various developer and database conferences and user group meetings and enjoys interacting with the Microsoft communities.
Read more about Dan Clark

Right arrow

Exploring IoT Edge Computing

In the ever-evolving landscape of technology, the Internet of Things (IoT) has emerged as a transformative force, connecting devices, sensors, and systems to enable seamless communication and data exchange. However, as the IoT continues to expand, it faces several challenges, including latency, bandwidth limitations, security concerns, and the sheer volume of data generated. To address these obstacles and unlock the true potential of the IoT, a revolutionary approach has emerged: IoT Edge computing.

In this chapter, we delve into the realm of IoT Edge computing, where intelligence and processing capabilities are pushed closer to the network edge. Rather than solely relying on cloud-based servers for data analysis and decision-making, IoT Edge computing brings computation, storage, and analytics closer to the devices and sensors themselves. By doing so, it empowers organizations and individuals to harness real-time insights, make timely decisions, and...

Azure IoT Edge devices

Azure IoT Edge devices are physical devices that can run the Azure IoT Edge runtime, a component of the Azure IoT Edge service provided by Microsoft. Azure IoT Edge is a platform that enables users to deploy and manage cloud workloads on edge devices, bringing the power of the cloud closer to devices generating data.

Azure IoT Edge devices can include a wide range of devices, including industrial equipment, gateways, sensors, and cameras. These devices are typically located at the edge of a network, closer to where the data is generated, and have more compute and storage compared to typical IoT devices. By deploying the Azure IoT Edge runtime on these devices, users can run cloud services and AI models directly on the devices, enabling real-time data processing, analytics, and decision-making at the edge.

Some key features and capabilities of Azure IoT Edge devices include:

  • Edge computing: Azure IoT Edge devices can process and analyze data locally...

Deploying an IoT Edge device

To deploy an Azure IoT Edge device, you typically need to follow these key steps:

  1. Set up an Azure IoT hub: Create an Azure IoT hub, which acts as a central messaging hub for bi-directional communication between your edge devices and the cloud. This hub will manage device identities, security, and message routing, just as it does for the devices as well.
  2. Provision the IoT Edge device: Register and provision your physical device as an Azure IoT Edge device. This involves creating a device identity within the IoT hub and generating the necessary security credentials (for example, device connection string or X.509 certificate) to authenticate the device with the hub. The following screenshot shows how to set up an IoT Edge device; you can see that you just have to check the box indicating the device is an IoT Edge device:

Figure 9.1 – Provisioning an edge device

  1. Install and configure the Azure IoT Edge runtime...

Exploring EdgeAgent

The EdgeAgent module is a crucial component of an Azure IoT Edge device and is part of the IoT runtime. Its purpose is to manage the life cycle and deployment of modules on the IoT Edge device. Here are some key functions and responsibilities of the EdgeAgent module:

  • Module management: The EdgeAgent module is responsible for managing modules running on the IoT Edge device. It coordinates the deployment, starting, stopping, and removal of modules based on the desired state specified in the deployment manifest.
  • Communication with IoT Hub: The EdgeAgent module establishes and maintains a secure connection with Azure IoT Hub. It acts as the intermediary between the IoT hub and the modules running on the edge device, facilitating bi-directional communication.
  • Deployment synchronization: The EdgeAgent module continuously syncs with Azure IoT Hub to ensure that the deployment manifest is up to date. If there are changes in the desired state of modules ...

Exploring EdgeHub

The EdgeHub module is another core module within the Azure IoT Edge runtime, and its purpose is to enable communication and message routing between modules running on an IoT Edge device. Here are the key purposes and functionalities of the EdgeHub module:

  • Message routing: The EdgeHub module acts as a message broker, facilitating communication between modules running on the IoT Edge device. It receives messages from the modules and routes them to the appropriate destination modules based on message routing rules defined in the deployment manifest.
  • Local communication: The EdgeHub module allows modules to communicate with each other locally within a device. Modules can send messages to other modules running on the same device through EdgeHub, enabling modular and decoupled application architectures.
  • Cloud connectivity: The EdgeHub module establishes a secure connection with Azure IoT Hub, enabling bi-directional communication between the IoT Edge device...

Computing and storage on the edge

There are many different modules you can download and install on your IoT Edge devices. These include modules supplied by Microsoft and third-party industry-specific modules. You can even create your own module to use on your devices. These include modules for blob storage, SQL Database, video analysis, and analytics, to name just a few.

Installing these in the Azure portal is pretty straightforward. Navigate to the IoT hub device and then go to Set modules on device. From there, you can select an IoT Edge module to install:

Figure 9.3 – Setting up modules on an edge device

The easiest option is to select Marketplace Module. This will show you modules developed by Microsoft and various third-party software developers:

Figure 9.4 – Viewing the Marketplace module

In this chapter, we will use a virtual machine (VM) to act as our IoT virtual device. The VM has the IoT Edge runtime installed...

Using an edge device as a gateway

An IoT Edge device performs protocol translation by acting as an intermediary that can understand and convert data between different communication protocols used by IoT devices and the central data center or cloud. This capability is crucial in IoT systems where various devices may communicate using different protocols, and it’s necessary to establish interoperability and ensure a seamless data flow between them.

Here’s how an IoT Edge device typically performs protocol translation:

  1. Data collection: The IoT Edge device first collects data from the local IoT devices within its network. These devices could be using different communication protocols, such as MQTT, CoAP, Zigbee, Z-Wave, Modbus, Bluetooth, LoRaWAN, or various proprietary protocols.
  2. Protocol detection: Upon receiving data from the IoT devices, the edge device examines the incoming data packets to identify the source communication protocol. It needs to recognize...

Lab – implementing stream analytics on the edge

In this lab, you will do the following:

  • Create an Azure Stream Analytics (ASA) job configured to process data on the edge
  • Connect the ASA job with other IoT Edge modules running on the same edge device
  • Configure the data flow between the Stream Analytics module and other modules using IoT Edge routes

Let’s accomplish the aforementioned tasks by following these steps:

  1. Go to your Azure subscription, open up the Cloud Shell, and make sure you are in the Bash environment. If this is your first time opening up the Cloud Shell in the portal, you will be asked to create an Azure Storage account to support the Cloud Shell.
  2. Run the following command in the Cloud Shell to create a resource group:
    az group create –name IoTEdgeResources --location eastus2

    You can change the location to a supported one closer to you (for a list of region capabilities, see here: https://azure.microsoft.com/en-us...

Summary

In this chapter, we explored the concept of IoT Edge computing, which involves moving intelligence and processing capabilities closer to the network edge. Unlike traditional reliance on cloud-based servers for data analysis and decision-making, IoT Edge computing enables computation, storage, and analytics to be brought nearer to the devices and sensors. This approach empowers both organizations and individuals to leverage real-time insights, make prompt decisions, and optimize the advantages of the IoT.

In today’s data-driven landscape, the ability to gain insights from real-time data is more critical than ever. As organizations strive to make data-informed decisions and respond swiftly to changing conditions, the demand for effective tools to visualize streaming data has surged. The next chapter delves into the exciting world of visualizing streaming data using Power BI, a powerful business intelligence (BI) and data visualization platform developed by Microsoft...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
The Azure IoT Handbook
Published in: Dec 2023Publisher: PacktISBN-13: 9781837633616
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Dan Clark

Dan Clark is a senior developer and data engineer specializing in Microsoft technologies. He is focused on learning new AI and data technologies and training others on how to best implement those technologies. He has worked as an Azure Technical Trainer (ATT)for Microsoft and has over 25 years of experience as a Microsoft Certified Trainer. Dan has published several books and numerous articles on Microsoft technologies. He is a regular speaker at various developer and database conferences and user group meetings and enjoys interacting with the Microsoft communities.
Read more about Dan Clark