Skip to content

DanielGarc/forgeio

Repository files navigation

ForgeIO / OpenForge

An open-source, Rust-based SCADA & Machine Interface platform

ForgeIO (random name suggested by AI) leverages Rust’s performance, safety, and concurrency to deliver a modern, high-performance solution for industrial automation. It's designed for demanding environments requiring scalability to millions of tags and robust data handling, featuring a comprehensive visual design environment and flexible edge deployment capabilities.


Table of Contents

  1. Overview
  2. Key Features
  3. Architecture
  4. Roadmap
  5. Technology Stack
  6. Getting Started
  7. Contributing
  8. License

Overview

ForgeIO / OpenForge is designed to:

  • Collect data from industrial devices via a highly extensible driver system (initially supporting OPC UA, Modbus, MQTT, Siemens S7, and more)
  • Manage real-time tags and store historical data
  • Script custom logic in Python (via PyO3) or Rust
  • Visualize and control processes through a web-based drag-and-drop interface
  • Deploy at the edge or in centralized gateways
  • Extend and collaborate via open-source development

Key Features

  • High-Performance & Scalable Tag Engine: Designed for millions of real-time tags with efficient updates and low latency.
  • Data Acquisition Layer: Extensible architecture supporting OPC UA, Modbus TCP/RTU, MQTT, Siemens S7, with the ability for community contributions.
  • Tag System & Historian: Thread-safe in-memory tags, seamless time-series storage
  • Embedded Scripting: Python 3+ integration for event handlers and calculations
  • Real-Time Events & Alarms: Configurable triggers, notifications, and workflows
  • Visual Design Environment: Intuitive drag-and-drop editor, script console, and project manager
  • Edge & Machine Interface: Local buffering, protocol translation, and responsive Rust/WASM UIs
  • Version Control: Git-native project storage and history

Architecture

Gateway Server / Edge Runtime

The core runtime can operate as a centralized Gateway or be deployed directly at the Edge (e.g., as a Machine Interface/HMI backend). Both modes share the same high-performance foundation but can be configured for different scales and resource constraints.

  • Data Acquisition: Pluggable drivers for various protocols (OPC UA, Modbus, MQTT, Siemens S7, etc.). Built for high throughput and concurrent connections. Edge deployments prioritize low-latency direct device communication.
  • Tag Management: Fast, concurrent tag reads/writes. Scalable engine designed to handle millions of tags efficiently.
  • Scripting Engine: Embedded Python via PyO3 for flexible logic.
  • Event Processing: Alarm management and notification services.
  • API Layer: WebSockets, REST, gRPC endpoints for integration and UI communication.
  • Edge-Specific Optimizations: Includes local data buffering for resilience, efficient data flow minimizing overhead, and optimized task scheduling for responsive HMI interactions.

Edge & Machine Interface Capabilities (Leveraging Gateway Runtime)

When deployed at the edge, the runtime leverages the core components for:

  • Protocol Gateways: Utilizing the standard, high-performance drivers for direct PLC communication.
  • Visualization UI Backend: Providing real-time data via WebSockets or other efficient mechanisms to the Rust/WASM frontend.
  • Local Historian: Temporary storage (potentially using lightweight databases or in-memory buffering) to support offline operation and ensure data integrity.

Visual Design Environment

  • Drag-and-Drop Interface Designer
  • Project Configuration Tools
  • Script Editor (Python & Rust)
  • Tag/Historian Configuration
  • Git Integration

Roadmap

Phase 1: Core Platform

  • Implement data acquisition and tag management modules
  • Integrate Python scripting engine
  • Set up basic REST and WebSocket APIs

Phase 2: Visual Design Environment

  • Develop drag-and-drop UI builder
  • Add project management and configuration tools
  • Create integrated script editor and live preview

Phase 3: Advanced Capabilities

  • Enhance real-time synchronization and performance
  • Implement full Git-based version control features
  • Build testing framework and simulation environment

Technology Stack

Backend (Rust)

  • Frameworks: Axum, Tokio (chosen for high-concurrency and performance)
  • Libraries: tokio-modbus, opcua, rumqttc, potentially dedicated S7 libraries
  • Scripting: PyO3
  • Storage: SQLx, TimescaleDB
  • Realtime: tokio-tungstenite (WebSockets)

Frontend (Rust/WASM)

  • UI: Leptos or Yew (chosen for performance and WASM integration)
  • Compilation: WebAssembly for high performance
  • Components: Custom drag-and-drop toolkit, optimized for high-frequency data updates

Getting Started

  1. Prerequisites

    • Rust >=1.60
    • Python >=3.8
    • Cargo, Git
  2. Clone the repo

    git clone https://github.com/your-org/forgeio.git  # or openforge
    cd forgeio
  3. Configure the gateway

    A sample config.toml is included at the repository root. It defines a dummy OPC UA device and a few example tags. The device section now includes parameters such as application_name, session_name, connection retry behavior, and message limits used when the OPC UA client is created. The retry logic can be tuned with connect_retry_attempts, connect_retry_delay_ms, connect_retry_backoff, and a per-attempt timeout connect_timeout_ms. Adjust these settings or replace the file with your own configuration before starting the server.

  4. Build & run

    cargo build
    cargo run --bin gateway_server
  5. Launch the design environment

    cd frontend_design_env
    wasm-pack build
  6. Run the Admin Dashboard (React/TypeScript)

    cd webui
    npm install
    npm run dev
    
    # Build for production to serve through the gateway
    npm run build
  7. Run Gateway and Admin UI Together

    ./run_gateway_and_admin.sh

The gateway API now requires HTTP Basic auth with the default credentials admin/admin.

Refer to the project wiki for detailed guides.

Dummy OPC UA Server for Testing

If you need an OPC UA endpoint for local development, a small Rust server is included in gateway_server/examples/dummy_opcua_server.rs. The server exposes a few test variables.

  1. Start the server (the gateway does not start it automatically):
cargo run -p gateway_server --example dummy_opcua_server
  1. With the server running, launch the gateway using the default config.toml:
cargo run --bin gateway_server
  1. To exercise the built-in connection retry logic against the dummy server, run the included integration test:
cargo test -p gateway_server browse_tags_from_dummy_server -- --nocapture

The server listens on opc.tcp://127.0.0.1:4840/ and provides Temperature, Pressure, and Counter nodes for testing reads and subscriptions.


Contributing

Your contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/foo)
  3. Commit your changes (git commit -am 'Add foo')
  4. Push to the branch (git push origin feature/foo)
  5. Open a pull request

See the project wiki for full details.


License

This project is licensed under the MIT License. See LICENSE for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors