gopcua / opcua

Native Go OPC-UA library
MIT License
829 stars 253 forks source link

Error when using expanded nodeid #724

Open alexmc1510 opened 2 months ago

alexmc1510 commented 2 months ago

Hello,

I am working on the implementation of expanded nodeid in telegraf but I receive the following error from gopcua library:

Error running agent: could not initialize input inputs.opcua_listener: opcua: namespace urls require a server NamespaceArray

The nodeid I am trying to read is the following one:

{name="ServiceLevel", namespace_string="http://opcfoundation.org/UA/", identifier_type="i", identifier="2267"},

If I configure it as a basic nodeid it works perfectly: {name="ServiceLevel", namespace="0", identifier_type="i", identifier="2267"},

2024-05-03T11:05:36Z D! [inputs.opcua_listener] Connected to OPC UA Server
2024-05-03T11:05:36Z D! [inputs.opcua_listener] Creating OPC UA subscription
2024-05-03T11:05:36Z D! [inputs.opcua_listener] Subscribed with subscription ID 541
2024-05-03T11:05:36Z D! [inputs.opcua_listener] Monitoring items
2024-05-03T11:05:37Z D! [inputs.opcua_listener] Received data change notification with 1 items
2024-05-03T11:05:37Z D! [inputs.opcua_listener] Data change notification: node "i=2267" value changed from <nil> to 255

Would you be so kind as to test if I am missing something in the nodeid definition?

Regards