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
Failed to create session channel
April 6, 2014
9:12, EEST
Avatar
BeBE
New Member
Members
Forum Posts: 2
Member Since:
April 6, 2014
sp_UserOfflineSmall Offline

Hello,

I have a problem with connecting my Android Client application with B&R Automation Studio UA Server.
My Android Client is connecting properly with SampleConsoleClient and with UA Demo Server. But when I try to connect to B&R server, error occurs: Failed to create session channel to server. The error is the same when I try with SampleConsoleClient.
I tried to connect to B&R server via UnifiedAutomation UaExpert and it works property (I entered URL: opc.tcp://192.168.1.100:4841).
I tried to discover using SampleConsoleClient. The result is on the screen below.
https://drive.google.com/file/d/0B-IkuZ-4FrRkUjZlSkdIb0FwUm8/edit?usp=sharing

Can anybody help me? Why I can’t connect with this server when I enter the same URI like in UaExpert?

Best regards
Blazej Brzostowicz

April 8, 2014
9:57, EEST
Avatar
BeBE
New Member
Members
Forum Posts: 2
Member Since:
April 6, 2014
sp_UserOfflineSmall Offline

Could someone explain to me the steps to connect to server properly? I’m a student and I have Master Thesis in June in which I use my OPC UA Android Client, but problem still exist (and time is running out…)
This is what I have:

client.setUri(serverURI);
final PkiFileBasedCertificateValidator validator = new PkiFileBasedCertificateValidator();
client.setCertificateValidator(validator);
appDescription.setApplicationName(new LocalizedText(“UA_CLIENT”, Locale.ENGLISH));
appDescription.setApplicationUri(“urn:BeBE-PC/BuR/UA/EmbeddedServer”);
appDescription.setProductUri(“http://www.br-automation.com/UA/EmbeddedServer”);
appDescription.setApplicationType(ApplicationType.Client);

client.setSecurityMode(SecurityMode.NONE);

client.connect();

Do I have to use Application Certificate (with loadOrCreateCertificate)?
Do I have to use ValidationListener (with CertificateValidationListener)?
I don’t need any security. I just want to establish a connection with each server. What are the minimum NECESSARY settings to be able to connect to each server. This above works only with SampleConsoleServer and UA Demo Server. Why it not works with B&R Automation Studio UA Server?

April 15, 2014
8:27, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1010
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

There have been many similar problems, when the server is developed with the ANSI C SDK. See for example, http://www.prosysopc.com/blog/…..alid/#p738

So the problem is with the server, which is providing a different endpoint address as a response to GetEndpoints and CreateSession. The UaExpert and the C++ client applications do not validate this, but it is a required validation, nevertheless.

I am not quite sure about the B&R server: you will probably need to contact them to find out how you can define the endpoint properly. Or see the linked issue if you can use the same strategy to just define the server hostname.

April 29, 2014
12:02, EEST
Avatar
hbrackel
Member
Members
Forum Posts: 135
Member Since:
February 21, 2014
sp_UserOfflineSmall Offline

I do have the exact same problem with the latest B&R OPC UA Server and the latest UA SDK. How can I verify what endpoint address(es) the server gives back in response to the CreateSession call? The GetEndpoints response show exactly what I’m trying to connect to.

If I could tell B&R where the problem is they would certainly correct the issue.

April 29, 2014
12:14, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1010
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

If you enable log4j logging at debug level for the stack (org.opcfoundation.ua) classes, you should see the response message. I suppose the correction requires that they get a new version of the ANSI C SDK and build their server against that one. But it’s good to let them know about the issue.

April 30, 2014
16:44, EEST
Avatar
hbrackel
Member
Members
Forum Posts: 135
Member Since:
February 21, 2014
sp_UserOfflineSmall Offline

After adding the PLC’s hostname to my machine’s /etc/hosts file and using a hostname based endpoint, it worked okay (as you predicted Wink )
Thanks for your help and patience.

July 15, 2015
12:45, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1010
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

UPDATE: In Java SDK 2.1.2, you can use the new property, UaClient.set/isValidateDiscoveredEndpoints(false) to enable connection to a server that is providing different endpointUrls as a response to GetEndpoints and CreateSession.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
12 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: 683

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6261

Newest Members:

digitechroshni, LouieWreve, Kickbiche, karrimacvitie5, graciela2073, sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma

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