I am currently developing an OPC-UA Client in C++ using the Open62541 library. I am able to connect and read tag values when I attempt this with Ignition v7.9, but am having issues when attempting the same thing in Ignition v8.1. Below are the log messages from each:
Ignition v7.9
[2024-01-23 20:27:06.462 (UTC-0800)] warn/userland AcceptAll Certificate Verification. Any remote certificate will be accepted.
[2024-01-23 20:27:06.478 (UTC-0800)] info/channel Connection 296 | SecureChannel 3 | SecureChannel opened with SecurityPolicy http://opcfoundation.org/UA/SecurityPolicy#None and a revised lifetime of 600.00s
[2024-01-23 20:27:06.478 (UTC-0800)] info/client Client Status: ChannelState: Open, SessionState: Closed, ConnectStatus: Good
[2024-01-23 20:27:06.479 (UTC-0800)] info/client Use the EndpointURL opc.tcp://127.0.0.1:4096/discovery returned from FindServers
[2024-01-23 20:27:06.480 (UTC-0800)] info/client Client Status: ChannelState: Closed, SessionState: Closed, ConnectStatus: Good
[2024-01-23 20:27:06.484 (UTC-0800)] info/channel Connection 296 | SecureChannel 4 | SecureChannel opened with SecurityPolicy http://opcfoundation.org/UA/SecurityPolicy#None and a revised lifetime of 600.00s
[2024-01-23 20:27:06.484 (UTC-0800)] info/client Client Status: ChannelState: Open, SessionState: Closed, ConnectStatus: Good
[2024-01-23 20:27:06.485 (UTC-0800)] warn/client The server returned Endpoints with a different EndpointUrl opc.tcp://127.0.0.1:4096/discovery than was used to initialize the connection: opc.tcp://127.0.0.1:4096/discovery. Some servers require a complete match of the EndpointUrl/DiscoveryUrl (including the path) to return all endpoints.
[2024-01-23 20:27:06.485 (UTC-0800)] info/client Selected endpoint 0 in URL opc.tcp://127.0.0.1:4096/iaopcua/None with SecurityMode None and SecurityPolicy http://opcfoundation.org/UA/SecurityPolicy#None
[2024-01-23 20:27:06.485 (UTC-0800)] info/client Selected UserTokenPolicy anonPolicy with UserTokenType Anonymous and SecurityPolicy http://opcfoundation.org/UA/SecurityPolicy#None
[2024-01-23 20:27:06.490 (UTC-0800)] info/client Client Status: ChannelState: Open, SessionState: Created, ConnectStatus: Good
[2024-01-23 20:27:06.491 (UTC-0800)] info/client Client Status: ChannelState: Open, SessionState: Activated, ConnectStatus: Good
[2024-01-23 20:27:06.492 (UTC-0800)] info/userland date is: 24-1-2024 4:27:6.491
[2024-01-23 20:27:06.492 (UTC-0800)] info/client Client Status: ChannelState: Closed, SessionState: Closed, ConnectStatus: Good
Ignition v8.1
[2024-01-24 09:40:11.635 (UTC-0600)] warn/userland AcceptAll Certificate Verification. Any remote certificate will be accepted.
[2024-01-24 09:40:11.648 (UTC-0600)] info/channel Connection 240 | SecureChannel 27 | SecureChannel opened with SecurityPolicy http://opcfoundation.org/UA/SecurityPolicy#None and a revised lifetime of 600.00s
[2024-01-24 09:40:11.648 (UTC-0600)] info/client Client Status: ChannelState: Open, SessionState: Closed, ConnectStatus: Good
[2024-01-24 09:40:11.648 (UTC-0600)] info/client Use the EndpointURL opc.tcp://127.0.0.1:62541/discovery returned from FindServers
[2024-01-24 09:40:11.648 (UTC-0600)] info/client Client Status: ChannelState: Closed, SessionState: Closed, ConnectStatus: Good
[2024-01-24 09:40:11.649 (UTC-0600)] info/channel Connection 292 | SecureChannel 28 | SecureChannel opened with SecurityPolicy http://opcfoundation.org/UA/SecurityPolicy#None and a revised lifetime of 600.00s
[2024-01-24 09:40:11.649 (UTC-0600)] info/client Client Status: ChannelState: Open, SessionState: Closed, ConnectStatus: Good
[2024-01-24 09:40:11.650 (UTC-0600)] warn/client The server returned Endpoints with a different EndpointUrl opc.tcp://127.0.0.1:62541/discovery than was used to initialize the connection: opc.tcp://127.0.0.1:62541/discovery. Some servers require a complete match of the EndpointUrl/DiscoveryUrl (including the path) to return all endpoints.
[2024-01-24 09:40:11.650 (UTC-0600)] info/client Selected endpoint 0 in URL opc.tcp://127.0.0.1:62541 with SecurityMode None and SecurityPolicy http://opcfoundation.org/UA/SecurityPolicy#None
[2024-01-24 09:40:11.650 (UTC-0600)] info/client Selected UserTokenPolicy anonymous with UserTokenType Anonymous and SecurityPolicy http://opcfoundation.org/UA/SecurityPolicy#None
[2024-01-24 09:40:11.650 (UTC-0600)] info/client Received a ServiceFault response
[2024-01-24 09:40:11.650 (UTC-0600)] info/client The ServiceResult has the StatusCode BadServiceUnsupported
[2024-01-24 09:40:11.650 (UTC-0600)] info/client Client Status: ChannelState: Open, SessionState: Closed, ConnectStatus: BadServiceUnsupported
[2024-01-24 09:40:11.651 (UTC-0600)] info/client Client Status: ChannelState: Closed, SessionState: Closed, ConnectStatus: BadServiceUnsupported
The difference is that it is able to create a session with v7.9, but gets the error message "Received a ServiceFault response". Are there any major differences in Ignition v8.1 that would cause issues with creating a session to the OPC-UA Server?
The C++ code is the same for both situations (shown below):
int main(void) {
UA_Client *client = UA_Client_new();
UA_ClientConfig_setDefault(UA_Client_getConfig(client));
UA_StatusCode retval = UA_Client_connect(client, "opc.tcp://127.0.0.1:62541");
UA_Client_delete(client);
return 0;
}