thingsboard / thingsboard-gateway

Open-source IoT Gateway - integrates devices connected to legacy and third-party systems with ThingsBoard IoT Platform using Modbus, CAN bus, BACnet, BLE, OPC-UA, MQTT, ODBC and REST protocols
https://thingsboard.io/docs/iot-gateway/what-is-iot-gateway/
Apache License 2.0
1.72k stars 829 forks source link

[HELP] OPCua-Connector - Combining data from all the OPC nodes into a single message per cycle #557

Closed DejonckheereWard closed 2 years ago

DejonckheereWard commented 3 years ago

Describe the issue I'm looking to figure out how we can package all the data collected for every read (15 seconds) into a single message being pushed to thingsboard instead of every OPC value being sent seperately after being read. This is causing a large amount of API calls / requests every 15 seconds, instead of just a single message with all the data read this pass. It would also be nice to find a way to automatically read all the nodes in the OPC server (based on a parent node), but that's besides the issue I'm having here

Configuration I deleted a lot of the timeseries entries in this config because of necessity (about 150 nodes in there)

{
    "server": {
        "disableSubscriptions": true,
        "identity": {
            "type": "anonymous"
        },
        "mapping": [
            {
                "attributes": [],
                "deviceNamePattern": "Device1",
                "deviceNodePattern": "Root\\.Objects\\.M241-M251 data",
                "deviceTypePattern": "rolbrug",
                "timeseries": [
                    {
                        "key": "Bed_Claxon",
                        "path": "ns=2;s=GVL.Bed_Claxon"
                    },
                    {
                        "key": "Bed_Gr_Sn_B",
                        "path": "ns=2;s=GVL.Bed_Gr_Sn_B"
                    }
                ]
            }
        ],
        "name": "OPC-UA Default Server",
        "scanPeriodInMillis": 5000,
        "security": "Basic128Rsa15",
        "showMap": true,
        "subCheckPeriodInMillis": 500,
        "timeoutInMillis": 10000,
        "url": "10.10.0.100:4840"
    }
}

Connector name: OPC-UA Connector

Versions:

samson0v commented 2 years ago

Hi @DejonckheereWard, your issue was fixed. If you want to combine data from all the OPC nodes into a single message per cycle, you have to update your Gateway via the master branch and use minPackSendDelayMS in tb_gateway.yaml. Example:

зображення

Thanks for your interest in ThingsBoard IoT Gateway.