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] Attribute Update on OPC-UA Connector with M241 PLC #1555

Open
JavierNR opened this issue Oct 10, 2024 · 0 comments
Open

[BUG] Attribute Update on OPC-UA Connector with M241 PLC #1555

JavierNR opened this issue Oct 10, 2024 · 0 comments
Assignees
Labels

Comments

@JavierNR
Copy link
Contributor

Describe the bug
Hello,

I see that TB team put some love on gateway and I'm trying the latest version with OPC-UA connector + M241 PLC.
Works great so far regarding reading from OPC-UA to thingsboard attributes and telemetry, but I have a problem with attribute update as it doesn't work. The remote log says:

opcua_connector on_attributes_update - 784 - Node not found! (list index out of range)

Steps:

This is an screenshot of UaExpert with correct connection to PLC and the variable list:
image

I'm reading the variables GVL.iTime, and GVL.strStartTime, without problems. By creating Data mapping on thingsboard:
image

Screenshot showing attributes mapping, note that I've tested Identifier and Path types, both working good and also Numeric and String Identifier. The screenshot is showing string identifier.
image

Now I want to write to PLC variables, so create a mapping for Attribute Updates. Here I'm trying with both Path and Identifier types.
Created shared attribute with xControlRemoto and strEndTime and at the time of writing the attribute on platform, all of them throwing opcua_connector on_attributes_update - 784 - Node not found! (list index out of range)

Tought was because the variables have a dot inside, but also I've tested with numeric identifier showing this problem too.
image

Connector name (If bug in the some connector):
OPC-UA Connector

Error traceback (If available):
There's no traceback, but I enabled TRACE log and this is from docker logs:

2024-10-10 10:18:17 - |INFO| - [opcua_connector.py] - opcua_connector - __init__ - 133 - OPC-UA Connector has been initialized
2024-10-10 10:18:18 - |INFO| - [opcua_connector.py] - opcua_connector - open - 138 - Starting OPC-UA Connector (Async IO)
2024-10-10 10:18:18 - |INFO| - [opcua_connector.py] - opcua_connector - start_client - 256 - Connected to OPC-UA Server: opc.tcp://192.168.1.51:4840
2024-10-10 10:18:19 - |ERROR| - [base_events.py] - base_events - default_exception_handler - 1785 - Task was destroyed but it is pending!
task: <Task pending name='Task-7714' coro=<OpcUaConnector.__cancel_all_tasks() running at /thingsboard_gateway/connectors/opcua/opcua_connector.py:163> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[_chain_future.<locals>._call_set_state() at /usr/local/lib/python3.11/asyncio/futures.py:394]>
2024-10-10 10:18:19 - |DEBUG| - [opcua_connector.py] - opcua_connector - _create_new_devices - 540 - Found devices: [['0:Objects', '2:M241-M251 data']]
2024-10-10 10:18:19 - |DEBUG| - [opcua_connector.py] - opcua_connector - __load_converter - 402 - Converter OpcUaUplinkConverter for device M241 - found!
2024-10-10 10:18:19 - |INFO| - [opcua_connector.py] - opcua_connector - _create_new_devices - 561 - Added device node: M241V
2024-10-10 10:18:19 - |DEBUG| - [opcua_connector.py] - opcua_connector - _create_new_devices - 567 - Device nodes: [<Device> Path: ['0:Objects', '2:M241-M251 data'], Name: M241V, Configured values: 2]
2024-10-10 10:18:19 - |INFO| - [opcua_connector.py] - opcua_connector - _subscribe_for_node_updates_in_batches - 679 - Subscribing to batch 1 with 2 nodes.
2024-10-10 10:18:19 - |INFO| - [opcua_connector.py] - opcua_connector - _subscribe_for_node_updates_in_batches - 681 - Subscribed to batch 1 with 2 nodes.
2024-10-10 10:18:19 - |INFO| - [opcua_connector.py] - opcua_connector - _subscribe_for_node_updates_in_batches - 687 - Subscribed to 2 nodes.
2024-10-10 10:18:20 - |INFO| - [opcua_connector.py] - opcua_connector - __convert_sub_data - 526 - Converted data from 2 nodes for device M241V
2024-10-10 10:18:34 - |INFO| - [statistics_service.py] - statistics_service - __send_statistics - 187 - REGULAR STATS: {'machineStats': {'totalCpuUsage': 29.9, 'freeMemory': 69.2, 'freeDisk': '9.8G', 'gwProcessCpuUsage': 10.0, 'gwMemory': 7.5, 'msgsSentToPlatform': 20275, 'msgsReceivedFromPlatform': 143}, 'serviceStats': {'storageMsgPulled': 83, 'storageMsgCount': 0, 'platformMsgPushed': 83, 'platformAttrProduced': 83, 'platformTsProduced': 0}, 'connectorsStats': {'M241': {'convertersMsgProcessed': 85, 'convertersAttrProduced': 85, 'convertersTsProduced': 0, 'storageMsgPushed': 83}}}
2024-10-10 10:18:41 - |DEBUG| - [opcua_connector.py] - opcua_connector - on_attributes_update - 768 - {'device': 'M241V', 'data': {'xControlRemoto': True}}
2024-10-10 10:18:41 - |ERROR| - [opcua_connector.py] - opcua_connector - on_attributes_update - 784 - Node not found! (list index out of range)

Versions (please complete the following information):

  • OS: Raspbian
  • Thingsboard IoT Gateway version 3.5.3 Docker
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