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

[BUG]"OPC-UA Connector: Attribute Update Issue with Shared 'deviceName' Attribute" #1630

Open
VishnuPriyaKasula opened this issue Dec 20, 2024 · 0 comments
Assignees
Labels

Comments

@VishnuPriyaKasula
Copy link

Describe the bug
When attempting to update the shared deviceName attribute in ThingsBoard, the value does not propagate to the OPC-UA simulator. The following error appears in the log:

2024-12-20 11:05:11 - |ERROR| - [opcua_connector.py] - opcua_connector - on_attributes_update - 471 - Node not found! (list index out of range)

Versions (please complete the following information):

  • OS: Ubuntu 24.04.1 LTS
  • ThingsBoard IoT Gateway version: 3.5.1
  • ThingsBoard Server version: 3.7.1
  • Python version: 3.12.3

Steps to Reproduce:

  1. Follow the ThingsBoard IoT Gateway OPC-UA configuration guide to configure the OPC-UA connector.
  2. Add a shared attribute deviceName in ThingsBoard with a value.
  3. Ensure the OPC-UA connector is configured to read the deviceName value.
  4. Monitor the logs for any updates from ThingsBoard.
  5. Observe the error Node not found! (list index out of range) in the log.

Expected Behavior:
When the shared attribute deviceName is updated in ThingsBoard, the new value should propagate to the OPC-UA simulator.

Configuration:

{
  "server": {
    "name": "OPC-UA Default Server",
    "url": "opc.tcp://localhost:53530/OPCUA/SimulationServer",
    "timeoutInMillis": 5000,
    "scanPeriodInMillis": 5000,
    "disableSubscriptions": false,
    "subCheckPeriodInMillis": 100,
    "showMap": false,
    "security": "Basic128Rsa15",
    "identity": {
      "type": "anonymous"
    },
    "mapping": [
      {
        "deviceNodePattern": "Root\.Objects\.Simulation",
        "deviceNamePattern": "Device OPC-UA",
        "attributes": [
          {
            "key": "Counter",
            "path": "${ns=2;i=5}"
          }
        ],
        "rpc_methods": [
          {
            "method": "multiply",
            "arguments": [2, 4]
          }
        ],
        "attributes_updates": [
          {
            "attributeOnThingsBoard": "deviceName",
            "attributeOnDevice": "Root\.Objects\.Simulation\.deviceName"
          }
        ]
      }
    ]
  }
}

Additional Context:
The opcua_connector.py script is unable to locate the node Root\.Objects\.Simulation\.deviceName, resulting in a "list index out of range" error. This may indicate an issue with the node path mapping.

Describe the bug
Clear and concise description of what the bug is.

Connector name (If bug in the some connector):
[e.g. OPC-UA Connector]

Versions (please complete the following information):

  • OS: [e.g. Ubuntu 18.04]
  • Thingsboard IoT Gateway version [e.g. 2.0]
  • Python version[e.g. 3.7]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants