Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
SampleConsoleClient connects fine localy , but no success for another client from distant machine :/
September 5, 2012
8:30, EEST
Avatar
Rico
Member
Members
Forum Posts: 4
Member Since:
September 5, 2012
sp_UserOfflineSmall Offline

Hello,
I’ve certainly missed something in the server configuration.
I’ve tested the server.setUse…things and I didn’t see any change especialy with the setUseAllIpAddresses() method or setUseCanonicalHostname() one

my etc/hosts is like this :
127.0.0.1 localhost
127.0.1.1 mymachine
192.168.1.2 mymachine

is there a way to tell the SampleConsoleServer to accept connections from “outside” of the localhost ?
which system file does server.setUseAllIpAddresses() refers to ?

thank you for your support.
cheers
Eric
config wanted : server : OPCUA sdk running on linux ARM board ,
and client running from another machine win or linux one)

September 5, 2012
9:44, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1010
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

You should be able to connect by default from a remote client, if the IP Port is just accessible.

The setUse… methods define which endpointUrls are generated in the server’s endpoint list, but nowadays the client should be able to pick a suitable one even if you use a different URL when you connect.

E.g. if you connect to opc.tcp://192.168.1.2:52520/OPCUA/SampleConsoleServer

it should work even if the server only defines the default endpoint for opc.tcp://mymachine:52520/OPCUA/SampleConsoleServer

Of course this depends on the client as well, so I am mainly referring to our UaClient-based apps, such as the SampleConsoleClient. It should display a warning, though, that it’s using a different endpoint than what was used for connecting.

I suppose you are connecting without security?

September 6, 2012
15:32, EEST
Avatar
Rico
Member
Members
Forum Posts: 4
Member Since:
September 5, 2012
sp_UserOfflineSmall Offline

Dear Jouni, thank you for your reply.

actually I dd the testing with the the SampleConsoleClient and put the logger.console to INFO to see what the server was doing during the init() .
It seems to bind correctly the endpoints with various hostnames and IP yet no succes in contecting from outside with the IP adrress !!
very wreid !
and the IP address is working well when I run a simple socket server on port 52520, I can connect correctly.

here’s the logger info :
(i put some extra info after each server.set instruction)
setUseHostName-true
setUseLocalhost-true
setUseAllIpAddress-TRUE
setUseCanonicalHostName-true
01/01/1970 00:12:25.522 INFO Reading application certificate from /root/PKI/CA/private/SampleConsoleServer.der
01/01/1970 00:12:29.094 INFO Reading private key from keystore /root/PKI/CA/private/SampleConsoleServer.pem
01/01/1970 00:13:46.213 INFO Compliance address space created.
01/01/1970 00:13:46.218 INFO Address space created.
01/01/1970 00:13:46.978 INFO TCP/IP Socket bound to armadeus.192.168.1.2/127.0.1.1:52520
01/01/1970 00:13:47.014 INFO Endpoint bound opc.tcp://armadeus.192.168.1.2:52520/OPCUA/SampleConsoleServer
01/01/1970 00:13:47.020 INFO Server endpoint bound to opc.tcp://armadeus.192.168.1.2:52520/OPCUA/SampleConsoleServer
01/01/1970 00:13:47.042 INFO Endpoint bound opc.tcp://127.0.1.1:52520/OPCUA/SampleConsoleServer
01/01/1970 00:13:47.047 INFO Server endpoint bound to opc.tcp://127.0.1.1:52520/OPCUA/SampleConsoleServer
01/01/1970 00:13:47.065 INFO Endpoint bound opc.tcp://127.0.1.1:52520
01/01/1970 00:13:47.070 INFO Discovery endpoint bound to opc.tcp://127.0.1.1:52520
01/01/1970 00:13:47.112 INFO TCP/IP Socket bound to localhost/127.0.0.1:52520
01/01/1970 00:13:47.117 INFO Endpoint bound opc.tcp://localhost:52520/OPCUA/SampleConsoleServer
01/01/1970 00:13:47.123 INFO Server endpoint bound to opc.tcp://localhost:52520/OPCUA/SampleConsoleServer
01/01/1970 00:13:47.136 INFO Endpoint bound opc.tcp://localhost:52520
01/01/1970 00:13:47.141 INFO Discovery endpoint bound to opc.tcp://localhost:52520
01/01/1970 00:13:47.189 INFO Simulation started.

Jouni Aro said

You should be able to connect by default from a remote client, if the IP Port is just accessible.

The setUse… methods define which endpointUrls are generated in the server’s endpoint list, but nowadays the client should be able to pick a suitable one even if you use a different URL when you connect.

E.g. if you connect to opc.tcp://192.168.1.2:52520/OPCUA/SampleConsoleServer

it should work even if the server only defines the default endpoint for opc.tcp://mymachine:52520/OPCUA/SampleConsoleServer

Of course this depends on the client as well, so I am mainly referring to our UaClient-based apps, such as the SampleConsoleClient. It should display a warning, though, that it’s using a different endpoint than what was used for connecting.

nop, no warning for that !

I suppose you are connecting without security?

yes , security is set to[none,none]

and the SampleConsoleClient replies :

01/01/1970 00:30:44.620 WARN Connection failed: Bad_ConnectionRejected (code=0x80AC0000, description=”2158755840, Connection refused”)
com.prosysopc.ua.client.ConnectException: Failed to retrieve endpoints. The server is not available: opc.tcp://192.168.1.2:52520/OPCUA/SampleConsoleServer ServiceResult=Bad_ServerNotConnected (0x800D0000) “The operation could not complete because the client is not connected to the server.”

best regards
Eric

September 7, 2012
7:20, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1010
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

This looks a bit odd:

opc.tcp://armadeus.192.168.1.2:52520/OPCUA/SampleConsoleServer

Do you know why it’s giving such a hostname?

Can you connect with telnet to the port?

September 10, 2012
15:39, EEST
Avatar
Rico
Member
Members
Forum Posts: 4
Member Since:
September 5, 2012
sp_UserOfflineSmall Offline

Jouni Aro said

This looks a bit odd:

opc.tcp://armadeus.192.168.1.2:52520/OPCUA/SampleConsoleServer

Do you know why it’s giving such a hostname?

Can you connect with telnet to the port?

hello Jouni,
finally I managed to get the onnection work !
was probably something aroundthe server name and etc/hosts
I replace it with the IP address and connect successfully .

thank you for your support
cheers
Eric

September 10, 2012
16:22, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1010
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Great! Thanks for the confirmation.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
15 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

Ibrahim: 76

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 681

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6261

Newest Members:

graciela2073, sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma, fidelduke938316, Jan-Pfizer, DavidROunc, fen.pang@woodside.com

Moderators: Jouni Aro: 1010, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 321, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1