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
Libraries in the Java SDk evaluation edition
February 19, 2021
14:29, EET
Avatar
igonzalez
Member
Members
Forum Posts: 3
Member Since:
February 19, 2021
sp_UserOfflineSmall Offline

Hello,

Last week I received the evaluation SDK for Java. I want to create a client y Android. Si I added the libraries in the Lib-androd folder and also the other .jar files as the readme file says. But when I open the example codes I see that the use other libraries and the ones I have added in my project dont have the libraries needed to connect according to the help files. I have read that the libraries are now included in a single one but I cannot find the methods there.
Also when I try using the libraries in the examples I am not able to connect with the server ( I am using the PROSYS similation server) I use the Client SecurityMode.None, set the ApplicationIdentity in the client and try to connect but the result is that I cannot connect.
So I have tried with other examples that look for the end points and the result is the same, cannot find the endpoints (.dicoverEndpoints() method)
Please tell me which libraries I must use. And if I am using the right ones why could it be that I cannot conect? (Prosys Simulation Client connects with the Simulation Server)

Thank you in advance for your help

February 19, 2021
15:46, EET
Avatar
Matti Siponen
Moderator
Members

Moderators
Forum Posts: 100
Member Since:
February 11, 2020
sp_UserOfflineSmall Offline

Hello,

Have you tried following the instructions for Android development found on our blog? If you have, you should know that the information on those blog posts is very outdated. Instead, you should follow the instructions provided in tutorial folder of the SDK distribution and try importing the sample applications to Eclipse or another IDE and run them. Or you can skip that and begin developing you Client following the Client Tutorial.

Let me know if you don’t understand something about the tutorials. For more specific advice, I would need to know which version of the SDK you’re using.

Also, what do you mean with Prosys Simulation Client? We don’t have such a product.

February 25, 2021
17:52, EET
Avatar
igonzalez
Member
Members
Forum Posts: 3
Member Since:
February 19, 2021
sp_UserOfflineSmall Offline

Hello,

Thank you for your answer. I forgot about the blog and focused in the pdf enclosed in the evaluation bundle. I found that the evaluation I received (prosys-opc-ua-sdk-for-java-4.5.2-1343-evaluation) did not include the library prosys-opc-ua-sdk-client-server-evaluation .jar So I search for it and found a bundle also evalution that included it prosys-opc-ua-sdk-client-server-evaluation-4.3.0-1075 exactly.
I created another basic app and the result I get is exactly the same com.prosysopc.ua.client.ConnectException: Failed to retrieve endpoints. The server is not available: opc.tcp://DESKTOP-CRB8L79:53530/OPCUA/SimulationServer ServiceResult=Bad_ConnectionRejected (0x80AC0000) “Could not establish a network connection to remote server.”
This is the code I am using.
UaClient client = null;
String result = null;
try {
client = new UaClient(“opc.tcp://DESKTOP-CRB8L79:53530/OPCUA/SimulationServer”);
// ApplicationIdentity applicationIdentity = new ApplicationIdentity();
ApplicationDescription appDescription = new ApplicationDescription();
// applicationIdentity.;
appDescription.setApplicationName(new LocalizedText(“WASignodeOPCUAClient”,
Locale.ENGLISH));
String android_id = Settings.Secure.getString(
getApplicationContext().getContentResolver(),
Settings.Secure.ANDROID_ID);
appDescription.setApplicationUri(“urn:” + android_id +”:UA:WASignodeOPCUAClient”);
appDescription.setProductUri(“urn:signode.com:UA:WASignodeOPCUAClient”);
appDescription.setApplicationType(ApplicationType.Client);

ApplicationIdentity identity = new ApplicationIdentity();
identity.setApplicationDescription(appDescription);

client.setApplicationIdentity(identity);

client.setTimeout(60000);
client.setSecurityMode(SecurityMode.NONE);
client.setUserIdentity(new UserIdentity());
client.connect();

When it reaches the client.connect the exception rises.
Is there any problem that I am not able to see.
Thank you in advance

February 26, 2021
8:53, EET
Avatar
Matti Siponen
Moderator
Members

Moderators
Forum Posts: 100
Member Since:
February 11, 2020
sp_UserOfflineSmall Offline

Hello,

I was able to connect to Simulation Server using this code, so there doesn’t seem to be anything wrong with the code, though I did set android_id to “android” when testing the code, but that shouldn’t affect the result.

The exception you’re receiving would suggest that Simulation Server is not available at the address you’re using. Have you verified that you can connect to it from the computer you’re developing your application at?

February 26, 2021
17:54, EET
Avatar
igonzalez
Member
Members
Forum Posts: 3
Member Since:
February 19, 2021
sp_UserOfflineSmall Offline

Hello,

I start the Simulation server on my computer, then I copy the conection address (ua tcp) into my code in Adroid and run the program without stopping the server (both programs are running in my computer) and I get always the same result com.prosysopc.ua.client.ConnectException: Failed to retrieve endpoints. The server is not available: opc.tcp://DESKTOP-CRB8L79:53530/OPCUA/SimulationServer ServiceResult=Bad_ConnectionRejected (0x80AC0000) “Could not establish a network connection to remote server.”
I have also tried the Local discory Server opc.tcp://localhost:4840 but the result again does not change
When executed the Prosys OPC UA Client connects with the Simulation server
I am completly lost in what can be the problem
Thank you for your comments

March 1, 2021
8:38, EET
Avatar
Matti Siponen
Moderator
Members

Moderators
Forum Posts: 100
Member Since:
February 11, 2020
sp_UserOfflineSmall Offline

Hello,

Is the Client application running inside a virtual machine? The exception suggests that something is blocking the access from the Client application to Simulation Server and a firewall between a virtual machine and its host could do that.

Could you provide us with debug level logs from your Client application and Simulation Server? You can send those logs to uajava-support@prosysopc.com so that we can take a look at them.

Also, could you use Wireshark to capture traffic between the applications and sent the logs to us? See https://www.prosysopc.com/blog/opc-ua-wireshark/ for instruction on how to capture OPC UA communication with Wireshark. If you’re running the applications on the same host, remember to select “Support loopback traffic” option when installing Wireshark.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 267

Currently Online:
12 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 109

pramanj: 86

ibrahim: 71

kapsl: 57

gjevremovic: 49

TimK: 41

fred: 41

Fransua33: 39

Xavier: 34

rocket science: 33

Member Stats:

Guest Posters: 0

Members: 1302

Moderators: 15

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1106

Posts: 4680

Newest Members:

keremcoban, hypnos97, ekosunen40, janellbusby73, huey6201719746, hildanott654389, laurenemay, aman79, dawnpreciado138, daltondoughty96

Moderators: Jouni Aro: 877, Otso Palonen: 32, Tuomas Hiltunen: 5, janimakela: 0, Pyry: 1, Terho: 0, Petri: 0, Bjarne Boström: 642, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Teppo Uimonen: 21, Markus Johansson: 30, Matti Siponen: 100, Lusetti: 0

Administrators: admin: 1