Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opcua-asyncio/freeopcua stack major interoperability bug with open62541 stack : error on handling node attributes (BadAttributeIdInvalid) #1694

Open
RVC69 opened this issue Aug 11, 2024 · 0 comments

Comments

@RVC69
Copy link

RVC69 commented Aug 11, 2024

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

UA_Expert_ObjectNode
UA_Expert_Variable
WS_Client_request1
WS_Client_request2
WS_Client_response1
WS_Client_response2
asyncua.log

Version

Python-Version: 3.11.2
opcua-asyncio : 1.0.2

Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant