Giter Club home page Giter Club logo

Comments (22)

nauful avatar nauful commented on September 2, 2024

Hello,

Quick sanity checklist:
Are you running the static method named TestServer()
If so, try to add the server 127.0.0.1:7718 in UaExpert. Does UaExpert discover endpoints with varying security options?
Either way, set a breakpoint on GetEndpointDescriptions and check that UaExpert is connecting to enumerate the endpoint options (breakpoint will be hit).
If so, try connecting to the one that says None in UaExpert (security policy None). Set a breakpoint on sessionValidateClientApplication in the sample application, does it get there?
If so, you can additionally try the other security modes (their connection will always be accepted because of return true in sessionValidateClientApplication).

The ApplicationDescription structure is just some info to show UA clients what your UA server's purpose is. The GetApplicationDescription method can return a different ApplicationDescription depending on the URL queried by a client.

from libua.

Polyteres avatar Polyteres commented on September 2, 2024

Hello,

Are you running the static method named TestServer()

Yes.

If so, try to add the server 127.0.0.1:7718 in UaExpert. Does UaExpert discover endpoints with varying security options?

No.

I set a breakpoint on GetEndpointDescription but it never comes. I attach a screenshot:

https://www.dropbox.com/s/i2e92uk1m229y3s/OPCUA.jpg?dl=0

Thank you.

from libua.

nauful avatar nauful commented on September 2, 2024

It seems that the request for endpoints is failing, which works for me locally.

You should try setting a breakpoint on these two methods and stepping through:

protected int DispatchMessage_GetEndpointsRequest(SLChannel config, RequestHeader reqHeader, MemoryBuffer recvBuf, uint messageSize)

protected int DispatchMessage_FindServersRequest(SLChannel config, RequestHeader reqHeader, MemoryBuffer recvBuf, uint messageSize)

These two message types can be handled without an established session and are used for UA discovery.

from libua.

Polyteres avatar Polyteres commented on September 2, 2024

Hello, I have set a breakpoint in those functions but nothing happened. Please, Could you try UAExpert client with your server and make sure it works, and if so, give me all the steps to follow?. I'm desperate because nothing works for me.

Thank you very much.

from libua.

nauful avatar nauful commented on September 2, 2024

This is very strange because when I run TestServer, I am able to connect fine with UaExpert. I am running uaexpert-bin-win32-x86-vs2008sp1-v1.3.0-201 locally.

I just add opc.tcp://127.0.0.1:7718 under Custom Discovery and the endpoints are listed properly.

Could you run UaExpert on one computer and your server on another, and use Wireshark to capture traffic on either end? Zip and attach the captured traffic here. This will show me the messages sent by UaExpert and the library's responses so I can look for any issues. NetDispatcher handles incoming messages from connected clients, so if those are not being triggered then something is definitely wrong.

from libua.

loongtail avatar loongtail commented on September 2, 2024

Hello, I came across the same problem, and I found my SecurityPolicy is "Invalid" when I set a breakpoint on
protected int DispatchOpen(SLChannel config, MemoryBuffer recvBuf)

I'm using UaExpert 1.5.1 331, and did as @nauful but showed nothing, I'm not sure it is the reason.


I tried the UaExpert1.2(I could not find the 1.3), then I got the list of SeverNode.

from libua.

Polyteres avatar Polyteres commented on September 2, 2024

Hello, I just checked it and I have the same problem as @loongtail. @loongtail version 1.2 worked for you then?. Where did you download it?. I dont find it. Thanks.

from libua.

nauful avatar nauful commented on September 2, 2024

The default security policy should be http://opcfoundation.org/UA/SecurityPolicy#None
This remains until the session is created and established, when a potentially different security policy can be chosen.

If UaExpert expects something different now, I'd like to find out what it's doing. Could you please capture the Wireshark traffic?

from libua.

Polyteres avatar Polyteres commented on September 2, 2024

Hello, I have tried version 1.2 of UAExpert and I did not find any problem either. I have seen that you have used version 1.3 of UAExpert. I have had problems with later versions, 1.5 (@loongtail) and 1.4.4 (me) which is the one I am currently using. I think if you directly download the latest version of UAExpert you will find the same problems that we have had. This problem that I have mentioned also happens to us with another SCADA of a client so it is not an isolated case or referred only to UAExpert.

Best regards.

from libua.

loongtail avatar loongtail commented on September 2, 2024

@nauful I'm not sure whether it's the data you want, I just filtered the data by IPs of two ends.
UA_WS.zip

from libua.

nauful avatar nauful commented on September 2, 2024

I only see the connection request in this Wireshark capture, not the response.

I don't have any insights into what's changed in UaExpert as a client, it's sending the same OpenSecureChannel message as before. Perhaps it now expects something differently, which breaks compatibility with most existing UA servers.

from libua.

loongtail avatar loongtail commented on September 2, 2024

I don't know how to use the wireshark correctly, maybe I filtered by wrong key, whatever, thank you for your support :)

from libua.

nauful avatar nauful commented on September 2, 2024

Happy to help, I just don't see anything that would cause an issue being returned. I don't have an account to download new OPC Foundation tools, will investigate further when I get the chance to.

from libua.

loongtail avatar loongtail commented on September 2, 2024

WS&UAExpert1.51.zip
I tried filtering again the traffic, and packed it with the UAExpert1.51, hope to help you to investigate.

from libua.

nauful avatar nauful commented on September 2, 2024

GetEndpointsResponse

Very helpful, thanks. In the Wireshark capture I can see that a valid response was sent for GetEndpointsResponse, so the issue seems localized to the UaExpert client library (OPC Foundation's client library). I'll install UaExpert 1.5.1 and take a closer look.

from libua.

nauful avatar nauful commented on September 2, 2024

I have found one bug in the OPC Foundation's current client library: maximum chunk size of 64k causes an exception (their client tries to read 65536 from a buffer of 65535). As a workaround (for compatibility... a never-ending game of whack-a-mole), I am updating DispatchHello with this local config for transmission limits:

const uint chunkSize = (1 << 16) - 1; // Was previously 1 << 16 (65536, now 65535)
config.TL.LocalConfig = new TLConfiguration()
{
	ProtocolVersion = 0,
	SendBufferSize = chunkSize,
	RecvBufferSize = chunkSize,
	MaxMessageSize = (uint)maximumMessageSize,
	MaxChunkCount = (uint)(maximumMessageSize + (chunkSize - 1)) / chunkSize,
};

UaExpert 1.5.1 still has an issue, continuing to investigate.

from libua.

Polyteres avatar Polyteres commented on September 2, 2024

Thank you very much for your support. We await more news from you. Thanks again.

from libua.

nauful avatar nauful commented on September 2, 2024

UaExpert 1.5.1 seems to have raised the minimum acceptable token lifetime, so changing the default from 1 minute to 10 minutes has fixed the problem. Updated source with two commits, one for NetDispatcher with the change above and one in Server for this:

public const int MaxTokenLifetime = 600 * 1000;

a1

a2

Please take a look and let me know if it works, then you can close the issue.

from libua.

Larry57 avatar Larry57 commented on September 2, 2024

Hi, I was just trying UAExpert 1.5.1.311 too at the same time you commited changes : now it is ok on my side despite of the messages that pops up in the log window.
Thanks a lot for this code, I need to study the server part now and give it a try.

from libua.

loongtail avatar loongtail commented on September 2, 2024

Thanks a lot, it works now.

from libua.

Polyteres avatar Polyteres commented on September 2, 2024

Hello, thanks a lot!!!. It works now, yes. Thank you very much for your support. I close the issue, thanks again.

from libua.

nauful avatar nauful commented on September 2, 2024

Welcome, feel free to ask if you have any questions or other problems.

from libua.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.