8:30, EEST
September 5, 2012
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)
9:44, EEST
December 21, 2011
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?
15:32, EEST
September 5, 2012
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
7:20, EEST
December 21, 2011
15:39, EEST
September 5, 2012
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
Most Users Ever Online: 1919
Currently Online:
17 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 88
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 744
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1529
Posts: 6471
Newest Members:
guadalupechastai, joleenbunnell, WilliamViego, edwardobeckenbau, Charlesslota, hilda21x1388, bertZok, Bernardclila, doylenewbery, mickey21654Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0
Administrators: admin: 1