Connect behavior from client ot server

Questions regarding the use of the ANSI C SDK for Server or Client development or integration into customer products ...

Moderator: uasdkc

Post Reply
ThomasK
Jr. Member
Jr. Member
Posts: 4
Joined: 03 Aug 2016, 12:28

Connect behavior from client ot server

Post by ThomasK »

Hello,

I have created a user specific project based on server lesson 03 using the demo server on Linux.
With the original server lesson 03, I can connect the client without any problem.
Trying this with my project - different location, but with identical code content at ServerMain() -,
I always get the message box "Unsupported security policy". What could be the reason for that?

In the log window of UaExpert, I see an empty ApplicationUri: '' at my project, but the terminal shows
the correct Endpoint URL: opc.tcp://dev-slp:48020 with both projects.

Regards,
Thomas

User avatar
Support Team
Hero Member
Hero Member
Posts: 3070
Joined: 18 Mar 2011, 15:09

Re: Connect behavior from client ot server

Post by Support Team »

Hello Thomas,

The available SecurityPolicies can be configured using the pSecurityPolicyConfigurations member of the UaServer_Endpoint structure. This can either be done manually or by using a configuration file and UaServer_Settings_GetConfigurationFromSettings().

If UaExpert shows a warning about unsupported SecurityPolicy, probably a SecurityPolicy that is not supported by the server was chosen in UaExpert. Please check your configuration when connecting and ensure that the SecurityPolicy is set to one which is configured/available in the server. Using the 'Discovery' tab in the 'Add Server' dialog, you can read out the configuration of the server.

If you continue to have problems, please provide the *exact* error message from UaExpert and/or the demo server.

Best Regards
Support Team

ThomasK
Jr. Member
Jr. Member
Posts: 4
Joined: 03 Aug 2016, 12:28

Re: Connect behavior from client ot server

Post by ThomasK »

Hi,

thanks for the qiuck response.
Using "Discovery" in the "Add server" Dialog, I get the following log:

15:32:42.460 | DiscoveryWidget | | Discarding Server UaSdkC - LessonSecurity02 with URL @???
15:32:38.740 | DiscoveryWidget | | Discovery GetEndpoints on opc.tcp://localhost:4840 failed (BadTimeout)
15:32:38.237 | DiscoveryWidget | | Discovery FindServers on opc.tcp://localhost:4840 failed (BadTimeout)

APPLICATION/PRODUCT configuration 'Security 02' was just a test, I don't see any change in behavior if I use different settings here.
In fact, 'localhost' can't be connected anyway, I have to use the actual IP address.
And the port is also incorrect, it is 48020 (as set in lesson03); changing this to 4840 doesn't have any postive effect.

I will prepare my demo Server Project - can I attach it or do I have to Transfer it by FTP?

Regards, Thomas

User avatar
Support Team
Hero Member
Hero Member
Posts: 3070
Joined: 18 Mar 2011, 15:09

Re: Connect behavior from client ot server

Post by Support Team »

Thomas,

the discovery goes to the LDS server, which typically runs on 4840, but which you probably have not installed.
Therefor in UaExpert you must put in "manually" the discovery URL including port number and discover the server directly.

If the server does not answer on his configured port, it is either "not started" or it can not open the port/endpoint e.g. because it is blockt/used by some other application, or it can not open endpoint becaus it is missing its own config.ini where the endpoints are configured. When starting up the server you should see in the console window successful startup trace.

If you have "copied" the server to a different location, you may have forgotten to copy the config.ini file with it? The working dir and the appdir might be different or wrong?

Best Regards
Support Team

ThomasK
Jr. Member
Jr. Member
Posts: 4
Joined: 03 Aug 2016, 12:28

Re: Connect behavior from client ot server

Post by ThomasK »

Hi,

I have found that subfolder "config" included at the original project is not part of my duplicated one.
But I didn't found any references to that in CMakeListst.txt or the build script at he demo.
On the other hand, contents of "settings.conf" seem to be important.
Might this cause a problem?

Regards,
Thomas

ThomasK
Jr. Member
Jr. Member
Posts: 4
Joined: 03 Aug 2016, 12:28

Re: Connect behavior from client ot server

Post by ThomasK »

Hi again,

this is what is printed on the console window with Server_lesson03 (I added some additional debug Outputs):
=============================================================================================
dev@dev-slp:~/Public/sdk/bin$ ./server_lesson03d
UA Server: Initializing Stack...
...
Host name: dev-slp
IPv4 addr: 127.0.1.1
localhost: 127.0.0.1
Port name: eth0
IPv4 addr: 10.41.1.56
UA Server: Building Provider List...
UA Server: Loading Provider Modules...
Initialize CustomProvider ...
Initialize CustomProvider DONE!

#############################################
# Server started! Press CTRL+C to stop!
#############################################

Endpoint URL: opc.tcp://dev-slp:48020


The duplicated Project abcc40esk_opcua looks nearly identical:
=======================================================

dev@dev-slp:~/workspace/abcc40esk_opcua$ ./abcc40esk_opcua
ABCC Starter Kit version 2.01.01 (2015-12-14)
UA Server: Initializing Stack...
...
Host name: dev-slp
IPv4 addr: 127.0.1.1
localhost: 127.0.0.1
Port name: eth0
IPv4 addr: 10.41.1.56
App Uri: urn:dev-slp:UnifiedAutomation:UaSdkC:abcc40esk_opcua
End URL: opc.tcp://dev-slp:48020
UA Server: Building Provider List...
UA Server: Loading Provider Modules...
Initialize CustomProvider ...
ADI[0] = '1 ABP_UINT16_WRITE'
ADI[1] = '2 ABP_UINT16_READ'
Initialize CustomProvider DONE!

#############################################
# Server started! Press CTRL+C to stop!
#############################################

Endpoint URL: opc.tcp://dev-slp:48020


The client message "15:32:42.460 | DiscoveryWidget | | Discarding Server UaSdkC - LessonSecurity02 with URL @???"
seems to indicate the the URL (which was already present at my Project) was deleted or overwritten.
Is there any possibility to fix this e.g. by using UaServer_Discovery_Initialize() ?

Best Regards,
Thomas

Post Reply