2

I've just checked out the Eclipse Milo Project (https://projects.eclipse.org/proposals/milo), which seems to be a great project for an "open" OPC UA Client/Server even with the implemented OPC Stack. The project on github (https://github.com/eclipse/milo) contains a Hello World example, where an OPC Server is started and an example node is sent and received from the client. Everything works fine!

But in my next step, I wanted to check if the server is configured correctly. Therefore I've installed Matrikon Explorer, but the Explorer is stating out "No OPC servers installed on this machine" right after start (while the hello world example with a running OPC Server is running of course).

Also checked, if SAP Plant Connectivity is recognizing the OPC Server (which is the goal of my project) -> "Found no OPC Server on your system/localhost"

Where is my problem, what do I have to do, to install and configure the Server correctly?

Here's the Hello World Example:

public static void main(String[] args) throws Exception {
    // Start server

    int port = 12686;
    String serverName = "test-server";
    OpcUaServerConfig serverConfig = OpcUaServerConfig.builder()
        .setBindPort(port)
        .setCertificateManager(new DefaultCertificateManager())
        .setCertificateValidator(new DefaultCertificateValidator(createTempDir()))
        .setServerName(serverName)
        .setUserTokenPolicies(singletonList(USER_TOKEN_POLICY_ANONYMOUS))
        .build();

    OpcUaServer server = new OpcUaServer(serverConfig);

    server.getNamespaceManager().registerAndAdd(
        "urn:eclipse:milo:opcua:test-namespace",
        idx -> new HelloNamespace());

    server.startup();

    while(true){
        System.out.println("server running");
    }
}
Julien Vermillard
  • 2,945
  • 1
  • 18
  • 18
Martin
  • 23
  • 1
  • 5

1 Answers1

2

Matrikon Explorer is an OPC-COM/DA client, and is probably interrogating the OPC Enum service in order to find registered COM clients.

OPC-UA is an entirely different, platform independent, technology. The concept of registration still exists, but it's not forced by default.

Try using an OPC-UA client like UaExpert to connect. Given the configuration you've copied, you'll want to point UaExpert at the endpoint URL opc.tcp://localhost:12686/test-server

I'm guessing there will be an issue once you connect with the partially implemented "hello world" namespace. I'll make sure we get a fully usable namespace example committed this week.

You can also look at the OpcUaClientIT integration test class for various client functionality and another example of setting up a server.

Kevin Herron
  • 6,500
  • 3
  • 26
  • 35
  • Thanks for the very quick and helpful answer. As you may notice I'm kind of a newbie @ OPC architectures. Did some research regarding OPC-COM/DA vs. OPC-UA now.... – Martin Aug 09 '16 at 07:17
  • ...My current problem: I've configured the OPC Server as source system in SAP Plannt Connectivity (it's supporting general opc ua systems as source systems). I've configured Server Endpoint as "opc.tcp://localhost:12686/test-server". By testing the connection, the server seems to be recognized but it's stating out "Server did not return an EndpointDescription that matched the one used to create the secure channel". Is it a problem with my Milo Server Configuration or is the problem more likely on the SAP side? Do you know this kind of error or have any suggestions to fix it? – Martin Aug 09 '16 at 07:20
  • Errors like this can usually be fixed on either side. Basically, you've set your example up to bind to localhost, but SAP is connecting via some other IP address and noticing the discrepancy. Sometimes this is not avoidable, like when you're connecting to a remote server where the external IP used is not one you can bind to. In this case you can probably just change Milo's config to include additional addresses to bind to. Call `setBindAddresses` when building the server config. – Kevin Herron Aug 09 '16 at 13:38
  • @Martin the hello world examples have been updated. If you've gotten this working now can you mark this question as answered? – Kevin Herron Aug 09 '16 at 20:47