I have a problem when I was trying to run the SampleConsoleServer.sh on Gumstix Overo Air Com (Ubuntu 10.04 armv7l) it shows this message during the server initialization
WARN Could not register server (offline) to Discovery Server at opc.tcp://localhost:4840 Cause: Failed to retrieve endpoints. The server is not available: opc.tcp://localhost:4840
INFO Compliance address space created.
INFO Address space created.
INFO Server endpoint bound to opc.tcp://127.0.1.1:52520/OPCUA/SampleConsoleServer
INFO Discovery endpoint bound to opc.tcp://127.0.1.1:52520/OPCUA/SampleConsoleServer
INFO Server endpoint bound to opc.tcp://localhost:52520/OPCUA/SampleConsoleServer
INFO Discovery endpoint bound to opc.tcp://localhost:52520/OPCUA/SampleConsoleServer
INFO Server endpoint bound to opc.tcp://naksita-desktop:52520/OPCUA/SampleConsoleServer
INFO Discovery endpoint bound to opc.tcp://naksita-desktop:52520/OPCUA/SampleConsoleServer WARN Could not register server (online) to Discovery Server at opc.tcp://localhost:4840 Cause: Failed to retrieve endpoints. The server is not available: opc.tcp://localhost:4840
then the client from the other machine cannot connect to this server. I have no problem when I was running this SampleConsoleServer on PC.
I also tried to look in the code to see what happened but it seems that this problem occurs in UAServer.init() method which I don't have to source code.
I assume you have no Discovery Server installed on the Linux box. Therefore the demo server is not able to register with the discovery server.
A client tries first to discover the available servers on a host using port 4840. I assume this is the problem with connecting the client. If you try the server URL directly it should work.
If you have only one OPC UA server running on a host, you can run this server directly on Port 4840 since every UA server is also a discovery server for itself.
Yes, after I managed to run the server directly on port 4840 plus changed the /etc/hosts file to link my machine name to the network interface IP then I could connect the client to the server from different machine.