opcua-asyncio/freeopcua stack major interoperability bug with open62541 stack : error on handling node attributes (BadAttributeIdInvalid)
RVC69 opened this issue · 0 comments
Using a OPCUA open62541 C Client it is possible to create on a OPCUA open62541 C Server Objets Nodes and Variables Nodes with. The nodes are fully created with their properties i.e DisplayName or Value.
Using the same OPCUA open62541 C Client code on asyncua/FreeOpcua server, nodes are created correctly but without their properties. User is identifed with admin role by user manager.
Wireshark shows clearly the client message contains nodes properties, so problem may be on freeopcua stack, or I missed a sprecific parameter creating the python asyncua server.
Steps to reproduce the behavior incl code:
open62541 stack client object node using displayName and description attributes.
static UA_StatusCode addDeviceObjectNode(UA_Client client, char name, char *displayName, char *description) {
UA_NodeId deviceId;
UA_ObjectAttributes deviceAttr = UA_ObjectAttributes_default;
deviceAttr.displayName = UA_LOCALIZEDTEXT("en-US", displayName);
deviceAttr.description = UA_LOCALIZEDTEXT("en-US", description);
UA_StatusCode status = UA_Client_addObjectNode(client,
UA_NODEID_STRING(OPCUA_NAMESPACE, name), // NodeId
UA_NODEID_NUMERIC(0, UA_NS0ID_OBJECTSFOLDER), // parentNodeId
UA_NODEID_NUMERIC(0, UA_NS0ID_ORGANIZES), // referenceTypeId
UA_QUALIFIEDNAME(OPCUA_NAMESPACE, name), // browseName
UA_NODEID_NUMERIC(0, UA_NS0ID_BASEOBJECTTYPE), // typeDefinition
deviceAttr, // attributes
&deviceId); // outNewNodeId, the new created node
if (status != UA_STATUSCODE_GOOD) {
nodesCreated = false;
} else {
}
return status;
}
Asyncua server
async def main():
_logger = logging.getLogger(name)
# setup our server
server = Server(user_manager=UserManager())
await server.init()
server.set_endpoint("opc.tcp://192.168.7.8:4840/")
# set up our own namespace, not really necessary but should as spec
uri = "http://examples.freeopcua.github.io"
idx = await server.register_namespace(uri)
_logger.info("Starting server!")
async with server:
while True:
await asyncio.sleep(20)
Screenshots
asyncua.log
Version
Python-Version: 3.11.2
opcua-asyncio : 1.0.2
Thanks !