Convert Figma logo to code with AI

Azure logoiotedge

The IoT Edge OSS project

1,453
458
1,453
104

Top Related Projects

Open-source IoT Platform - Device management, data collection, processing and visualization.

1,241

PLC4X The Industrial IoT adapter

Quick Overview

Azure IoT Edge is an open-source platform that extends cloud intelligence and analytics to IoT edge devices. It enables devices to run AI, Azure services, and custom logic directly on-premises, while still being managed from the cloud. This project provides the core runtime and modules for Azure IoT Edge.

Pros

  • Enables edge computing, reducing latency and bandwidth usage
  • Supports offline and intermittent connectivity scenarios
  • Provides a secure and manageable platform for deploying IoT solutions
  • Integrates seamlessly with Azure IoT Hub and other Azure services

Cons

  • Requires familiarity with Azure ecosystem and cloud concepts
  • May have a steeper learning curve for developers new to IoT or edge computing
  • Limited to Azure cloud platform, which may not suit all use cases
  • Resource requirements may be higher compared to simpler IoT solutions

Code Examples

  1. Deploying a module to IoT Edge:
{
  "modulesContent": {
    "$edgeAgent": {
      "properties.desired": {
        "modules": {
          "SampleModule": {
            "type": "docker",
            "status": "running",
            "restartPolicy": "always",
            "settings": {
              "image": "mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:1.0"
            }
          }
        }
      }
    }
  }
}
  1. Sending telemetry from an IoT Edge module:
import asyncio
from azure.iot.device.aio import IoTHubModuleClient

async def main():
    module_client = IoTHubModuleClient.create_from_edge_environment()
    await module_client.connect()

    while True:
        telemetry = {"temperature": 25.0, "humidity": 60.0}
        await module_client.send_message(str(telemetry))
        await asyncio.sleep(5)

if __name__ == "__main__":
    asyncio.run(main())
  1. Configuring routes for IoT Edge:
{
  "$schema": "https://json.schemastore.org/azure-iot-edge-deployment-2.0",
  "modulesContent": {
    "$edgeHub": {
      "properties.desired": {
        "routes": {
          "SensorToCloud": "FROM /messages/modules/SensorModule/* INTO $upstream",
          "FilterToAlert": "FROM /messages/modules/FilterModule/* INTO BrokeredEndpoint(\"/modules/AlertModule/inputs/input1\")"
        }
      }
    }
  }
}

Getting Started

  1. Install Azure IoT Edge on your device:

    curl https://packages.microsoft.com/config/ubuntu/18.04/multiarch/prod.list > ./microsoft-prod.list
    sudo cp ./microsoft-prod.list /etc/apt/sources.list.d/
    curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
    sudo cp ./microsoft.gpg /etc/apt/trusted.gpg.d/
    sudo apt-get update
    sudo apt-get install aziot-edge
    
  2. Provision your device in Azure IoT Hub and configure the connection string:

    sudo iotedge config mp --connection-string "YOUR_DEVICE_CONNECTION_STRING"
    sudo iotedge config apply
    
  3. Verify the installation:

    sudo iotedge check
    

Competitor Comparisons

Open-source IoT Platform - Device management, data collection, processing and visualization.

Pros of Thingsboard

  • Open-source and self-hosted, offering more control and customization
  • Comprehensive IoT platform with built-in dashboards and data visualization
  • Active community and regular updates

Cons of Thingsboard

  • Steeper learning curve for setup and configuration
  • May require more resources for self-hosting and maintenance

Code Comparison

IoTEdge (C#):

await ioTHubModuleClient.SendEventAsync("output1", message);

Thingsboard (Java):

restTemplate.postForEntity(serviceUrl + "/api/v1/" + accessToken + "/telemetry", json, String.class);

Key Differences

  • IoTEdge focuses on edge computing and device management, while Thingsboard provides a full-stack IoT platform
  • IoTEdge integrates tightly with Azure services, whereas Thingsboard is more platform-agnostic
  • Thingsboard offers more out-of-the-box features for data visualization and analytics

Use Cases

IoTEdge is ideal for:

  • Azure-centric IoT deployments
  • Edge computing scenarios with limited connectivity

Thingsboard is suitable for:

  • Organizations requiring a complete IoT solution
  • Projects needing customizable dashboards and data processing

Both platforms support various IoT protocols and device types, making them versatile choices for different IoT applications.

1,241

PLC4X The Industrial IoT adapter

Pros of plc4x

  • Open-source and vendor-neutral, supporting multiple industrial protocols
  • Lightweight and can be embedded in various Java applications
  • Active community-driven development with regular updates

Cons of plc4x

  • Limited to industrial automation and PLC communication
  • Primarily Java-based, which may not suit all IoT scenarios
  • Lacks built-in cloud integration features

Code Comparison

iotedge (C#):

using Microsoft.Azure.Devices.Client;
using Microsoft.Azure.Devices.Edge.Hub.Core;
using Microsoft.Azure.Devices.Edge.Util;

class Program
{
    static async Task Main(string[] args)
    {
        // IoT Edge device setup and communication
    }
}

plc4x (Java):

import org.apache.plc4x.java.PlcDriverManager;
import org.apache.plc4x.java.api.PlcConnection;
import org.apache.plc4x.java.api.messages.PlcReadRequest;

public class Main {
    public static void main(String[] args) throws Exception {
        // PLC connection and data reading
    }
}

The code snippets highlight the different focus areas of the two projects. iotedge is designed for Azure IoT Edge devices, while plc4x specializes in PLC communication across various industrial protocols.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

IoT Edge

Build Status

Welcome to the home of IoT Edge.

IoT Edge moves cloud analytics and custom business logic to devices so that your organization can focus on business insights instead of data management. Enable your solution to truly scale by configuring your IoT software, deploying it to devices via standard containers, and monitoring it all from the cloud. This repository consists of three main projects: the Edge Agent, the Edge Hub, and the IoT Edge Security Daemon.

Documentation

Documentation for the Azure IoT Edge product can be found at https://docs.microsoft.com/azure/iot-edge.

Contributing

If you would like to build or change the IoT Edge source code, please follow the devguide.


This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.