eclipse-basyx / basyx-applications

applications
MIT License
16 stars 26 forks source link

MILO client not working with localhost OPCUA server. Using OPC2AAS databridge repo. #188

Open suman-v opened 3 days ago

suman-v commented 3 days ago

I am trying to use Databridge functionality to connect Docker container with local opcua server running in my system. I followed all steps mentioned in this repo but still not able to connect to opcua server. It is trying to pick my system IP but showing errors Repo: https://github.com/eclipse-basyx/basyx-applications/tree/main/opc2aas @FrankSchnicke Please help me here.
Thank you in advance. image image @aaronzi

aaronzi commented 3 days ago

Thank you for raising this issue. With local OPC UA server you mean a server running outside of docker? Have you already verified that another OPC UA client can access the server? Also, is the server secured in any way?

suman-v commented 2 days ago

Yes, I am using UAExpert to connect to OPCUA server running in my local window system and it is able to connect. image

aaronzi commented 2 days ago

Thank you for the info. Is the DataBridge configuration autogenerated or did you manually add something to the opcuaconsumer.json? I am asking because the serverPort is not the OPC UA standard port (4840) and the pathToService is set to milo. Are you using milo on your local windows as OPC UA server?

suman-v commented 2 days ago

Yes it was autogenerated but i added "Milo" manually just for testing purpose. And i am not using MILO in my window system. I am running some simulation software and inside that software OPCUA server is running on Port 4851. I used databridge demo repo, entered 4851 URL in OPC2AAS UI and generated the config file along with XML. Later i converted XML to aasx and placed according to instructions. Now I am expecting my AAS to read data from Simulation software (via OPCUA server 4851).

aaronzi commented 2 days ago

Ok, thank you for the info. You should remove the pathToService then. Could you try without that again and send me the log for the DataBridge if it still fails?

suman-v commented 2 days ago

Thank you for your response.. will do and send logs

suman-v commented 2 days ago

databridge.txt databridge is not starting after removing pathToService image

aaronzi commented 2 days ago

Sorry, I think my suggestion was not phrased in an optimal way. I actually meant to do it like this:

[
  {
    "uniqueId" : "source://Aliases/FindAliases/InputArguments",
    "serverUrl" : "host.docker.internal",
    "serverPort" : 4851,
    "pathToService" : "",
    "nodeInformation" : "i=23477",
    "requestPublishInterval" : 50
  }
]

Also what I noticed from your log is that you are using a timerconsumer. I would suggest to use event as trigger. This improves performance and in general works better. A route could look like this:

[
  {
    "datasource" : "source://Aliases/FindAliases/InputArguments",
    "transformers" : [ "dataValueToJson", "jsonataExtractValue" ],
    "datasinks" : [ "sink://sink/id" ],
    "trigger" : "event"
  }
]

Also make sure to remove the demo.txt file from the folder where you placed your DataBridge config. The log tells me there is this unrelated text file.

suman-v commented 2 days ago

Okay, Thank you for your suggestions. I will try now..

suman-v commented 2 days ago

databridge.txt Seems like Java connector still not able to connect. Below error message is always there. 2024-07-03 20:44:44 java.util.concurrent.ExecutionException: java.net.UnknownHostException: WTIN00007724L.apa.gad.dummy.com: No address associated with hostname

aaronzi commented 1 day ago

My guess would be that this is a DNS issue. The DataBridge is probably trying to reach the server by it's hostname which it can't find. What you could try is to use the IP address of the device your OPC server runs on instead of host.docker.internal.