You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my setup, I have the thingsboard gateway connecting to 12 separate OPC-UA servers, monitoring around 150 tags each.
Each OPC-UA server has the same variable names but they will be sent to different thingsboard devices (e.g. OPC-UA server 1 has a temperature tag that will go to thingsboard device temperature01 and OPC-UA server 2 has a temperature tag that will go to thingsboard device temperature02).
I'm using the OPC-UA assyncio connector, and in my tb_gateway.yaml file I had something like this:
With this setup, the different connectors were sending data to the wrong devices.
I arrived to the conclusion that it was because of the following connector class variables:
Since DATA_TO_SEND and SUB_DATA_TO_CONVERT are defined outside the methods, they are accessible by all instances of class OpcUaConnectorAsyncIO
Instead of each connector having their own queue, they are accessing the same queues, and a given connector is not checking if the element of the queue they are processing is supposed to be processed by them.
The solution I found was to create a different custom opcua connector for each connection (e.g. CustomOpcUaConnector01, CustomOpcUaConnector02 ... CustomOpcUaConnector12) so that each connector would have its own DATA_TO_SEND and SUB_DATA_TO_CONVERT queues.
Is this something that can be fixed in a new release in order to avoid needing to use a custom connector for each opcua server?
Is there a better way to work around this?
Connector name:
OPC-UA Connector assyncio
Versions:
OS: Debian GNU/Linux 11 (bullseye)
Thingsboard IoT Gateway version: 3.1
Python version: 3.9.2
The text was updated successfully, but these errors were encountered:
In my setup, I have the thingsboard gateway connecting to 12 separate OPC-UA servers, monitoring around 150 tags each.
Each OPC-UA server has the same variable names but they will be sent to different thingsboard devices (e.g. OPC-UA server 1 has a temperature tag that will go to thingsboard device temperature01 and OPC-UA server 2 has a temperature tag that will go to thingsboard device temperature02).
I'm using the OPC-UA assyncio connector, and in my tb_gateway.yaml file I had something like this:
With this setup, the different connectors were sending data to the wrong devices.
I arrived to the conclusion that it was because of the following connector class variables:
thingsboard-gateway/thingsboard_gateway/connectors/opcua_asyncio/opcua_connector.py
Lines 49 to 51 in 114a33d
Since DATA_TO_SEND and SUB_DATA_TO_CONVERT are defined outside the methods, they are accessible by all instances of class OpcUaConnectorAsyncIO
Instead of each connector having their own queue, they are accessing the same queues, and a given connector is not checking if the element of the queue they are processing is supposed to be processed by them.
The solution I found was to create a different custom opcua connector for each connection (e.g. CustomOpcUaConnector01, CustomOpcUaConnector02 ... CustomOpcUaConnector12) so that each connector would have its own DATA_TO_SEND and SUB_DATA_TO_CONVERT queues.
Is this something that can be fixed in a new release in order to avoid needing to use a custom connector for each opcua server?
Is there a better way to work around this?
Connector name:
Versions:
The text was updated successfully, but these errors were encountered: