GetEndpoints Failed error when connecting to an OPCUA simulation server

23 ビュー (過去 30 日間)
Jose
Jose 2023 年 10 月 10 日
コメント済み: Jose 約19時間 前
I am trying to configure a setup to retrieve data from the IntegrationObject simulation server. I am able to store data in it from a remote host using pyhton. I can also connect to the server as long as I am running MATLAB 2022b in the same host. But when it comes to connect to the server from another remote host using MATLAB 2022b it fires an internal error saying it cannot retrieve the Endpoints
>> s=opcuaserverinfo('u114193')
s =
OPC UA ServerInfo 'Integration Objects UA Server Simulator':
Connection Information:
Hostname: 'u114193'
Port: 62640
Endpoints: [1×5 opc.ua.EndpointDescription]
Security Information:
BestMessageSecurity: SignAndEncrypt
BestChannelSecurity: Basic256Sha256
UserTokenTypes: {'Anonymous' 'Username' 'Certificate'}
>> uac=opcua(s)
uac =
OPC UA Client:
Server Information:
Name: 'Integration Objects UA Server Simulator'
Hostname: 'u114193'
Port: 62640
EndpointUrl: 'opc.tcp://localhost:62640/IntegrationObjects/ServerSimulator'
Connection Information:
Timeout: 10
Status: 'Disconnected'
ServerState: '<Not connected>'
Security Information:
MessageSecurityMode: SignAndEncrypt
ChannelSecurityPolicy: Basic256Sha256
Endpoints: [1×5 opc.ua.EndpointDescription]
>> connect(uac,'opcua_user','mipass')
Error using matlabshared.asyncio.internal.MessageHandler/onError
GetEndpoints Failed.
Error in matlabshared.asyncio.internal.Channel/open (line 275)
obj.ChannelImpl.open(options);
Error in opc.ua.Client/connect (line 567)
clnt.AsyncChannel.open(options);
Username and password are correct. Anonymous access gives the same result. Using the EndpintURL does not help either from the remote host. I have notice that the endpointURL refers to localhost, but the hostname is ok, so I presume It trys to conenect to the remote host.
I can browse the server from any machine using various 3th party OPCUA browsers, Firewall is off
If using the IP of the server, I get the same result, but anyhow, I have updated C:\Windows\System32\drivers\etc\hosts with the correspondig entry for host u114193
I have also followed the instructions to allow DCOM with no security but this prevented my win10 64 bit from booting correctly (https://es.mathworks.com/help/icomm/ug/preparing-to-use-opc-toolbox-software.html)
any hint on this issue will be greatly appreciated?
Best regards.

回答 (2 件)

Srijith Vijay
Srijith Vijay 2024 年 3 月 1 日
Hi Jose,
This is usually caused by the server returning an endpoint URL that contains an unreachable hostname. Unlike other 3rd party apps, MATLAB does not replace the hostname in the endpoint/discovery URLs returned by the server to prevent secuirty issues.
To help you debug this further, you could use a packet analyzer tool like Wireshark to log OPC UA packets after executing the following command:
uac = opcua("u114193",62640);
Once you have the log, filter the Wireshark log to view only OPC UA packets and then see what is the Endpoint URL received from the server in the "FindServersReponse" and "GetEndpointResponse" packets. See if this contains the expected hostname.
You can refer to this link to setup Wireshark to capture and filter OPC UA packets: Analyzing OPC UA Communications with Wireshark – OPC Connect (opcfoundation.org)
If "u114193" should be the hostname in the endpoint/discovery URLs, then you will need to configure your OPC UA server to return an endpoint/discovery URL that contains this hostname.
  1 件のコメント
Jose
Jose 約19時間 前
Dear Mr Vijay
First thing off, thank you for your kind answer and sorry for the delay in the replay.
I have run the very same test using Matlab as client and then UaExpert. I can browse the data using UaExpert, but cannot connect with Matlab
When runiing MATLAB FindServerResponse returns the correct hosts as advertised by the server.
GetEndpointResponse also returns four endpoints with localhost as host in the EndpointUrl
However, the very same setup works fine when browsing the server with UaExpert. I cannot see any difference between the whiseshark log made in the MAtlab Session and in the UaExpert Sesion. (No security) as shown below.
Matlab session log for Endpoint[0]
UaExpert session log for Endpoint[0]
Any hint wil be very much appreciated.

サインインしてコメントする。


Narvik
Narvik 2023 年 11 月 24 日
編集済み: Narvik 2024 年 3 月 1 日
Hi,
I understand that you are facing an issue while trying to connect to an OPC server. Retrieving endpoints might fail when the endpoint URL(s) returned by the server is incorrect and the server can't be reached at that address.
You can refer to the following MATLAB answer to avoid issues with retrieving endpoints:
Hope this helps!
  1 件のコメント
Jose
Jose 2023 年 11 月 27 日
Dear Narvik
thank you for your answer.
I have been unable to locate the service component for Integration Objects Simulation Server...either it does not use an understable name or it is hidden under some type of {FD....}. It seems it does not run as a service either. Regarding your second hint, the error I get is not the same. Moreover, I had already configured the hosts file.
On the other hand, I am able to connect and browse the server from a remote host using 3th party OPCUA clients but not with MATLAB.
Anyhow, I thank you for your help.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeUnified Architecture についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by