Skip to content

Please merge latest gopcua library #9551

@jnangle

Description

@jnangle

Relevant telegraf.conf:

  ## Metric name
  # name = "opcua"
  #
  ## OPC UA Endpoint URL
  endpoint = "opc.tcp://10.79.116.248:4840"
  #
  ## Maximum time allowed to establish a connect to the endpoint.
  connect_timeout = "30s"
  #
  ## Maximum time allowed for a request over the estabilished connection.
  request_timeout = "20s"
  #
  ## Security policy, one of "None", "Basic128Rsa15", "Basic256",
  ## "Basic256Sha256", or "auto"
  security_policy = "None"
  #
  ## Security mode, one of "None", "Sign", "SignAndEncrypt", or "auto"
  security_mode = "None"
  #
  ## Path to cert.pem. Required when security mode or policy isn't "None".
  ## If cert path is not supplied, self-signed cert and key will be generated.
  # certificate = "/etc/telegraf/cert.pem"
  #
  ## Path to private key.pem. Required when security mode or policy isn't "None".
  ## If key path is not supplied, self-signed cert and key will be generated.
  # private_key = "/etc/telegraf/key.pem"
  #
  ## Authentication Method, one of "Certificate", "UserName", or "Anonymous".  To
  ## authenticate using a specific ID, select 'Certificate' or 'UserName'
  auth_method = "Anonymous"
  #
  ## Username. Required for auth_method = "UserName"
  # username = ""
  #
  ## Password. Required for auth_method = "UserName"
  # password = ""
  #
   nodes = [
     {name="CabinetTemp_M1", namespace="2", identifier_type="i", identifier="1030"}
   ]

System info:

I'm currently using Telefraf 1.20.0-6f2553d6 for Windows (amd64), running on Windows 10. I am attempting to connect to a Red Lion DA50 running a Crimson v3.1 OPC UA server.

Telegraf will connect to a Kepware v6.10 and a ProSys OPC UA simulation server. It will not connect to the Red Lion. However, I am able to connect to the Red Lion using the gopcua library v0.1.13.

Steps to reproduce:

  1. If I use the configuration above, I get: Error in plugin: registerNodes failed: The operation timed out. StatusBadTimeout (0x800A0000) when attempting to connect to the Red Lion server using Telegraf.

  2. When I connect to the ProSys server, or the KepWare server, the data logs to my local InfluxDB installation using Telegraf.

  3. I can connect to the Red Lion server from KepWare and UAExpert, using the same connection url: opc.tcp://10.79.116.248:4840, and I am able to read data tags.

Expected behavior:

This is the behavior when running gopcua v0.1.13 monitoring example. I include this to illustrate that the library is able to connect to the Red Lion server.

jnangle-31556s:opcua@v0.1.13 jnangle$ go run examples/monitor/monitor.go -endpoint opc.tcp://10.79.116.248:4840 -node 'ns=2;i=1030'
2021/07/27 13:30:01 *http://opcfoundation.org/UA/SecurityPolicy#NoneMessageSecurityModeNone
2021/07/27 13:30:01 [channel ] sub=4713 ts=2021-07-27T19:28:23Z node=ns=2;i=1030 value=44
2021/07/27 13:30:01 [callback] sub=4714 ts=2021-07-27T19:28:23Z node=ns=2;i=1030 value=44
2021/07/27 13:30:01 [channel ] sub=4713 ts=2021-07-27T19:28:23Z node=ns=2;i=1030 value=44.20000076293945
^Z
[5]+ Stopped go run examples/monitor/monitor.go -endpoint opc.tcp://10.79.116.248:4840 -node 'ns=2;i=1030'
jnangle-31556s:opcua@v0.1.13 jnangle$

Actual behavior:

D:\InfluxDB\telegraf-latest\telegraf-1.20.0>.\telegraf --config http://localhost:8086/api/v2/telegrafs/07d830630e2b0000 --test
2021-07-27T22:05:50Z I! Starting Telegraf
2021-07-27T22:05:50Z D! [agent] Initializing plugins
2021-07-27T22:05:50Z I! Failed to load certificate: open /etc/telegraf/cert.pem: The system cannot find the path specified.
2021-07-27T22:05:50Z D! [agent] Starting service inputs
2021-07-27T22:06:11Z E! [inputs.opcua] Error in plugin: registerNodes failed: The operation timed out. StatusBadTimeout (0x800A0000)
2021-07-27T22:06:11Z D! [agent] Stopping service inputs
2021-07-27T22:06:11Z D! [agent] Input channel closed
2021-07-27T22:06:11Z D! [agent] Stopped Successfully
2021-07-27T22:06:11Z E! [telegraf] Error running agent: input plugins recorded 1 errors

D:\InfluxDB\telegraf-latest\telegraf-1.20.0>

Additional info:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions