SkillAgentSearch skills...

Edgex

边缘计算网关程序部署于工业现场(零依赖),南向支持Modbus、BACnet、OPC-UA 、CAN、PLC,北向通过MQTT、OPC-UA Server、Sparkplug-B接入云端,实现数据采集与边缘计算。 Edge Gateway collects data southbound via Modbus, OPC-UA Client, CAN, PLC, and connects northbound via MQTT, OPC-UA Server, Sparkplug-B for edge computing and cloud integration.

Install / Use

/learn @anviod/Edgex
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Industrial Edge Gateway

中文文档

Industrial Edge Gateway is a lightweight industrial edge computing gateway designed to connect industrial field devices (Southbound) with cloud/upper-layer applications (Northbound) and provide local edge computing capabilities. The project uses Go for the backend and Vue 3 for the frontend management interface.

<div align="center"> <img src="./docs/img/dataFlow_w.svg" width="100%"> </div

✨ Key Features

🚀 Smart Collection Optimization

Adaptive collection system based on device profiling, enabling intelligent optimization of southbound communication:

Key Benefits:

  • 🎯 Adaptive Parameters: No manual configuration needed, system automatically learns optimal collection parameters
  • Efficiency Boost: Batch read optimization reduces communication overhead and increases throughput
  • 🛡️ Enhanced Stability: Intelligent heartbeat keep-alive, fast fault detection and automatic recovery
  • 📊 Observability: Complete device profiles and performance statistics for runtime monitoring

Core Components:

| Component | Technical Principle | Optimization Goal | | :--- | :--- | :--- | | RTT Manager | Employs EWMA algorithm for real-time round-trip delay monitoring, dynamically calculating optimal timeout thresholds | Avoid communication failures from improper timeout settings, achieve adaptive timeout parameters | | MTU Manager | Auto-detects device MTU, intelligently negotiates single-communication packet size | Maximize data throughput while ensuring reliability, improve batch collection efficiency | | Gap Optimizer | Dynamically adjusts communication request intervals based on device load and response characteristics, supports Gap merging strategy for Modbus/PLC register reading (gap_max_hole, gap_fill_strategy, gap_dynamic_enable) | Achieve optimal balance between collection efficiency and device load, improve bus communication efficiency | | Shadow Device System | Unified internal data model, supports real/virtual shadow devices with WAL persistence | Provide data consistency verification and fast recovery capabilities | | Smart Profiling | Automatically learns device RTT, MTU, stability and other characteristic parameters | Build communication profiles for each device, support intelligent decision-making | | Collection Scheduler | Optimizes collection order based on device profiles, supports batch read optimization | Improve overall collection efficiency, reduce communication overhead |

📦 Lightweight Deployment

Single-file deployment, zero dependencies, multi-architecture support, suitable for various edge computing scenarios:

Key Benefits:

  • 📦 Single-File Deployment → One executable file, no installation needed
  • 🎯 Zero Dependencies → No additional libraries or environments required
  • 🌐 Multi-Architecture Support → ArmV7, Arm32/64, X86/64 fully covered
  • 💪 Lightweight → Runs on 128MB RAM, 1GB storage

Hardware Requirements:

| Item | Minimum | Recommended | | :--- | :--- | :--- | | Memory | 128MB | 512MB+ | | Storage | 1GB | 4GB+ | | CPU | Single Core | Dual Core+ |

Supported Devices:

  • ✅ Raspberry Pi (All Series)
  • ✅ Industrial Gateways (Arm/X86)
  • ✅ Virtual Machines / Cloud Instances
  • ✅ Embedded Devices

🔌 Southbound Protocols

| Protocol | Status | Description | | :--- | :--- | :--- | | Modbus TCP / RTU / RTU Over TCP | ✅ Implemented | Full support, based on simonvetter/modbus; Smart Collection Optimization: Supports auto-detecting slave MTU (max registers), exponential backoff reconnection, and fully automatic local port detection. Enhanced Decoder: Supports conversion and automatic scaling for multiple integer types like int32/uint32/int16/uint16. Robustness: Automatically identifies Illegal Data Addresses (Exception 2) and enters a 24-hour cooldown period to prevent invalid scans from slowing down collection efficiency | | BACnet IP | ✅ Implemented | Supports device discovery (Who-Is/I-Am), multi-interface broadcast + unicast fallback (respects I-Am source port), object scanning and point read/write, automatic fallback to single read upon batch read failure, fallback to 47808 on abnormal ports, read timeout and automatic recovery optimization. New Local Simulator Support: Automatically attempts localhost unicast discovery for simulators running locally on Windows. | | OPC UA Client | ✅ Implemented | Based on gopcua/opcua, supports read/write operations, Subscription and Monitoring, supports automatic reconnection on disconnection | | Siemens S7 | 🚧 In Development | Supports S7-200Smart/1200/1500 etc. (Custom Development) | | EtherNet/IP (ODVA) | 🚧 In Development | Planned implementation | | Mitsubishi MELSEC (SLMP) | 🚧 In Development | Planned implementation | | Omron FINS (TCP/UDP) | 🚧 In Development | Planned implementation | | DL/T645-2007 | 🚧 In Development | Planned implementation |

☁️ Northbound Protocols

| Protocol | Status | Description | | :--- | :--- | :--- | | MQTT | ✅ Implemented | Supports custom Topic/Payload templates, batch point mapping and reverse control, provides server runtime monitoring (data statistics) | | Sparkplug B | ✅ Implemented | Supports NBIRTH, NDEATH, DDATA message specifications | | OPC UA Server | ✅ Implemented | Based on awcullen/opcua, supports multiple authentication methods (Anonymous/User/Certificate); Security Enhancement: Enables Basic256Sha256 policy and certificate trust mechanism; Bi-directional: Supports client write operations (Cloud Control); provides server runtime monitoring (Client count/Subscription count/Write statistics) |

🧠 Edge Computing & Management

  • Rule Engine: Built-in lightweight rule engine supporting expr expressions for logic judgment and linkage control.
  • Log System:
    • Real-time Logs: Supports WebSocket real-time push, pause/resume, log level filtering (INFO/WARN/ERROR, etc.), and clear screen.
    • Historical Logs: Minute-level snapshot persistence (bbolt), supports query by date and CSV export.
    • UI Experience: Modern console style, supports pagination (30 lines per page) and reverse ordering.
  • Visual Management:
    • Modern UI based on Vue 3 + Vuetify.
    • Channel Monitoring: Supports real-time TCP connection status, including Local IP:Port, Remote IP:Port, connection duration, and last disconnect time, with intuitive "Local -> Remote" link display.
    • Point Management Upgrade:
      • Batch Operations: Supports batch deletion of points to simplify large-scale maintenance.
      • Reactive Filtering: Point list supports real-time keyword search and quality status (Good/Bad/Offline) filtering.
    • Login Security: Supports JWT authentication, LDAP / Active Directory integration (configurable via System Settings), login countdown protection.
    • View Switching: Channel list supports card/list view switching.
    • Interaction Upgrade: Collection channel configuration supports ID Auto-generation, regex validation, and embedded help documentation to improve configuration efficiency.
    • Northbound Management: Provides OPC UA Server security configuration (User/Certificate) and real-time runtime status monitoring dashboard.
  • Configuration Management: Modular YAML configuration (conf/ directory), supports hot reload (partial).
  • Offline Support: Frontend dependencies optimized for fully offline LAN operation.

🧠 Edge Computing Guide

The gateway features a powerful built-in edge computing engine, supporting rule-based local linkage control, specifically optimized for industrial bitwise operations.

1. Expression Syntax

The rule engine is compatible with expr language and extends syntax sugar for industrial scenarios:

Basic Variables

  • v: Real-time value of the current point.

Bitwise Operation Enhancements

Targeting common bit logic in PLCs/Controllers, supports 1-based (v.N) and 0-based (v.bit.N) styles:

| Syntax/Function | Indexing | Description | Equivalent Function | | :--- | :--- | :--- | :--- | | v.N | 1-based | Get Nth bit (starting from 1) | bitget(v, N-1) | | v.bit.N | 0-based | Get Nth bit (index starting from 0) | bitget(v, N) |

Built-in Bitwise Functions:

  • bitget(v, n): Get nth bit (0/1)
  • bitset(v, n): Set nth bit to 1
  • bitclr(v, n): Set nth bit to 0
  • bitand(a, b), bitor(a, b), bitxor(a, b), bitnot(a)
  • bitshl(v, n) (Left Shift), bitshr(v, n) (Right Shift)

2. Intelligent Write Mechanism (Read-Modify-Write)

When performing bitwise writes to a register, the gateway uses a RMW (Read-Modify-Write) mechanism to ensure other bits remain unaffected.

  • Scenario: Modify only the 4th bit (v.4) of a 16-bit status word, keeping bits 1-3 unchanged.
  • Process:
    1. Read: Driver reads the current full value of the point (e.g., 0001).
    2. Modify: Calculate new value (1001) based on formula v.4 (Set bit).
    3. Write: Write the new value 1001 to the device.
  • Configuration: Directly use v.N in the Action write formula to trigger this mechanism.

3. Batch Control

Supports triggering actions on multiple devices with a single rule:

  • Multi-target: Add multiple Targets (Device + Point) for the same action in the UI.
  • Parallel Execution: The engine automatically handles write requests for all targets concurrently.

4. UI Assistance

  • Expression Test: Rule editor includes a "Calculator" icon for real-time expression result testing.
  • Function Docs: Click "View Function Documentation" to browse the complete list of supported functions and examples.

5. Workflow Engine

The rule engine supports advanced workflow orchestration, allowing the definition of complex sequ

Related Skills

View on GitHub
GitHub Stars43
CategoryDevelopment
Updated6d ago
Forks13

Languages

Go

Security Score

80/100

Audited on Mar 24, 2026

No findings