Skip to content

v1.1.8 no longer works with OPC PLC #1883

@daniel-sintef

Description

@daniel-sintef

Hi Everyone,

I want to use asyncua to connect to the Microsoft OPC PLC demo server via docker.

I have this code which writes to a custom node I have developed:

import asyncio
from asyncua import Client, ua

URL = "opc.tcp://localhost:4840"

async def main():
    print(f"Connecting to {URL} ...")
    async with Client(url=URL) as client:
        print("CONNECTED!")


if __name__ == "__main__":
    try:
        asyncio.run(main())
    except Exception as e:
        print(f"An error occurred: {e}")

On v1.1.6 this works:

Connecting to opc.tcp://localhost:4840 ...
CONNECTED!

But on v1.1.8 it fails:

Connecting to opc.tcp://localhost:4840 ...
ServiceFault (BadServerUriInvalid, diagnostics: DiagnosticInfo(SymbolicId=None, NamespaceURI=None, Locale=None, LocalizedText=None, AdditionalInfo=None, InnerStatusCode=None, InnerDiagnosticInfo=None)) from server received  in response to CreateSessionRequest
An error occurred: The ServerUri is not a valid URI.(BadServerUriInvalid)

I suspect maybe there has been some subtle change in validation that affects my use case? I'm also happy to change how I use the client, but I've been banging my head for some time and can't figure it out.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions