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 version not supported "Server doesn't satisfy required XML-Models. Import them first!" #1019

Closed
vhavard opened this issue Sep 6, 2022 · 8 comments

Comments

@vhavard
Copy link

vhavard commented Sep 6, 2022

Describe the bug

The asyncua does not support http://opcfoundation.org/UA/ model >1.04.7.

To Reproduce

Create a UA model from UAmodeler, with base version 1.04.7 of UA model http://opcfoundation.org/UA/
Export it to a Nodeset.xml (see attached file)

Run the server

async def main():
    logging.basicConfig(level=logging.INFO)
    server = Server()
    await server.init()
    # import some nodes from xml
    # http://opcfoundation.org/UA/ version 1.04.7 OK
    nodes1 = await server.import_xml("server-uamodeler-objecttypes-datatype-1_04_7-v4.xml") # OK Objectype with subobject TransformType -> 3DvectorType et QuaternionType
    # http://opcfoundation.org/UA/ version 1.04.11 KO
    # nodes1 = await server.import_xml("server-uamodeler-objecttypes-datatype-1_04_7-v4 - 1_04_11.xml") # KO à cause du numéro de version Objectype with subobject TransformType -> 3DvectorType et QuaternionType
    
    # starting!
    async with server:
        while True:
            await asyncio.sleep(1)


if __name__ == "__main__":
    asyncio.run(main())

it works.

Do the exact same thing with http://opcfoundation.org/UA/ version=1.04.11 or above
It does not work
Error is:
Exception has occurred: ValueError
Server doesn't satisfy required XML-Models. Import them first!

Expected behavior

Being able to use all versions of UA model
Or
being able to init server with the Opc.Ua.NodeSet2.xml used during design phases.
for example by doing:

    await server.init("path/to/UAnodeset/1.04.11/Opc.Ua.NodeSet2.xml")

Version

Python-Version:3.10.4

opcua-asyncio Version (e.g. master branch, 0.9): master branch
Files to test (please modify extension to xml):
server-uamodeler-objecttypes-datatype-1_04_7-v4 - 1_04_11.xml.txt
server-uamodeler-objecttypes-datatype-1_04_7-v4.xml.txt

@schroeder-
Copy link
Contributor

We are currently using http://opcfoundation.org/UA/ version 1.04.10 we haven't updated the library yet.
In the near future we will update to V1.05.XX.
You can update the schema your self see: /~https://github.com/FreeOpcUa/opcua-asyncio/tree/master/schemas
Also most of the time the version listed in xml files isn't need. You can just edit the xml in question to 1.04.10 and import it.

@vhavard
Copy link
Author

vhavard commented Sep 6, 2022

Thank you for you quick answer.
Is it possible to pass to the UA 1.05.+ since this is the last version of UA version ?

@schroeder-
Copy link
Contributor

I tried it some time ago and there were some code changes needed to get UA 1.05 working.

@vhavard
Copy link
Author

vhavard commented Sep 6, 2022

I tried updating the schemas with /~https://github.com/FreeOpcUa/opcua-asyncio/tree/master/schemas
The readme.md mention that:

  • Path to the .pickle file: opcua-asyncio/asyncua/binary_address_space.pickle
  • Path to the .xml Nodesets: opcua-asyncio/schemas/UA-Nodeset-master/Schema/
  • Path to the standard_address_space.py files: opcua-asyncio/asyncua/server/standard_address_space/

I was thinking that the files would be updated into my folder. But this is not the case.
Have I done something wrong?

Therefore I tried importing a specific nodeset version of UA with the import_xml command but it does not work
What I don't understand is how to use a specific UA Nodeset.xml in asyncua.
Indeed, if I do that to import a specific version of UA:

nodesua = await server.import_xml("UA-Nodeset-master/Schema/Opc.Ua.NodeSet2.xml")

However, I receive this error

Exception has occurred: BadNodeIdExists
"The requested node id is already used by another node."(BadNodeIdExists)
  File "D:\CESI\DEV\OPCUA_modeler\test\server-uamodeler-variable.py", line 35, in main
    nodesua = await server.import_xml("D:/CESI/DEV/opcua-asyncio - test update UANodeset/schemas/UA-Nodeset-master/Schema/Opc.Ua.NodeSet2.xml")
  File "D:\CESI\DEV\OPCUA_modeler\test\server-uamodeler-variable.py", line 54, in <module>
    asyncio.run(main())

Can you explain me how to update to the right version ?
Thank you

@schroeder-
Copy link
Contributor

The descrpiton is maybe a bit out of date.
You run update_ua_nodeset.py that pulls the latest nodeset(Opc.Ua.NodeSet2.xml etc) from github and executes all scripts needed to update the library. This updates the addresspace, objectids, datatypes and many more. For me it did't work on windows, try to use wsl to update the model.

nodesua = await server.import_xml("UA-Nodeset-master/Schema/Opc.Ua.NodeSet2.xml")
This is not supported, currently you can only use the Opc.Ua.Nodeset2.xml which is target via schema(update_ua_nodeset.py).

@vhavard
Copy link
Author

vhavard commented Sep 7, 2022

The descrpiton is maybe a bit out of date. You run update_ua_nodeset.py that pulls the latest nodeset(Opc.Ua.NodeSet2.xml etc) from github and executes all scripts needed to update the library. This updates the addresspace, objectids, datatypes and many more. For me it did't work on windows, try to use wsl to update the model.

nodesua = await server.import_xml("UA-Nodeset-master/Schema/Opc.Ua.NodeSet2.xml") This is not supported, currently you can only use the Opc.Ua.Nodeset2.xml which is target via schema(update_ua_nodeset.py).

Thank you again for your answer. Indeed, it does not work on Windows for me.
I will try on WSL.
However when I tried on Windows, I notice that the it pulls the latest nodeset(Opc.Ua.NodeSet2.xml etc), which is 1.05.1, which is not supported yet by asyncua as you told me.
Would it be possible to update the scripts to support an update of a specific branch and tag of modest?

@schroeder-
Copy link
Contributor

Update to 1.05.02 see #1047
Will make a pr to get the schema generation working on windows next.

@schroeder-
Copy link
Contributor

Schema generation works know under windows in #1049 . Also you can chose now which branch and/or tag to use, via commandline.

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

2 participants