// the find
cmbahadir/opcua-pubsub-esp32
ESP32 OPC UA Publisher
A proof-of-concept that runs an OPC UA PubSub publisher on an ESP32, reading temperature from a DHT22 sensor and publishing it via the open62541 stack. The author ported open62541 to the Xtensa toolchain through trial and error. This is a starting point for someone who needs to bridge IIoT sensors to OPC UA without a full PLC.
Solves a genuinely annoying problem — getting OPC UA onto a microcontroller — and the fact it works at all is the achievement. The component structure follows ESP-IDF conventions correctly, keeping DHT22, ethernet, and the OPC UA lib as separate components. Including the modified open62541.c/.h directly means no patching step during build. The README is honest about what it is and isn't.
Last commit was April 2021 — open62541 has had significant API changes since, and ESP-IDF v4→v5 broke a lot of things, so expect build failures on any recent toolchain. The author admits the open62541 modifications were trial and error with no documentation of what changed or why, making maintenance or upgrading a black box. Only one sensor and one data node are wired up; there is no configuration path, so anything beyond a DHT22 requires source edits. The README explicitly warns against production use, and the codebase backs that up — no error recovery, no reconnect logic, no security configuration on the OPC UA endpoint.