I’m experiencing persistent connectivity issues in an industrial setup involving three main components: an Ubuntu Server (x.x.y.z) running Django web application, an Ubuntu Desktop (x.x.y.t) accessing the web interface, and a PLC acting as an OPC UA server (x.x.y.d). The connection chain frequently breaks due to asyncua-Django and OPC UA server connectivity persistence issues. The Django application fails to maintain stable OPC UA sessions, with timeout mismatches when requesting 300000ms but receiving 30000ms from the PLC. Multiple monitoring tasks for temperature data and switch/sensor status monitoring fail simultaneously with watchdog loop errors and “Connection is closed” messages. The web interface on Ubuntu Desktop experiences delayed responses and inconsistent data updates. While I implemented a keep-alive mechanism with secure channel renewal and retry logic to address initial BadTcpSecureChannel issues, this solution has led to traffic overload and subsequent connection losses. The system struggles with managing the connection overhead from frequent reconnection attempts and channel renewals, requiring application restarts and significantly impacting the system’s ability to maintain reliable real-time monitoring of the PLC data.
My aim is seamless connection between Django and OPCUA server. Any idea to improve it?