How bambooww/iot-tree works
Project Type and Purpose
• This is a Java-based, Maven multi-module full-stack IoT middleware and SCADA system (“IOT-Tree Server”).
• It provides device/system connectivity (Modbus, OPC UA/DA, MQTT, HTTP, PLC protocols, etc.), a tree-structured device/tag management core, a message-flow engine (MsgNet) for control and data processing, pluggable storage backends (JDBC, InfluxDB, IoTDB, TSSDB), and web-based UIs (administration, HMI) plus a .NET desktop client.
File Structure Analysis
Top-level Maven modules:
• core – the heart of the system: communications layer, drivers interface, IOC & tree, message flow engine (msgnet), filter, router, service abstractions, plugins, storage adapters, online UI editor support.
• driver-parent – collection of protocol drivers (Modbus, OPC UA/DA, Siemens, Mitsubishi, BACnet, NB-IoT, etc.).
• ext-parent – extension modules (basic extensions for messaging, ROA, VO).
• server – Java service bootstrap, embedded web container or wrapper, server-side control handlers, REST/WebSocket endpoints.
• web – JSP-based HMI front-end (ROOT), administration panel (web/admin), documentation site (web/doc), custom web/main example app.
• win_panel – Windows .NET desktop client for HMI.
Architecture from README
• “Root Part of the tree”: device connectivity → communication access → channels → device drivers → tag model → tree‐structured organization → online UI nodes.
• “Upper Part of the tree”: MsgNet message-flow runtime → functional nodes (scheduling, alerts, data routing, storage, external services like MQTT/Kafka/Mail/Excel) → control logic.
• Web-based management UI and HMI delivered as standard Java Webapps and static assets, served by the server module.
Main Components & Interactions
A. Device Connectivity Layer
• Driver modules (driver-parent) and core/conn packages
• Protocol adapters: TCP/UDP/COM/HTTP/MQTT/OPCUA/OPCDA/Virtual/etc.
→ feed raw data into
B. Core Processing Engine (core module)
• IOC & tree model: Config, ConnManager, DevManager, UAManager, etc.
• MsgNet engine: MNManager, MNNode, modules, nodes, store sub-packages
• Plugin framework: PlugManager, AbstractPlugin, driver plugins
→ outputs processed data or control commands to
C. Storage Layer
• StoreManager with adapters: SourceJDBC, SourceInfluxDB, SourceTSSDB, etc.
• Historical & real-time storage APIs
D. Server & Service Layer (server module)
• Bootstrapping components: ServerBootCompMgr, ServiceWrapperMain
• REST endpoints, WebSocket (WSRoot, WSServer)
• Admin/control handlers, Tomcat integration
→ serves UIs and exposes APIs for UI and external systems
E. Web-based UIs (web module)
• HMI (web/ROOT): JSPs, JavaScript, iottree_hmi.js
• Admin panel (web/admin): JSPs, Vue router, AJAX endpoints (WSNetMsgDebug, WSHmiRT, etc.)
→ accessed by browser clients
F. Desktop Client (win_panel)
• .NET WinForms app uses WBBridge, Conf to connect via WebSocket/REST to server for kiosk UI.
G. External Systems
• MQTT broker, Kafka cluster, mail servers, databases (MySQL, Oracle, SQL Server), OPC servers, RESTful services
Architectural Patterns & Principles
• Layered Architecture:
1) Driver/Connector layer
2) Core engine (model + MsgNet processing)
3) Service/API layer
4) Presentation layer (web UI, desktop client)
• Plugin/Adapter pattern for drivers and storage backends
• Dependency Injection (IOC packages) for pluggable components
• Event-driven message flow (MsgNet) for control logic
• Maven multi-module for clear separation and reuse
Elements
• Annotations for protocols (e.g., OPC UA, MQTT) and storage backends.