// the find
twinedge-ai/opcua-edge
Plain-C OPC UA edge server for industrial telemetry
A plain-C OPC UA server that loads a plant model from an INI-style template, maps it to an OPC UA address space, and bridges it to Modbus TCP holding registers with threshold-based event detection and SQLite persistence. It's aimed at embedded/industrial devs who need a lightweight, auditable Modbus-to-OPC-UA gateway rather than a full SCADA historian — the included desalination plant model is a demo, not the point.
The template loader does a clean two-phase load (indexes first, pointers wired after validation) specifically to avoid dangling pointers while arrays fill — a small but deliberate memory-safety decision that a lot of C IoT projects skip. Test discipline is well above what a 3-star repo usually ships: unit + integration tests under ctest, an ASan script, a Valgrind leak-check script, and a Python Modbus simulator with named fault profiles (high_vibration, overload_current, etc.) for integration testing. The benchmark numbers are checked in as real CSVs with an honest edge-vs-server baseline split instead of a single cherry-picked number. Module boundaries (config/address-space/server/runtime/modbus/events/store) are genuinely separable, and OPC UA writes landing in memory first and flushing to Modbus on the next tick keeps the UA callback path short.
No OPC UA application certificates, encrypted security policies, or user auth — this is called out in the README, but it means 'industrial telemetry' here really means 'lab network or VPN only,' which is a significant caveat for anything resembling production. The model uses fixed-size arrays (edge_limits.h), so scaling past whatever asset/node/event ceilings are baked in requires a recompile, not a config change. Event conditions are limited to greater_than/less_than with no debounce or hysteresis, so a value oscillating near a threshold will chatter events in the history table. Modbus connectivity is a single host:port with multiple unit IDs — fine for one PLC backplane, but a real multi-building plant with PLCs on separate IPs isn't supported without forking the runtime. It's also a single-contributor repo built with AI assistance (disclosed) and no independent adopters yet, so the Modbus mapping and event model are unproven outside its own demo template.