OPCFoundation / UA-CloudCommander

A cross-platform OPC UA cloud command & control reference implementation leveraging MQTT and Kafka. It runs in a Docker container and executing commands, reads and writes on on-prem OPC UA servers from the cloud.
MIT License
20 stars 6 forks source link

Connection Timeout #10

Open srjhunjhunwalacorp opened 4 weeks ago

srjhunjhunwalacorp commented 4 weeks ago

Hello Team,

While using the commander I am getting timeouts, when checked connectivity to OPC UA server seems fine, it sometimes connects fine sometime its shows this random behaviour also with historical and write commands, can you please suggest -

Screenshot 2024-06-05 at 3 22 25 PM Screenshot 2024-06-05 at 3 20 25 PM

srjhunjhunwalacorp commented 4 weeks ago

I am receiving following logs while starting the container -

[09:58:02 INF] Log file is: /app/uacloudcommander.logfile.txt Could not load cert file, creating a new one. This means the new cert needs to be trusted by all OPC UA servers we connect to! Could not load key file, creating a new one. This means the new cert generated from the key needs to be trusted by all OPC UA servers we connect to! [09:58:03 INF] Connected to MQTT broker. [09:58:03 INF] UA Cloud Commander is running.

barnstee commented 3 weeks ago

@srjhunjhunwalacorp , the cert file error is because you are not mapping the PKI directory of the UA Cloud Commander to the Docker host filesystem during Container startup (-v flag in docker). Therefore UA Cloud Commander can't load an existing cert and creates a new one. It seems like you are not using security in your OPC UA server, so this should not be your issue (although not using security is of course an issue!)

It looks like you are using IoT Hub with UA Cloud Commander. Sometimes IoT Hub simply throttles you and you will get timeouts. I would recommend using an Event Hub instead.

srjhunjhunwalacorp commented 3 weeks ago

Yes I am using IoT hub but at the same time I can see that the request is received on the UA cloud commander but it is not initiating a connection towards the OPC UA server as I cant see the connection request on the server side. Earlier it was working fine in the same way but after the new release it started giving timeout issue.

Also I checked the throttling metrics but could not find it happening on the IoT hub.

image

barnstee commented 3 weeks ago

Make sure the clock is set correctly in your Docker host.