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
How to get the NodeID's of a Server ( Coded in C) on the Android UI
June 2, 2019
15:19, EEST
Avatar
Rakshan
Member
Members
Forum Posts: 30
Member Since:
June 2, 2019
sp_UserOfflineSmall Offline

Hi There,

I am a beginner in OPCUA.

As a student Project, i need to develop an Android Application, which would communicate with a Raspberry PI which has a OPCUA Server(coded in Objective C).
My motive now, is to make changes to the nodes through the APP itself and not through hardcoding.

First and foremost, how will i be able to see the list of available nodes on my application?
Also, if i make changes to any particular node, where it will get reflected in the server?

Please let me know.

June 3, 2019
10:36, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 982
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Answered at https://forum.prosysopc.com/forum/opc-ua-java-sdk/jumping-to-a-node-by-the-string-nodeid/. But to answer shortly, you would use the Browse service call to get References from a known NodeId. You cannot get “all” in one call (UA does not work like that, the number of NodeIds can be technically a very large number etc.). What happens on the server side, depends on the server application.

June 6, 2019
23:55, EEST
Avatar
Rakshan
Member
Members
Forum Posts: 30
Member Since:
June 2, 2019
sp_UserOfflineSmall Offline

Well thanks for the link. As i am new to OOP, it is a touch difficult to use the methods and figure out.

I am not able to use the correct method to list out all the nodes present in the server.
To give a brief about the code,

ApplicationDescription applicationDescription = new ApplicationDescription();
applicationDescription.setApplicationName(new LocalizedText(“AndroidClient”, Locale.ENGLISH));
applicationDescription.setApplicationUri(“urn:localhost:AndroidClient”);
applicationDescription.setProductUri(“urn:localhost:AndroidClient”);
applicationDescription.setApplicationType(ApplicationType.Client);
KeyPair myClientApplicationInstanceCertificate = ExampleKeys.getCert(getApplicationContext(), applicationDescription);

// Create Client
Client myClient = Client.createClientApplication(myClientApplicationInstanceCertificate);
EndpointDescription[] endpoints = myClient.discoverEndpoints(“opc.tcp://192.168.4.1:4840”) //connect to my server

// Filter out all but opc.tcp protocol endpoints
endpoints = EndpointUtil.selectByProtocol(endpoints, “opc.tcp”);

// Filter out all but Signed & Encrypted endpoints
endpoints = EndpointUtil.selectByMessageSecurityMode(endpoints, MessageSecurityMode.None);

// Filter out all but Basic256Sha256 cryption endpoints
endpoints = EndpointUtil.selectBySecurityPolicy(endpoints, SecurityPolicy.NONE);

// Sort endpoints by security level. The lowest level at the beginning, the highest at the end of the array
endpoints = EndpointUtil.sortBySecurityLevel(endpoints);

// Choose one endpoint.
EndpointDescription endpoint = endpoints[endpoints.length – 1];

SessionChannel mySession = myClient.createSessionChannel(endpoint);
mySession.activate();


I am not finding any method to get the list of nodes present in the server.
This is for a purpose of developing a client application on android. So, i plan to have a list of all nodes present.

Please guide me here.

June 7, 2019
10:27, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 982
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Answered in https://forum.prosysopc.com/forum/opc-ua-java-sdk/jumping-to-a-node-by-the-string-nodeid/ and I recommend continuing discussion there as in practice this is about basics with the SDK. One additional thing is that please start by reading the “Prosys_OPC_UA_SDK_for_Java_Starting_Guide.pdf” in the ‘tutorial’ folder of the SDK zip. And to be exact, the “SDK zip” here means the ‘prosys-opc-ua-sdk-for-java-4.0.2-808-client-server-evaluation.zip’ zip,for which you obtained a link via email by filling this form https://www.prosysopc.com/products/opc-ua-java-sdk/evaluate/.

June 8, 2019
9:47, EEST
Avatar
Rakshan
Member
Members
Forum Posts: 30
Member Since:
June 2, 2019
sp_UserOfflineSmall Offline

Yes. I am trying to explore with the Prosys client server sdk now.
Apparantly, the library for ” PkiFileBasedCertificateValidator” and “CertificateValidationListener” are not recognised on Android Studio. Anything i am missing out on?

June 10, 2019
12:21, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 982
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Those do not anymore exist as of SDK 4.x nor should be mentioned anywhere anymore anyway (but it is possible that due some error they could be mentioned somewhere in the tutorials if some part was not updated, sorry). They are not used by the samples. Use a combination of PkiDirectoryCertificateStore+DefaultCertificateValidator like in SampleConsoleClient.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
17 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

ibrahim: 75

rocket science: 75

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 709

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1465

Posts: 6252

Newest Members:

christi10l, ahamad1, Flores Frederick, ellenmoss, harriettscherer, shanonhumphreys, KupimotoblokfuB, tamhollander5, paulinafcf, bridgette18l

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

Administrators: admin: 1