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.
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
- 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
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.
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.
- Drag-and-Drop Interface Designer
- Project Configuration Tools
- Script Editor (Python & Rust)
- Tag/Historian Configuration
- Git Integration
- Implement data acquisition and tag management modules
- Integrate Python scripting engine
- Set up basic REST and WebSocket APIs
- Develop drag-and-drop UI builder
- Add project management and configuration tools
- Create integrated script editor and live preview
- Enhance real-time synchronization and performance
- Implement full Git-based version control features
- Build testing framework and simulation environment
- 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)
- 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
-
Prerequisites
- Rust
>=1.60 - Python
>=3.8 - Cargo, Git
- Rust
-
Clone the repo
git clone https://github.com/your-org/forgeio.git # or openforge cd forgeio
-
Configure the gateway
A sample
config.tomlis included at the repository root. It defines a dummy OPC UA device and a few example tags. The device section now includes parameters such asapplication_name,session_name, connection retry behavior, and message limits used when the OPC UA client is created. The retry logic can be tuned withconnect_retry_attempts,connect_retry_delay_ms,connect_retry_backoff, and a per-attempt timeoutconnect_timeout_ms. Adjust these settings or replace the file with your own configuration before starting the server. -
Build & run
cargo build cargo run --bin gateway_server
-
Launch the design environment
cd frontend_design_env wasm-pack build -
Run the Admin Dashboard (React/TypeScript)
cd webui npm install npm run dev # Build for production to serve through the gateway npm run build
-
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.
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.
- Start the server (the gateway does not start it automatically):
cargo run -p gateway_server --example dummy_opcua_server- With the server running, launch the gateway using the default
config.toml:
cargo run --bin gateway_server- 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 -- --nocaptureThe server listens on opc.tcp://127.0.0.1:4840/ and provides
Temperature, Pressure, and Counter nodes for testing reads and
subscriptions.
Your contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/foo) - Commit your changes (
git commit -am 'Add foo') - Push to the branch (
git push origin feature/foo) - Open a pull request
See the project wiki for full details.
This project is licensed under the MIT License. See LICENSE for details.