DAM0404D控制
控制单路继电器
操作DO 打开第1个继电器
发送:02 05 00 00 FF 00 8C 09
接收:02 05 00 00 FF 00 8C 09
操作DO 关闭第1个继电器
发送:02 05 00 00 00 00 CD F9
接收:02 05 00 00 00 00 CD F9
操作DO 打开第2个继电器
发送:02 05 00 01 FF 00 DD C9
接收:02 05 00 01 FF 00 DD C9
操作DO 关闭第2个继电器
发送:02 05 00 01 00 00 9C 39
接收:02 05 00 01 00 00 9C 39
获取数据
{
"tag": "fan",
"type": "bits",
"address": 0,
"objectsCount": 4,
"functionCode": 1,
"bit": 3,
"bitTargetType": "bool"
},
{
"tag": "4联",
"type": "bits",
"address": 0,
"objectsCount": 4,
"functionCode": 1,
"bitTargetType": "int"
}
网关配置文件
{
"name": "network_serial_1",
"id": "e0415af8-ec00-4641-89ce-18b7fe9626c3",
"master": {
"slaves": [
{
"host": "172.31.146.21",
"port": 26,
"method": "rtu",
"unitId": 5,
"deviceName": "temp_hum",
"deviceType": "default",
"timeout": 35,
"byteOrder": "BIG",
"wordOrder": "BIG",
"retries": true,
"retryOnEmpty": true,
"retryOnInvalid": true,
"pollPeriod": 5000,
"connectAttemptTimeMs": 500,
"connectAttemptCount": 5,
"waitAfterFailedAttemptsMs": 30000,
"type": "tcp",
"attributes": [],
"timeseries": [
{
"tag": "temp",
"type": "16int",
"address": 1,
"objectsCount": 1,
"functionCode": 3,
"divider": 10
},
{
"tag": "hum",
"type": "16int",
"address": 0,
"objectsCount": 1,
"functionCode": 3,
"divider": 10
}
],
"attributeUpdates": [],
"rpc": []
},
{
"host": "172.31.146.21",
"port": 26,
"method": "rtu",
"unitId": 2,
"deviceName": "linked_control",
"deviceType": "default",
"timeout": 35,
"byteOrder": "BIG",
"wordOrder": "BIG",
"retries": true,
"retryOnEmpty": true,
"retryOnInvalid": true,
"pollPeriod": 1000,
"connectAttemptTimeMs": 500,
"connectAttemptCount": 5,
"waitAfterFailedAttemptsMs": 30000,
"type": "tcp",
"attributes": [],
"timeseries": [
{
"tag": "fan",
"type": "bits",
"address": 0,
"objectsCount": 4,
"functionCode": 1,
"bit": 3,
"bitTargetType": "bool"
},
{
"tag": "light",
"type": "bits",
"address": 0,
"objectsCount": 4,
"functionCode": 1,
"bit": 2,
"bitTargetType": "bool"
},
{
"tag": "4_link",
"type": "bits",
"address": 0,
"objectsCount": 4,
"functionCode": 1,
"bitTargetType": "int"
}
],
"attributeUpdates": [],
"rpc": [
{
"tag": "setValue",
"type": "bits",
"address": 0,
"objectsCount": 1,
"functionCode": 5,
"bitTargetType": "bool"
},
{
"tag": "getValue",
"type": "bits",
"address": 0,
"objectsCount": 4,
"functionCode": 1,
"bit": 3,
"bitTargetType": "bool"
},
{
"tag": "setLight",
"type": "bits",
"address": 1,
"objectsCount": 1,
"functionCode": 5,
"bitTargetType": "bool"
},
{
"tag": "getLight",
"type": "bits",
"address": 0,
"objectsCount": 4,
"functionCode": 1,
"bit": 2,
"bitTargetType": "bool"
}
]
},
{
"host": "172.31.146.21",
"port": 26,
"method": "socket",
"unitId": 2,
"deviceName": "linked_control_2",
"deviceType": "default",
"timeout": 35,
"byteOrder": "BIG",
"wordOrder": "BIG",
"retries": true,
"retryOnEmpty": true,
"retryOnInvalid": true,
"pollPeriod": 1000,
"connectAttemptTimeMs": 500,
"connectAttemptCount": 5,
"waitAfterFailedAttemptsMs": 30000,
"type": "tcp",
"attributes": [],
"timeseries": [
{
"tag": "light",
"type": "bits",
"address": 0,
"objectsCount": 4,
"functionCode": 1,
"bit": 2,
"bitTargetType": "bool"
}
],
"attributeUpdates": [],
"rpc": [
{
"tag": "setValue",
"type": "bits",
"address": 1,
"objectsCount": 1,
"functionCode": 5,
"bitTargetType": "bool"
},
{
"tag": "getValue",
"type": "bits",
"address": 0,
"objectsCount": 4,
"functionCode": 1,
"bit": 2,
"bitTargetType": "bool"
}
]
}
]
},
"logLevel": "DEBUG",
"enableRemoteLogging": false,
"configVersion": "3.7.8"
}
网关文件
{
"thingsboard": {
"host": "172.31.146.30",
"port": 11883,
"remoteShell": false,
"remoteConfiguration": true,
"latencyDebugMode": false,
"statistics": {
"enable": true,
"enableCustom": false,
"statsSendPeriodInSeconds": 3600,
"customStatsSendPeriodInSeconds": 3600
},
"deviceFiltering": {
"enable": false,
"filterFile": "list.json"
},
"maxPayloadSizeBytes": 8196,
"minPackSendDelayMS": 50,
"minPackSizeToSend": 500,
"checkConnectorsConfigurationInSeconds": 60,
"handleDeviceRenaming": true,
"security": {
"type": "accessToken",
"accessToken": "N8k90gGfCNYza8aABfW1"
},
"qos": 1,
"reportStrategy": {
"type": "ON_RECEIVED",
"reportPeriod": 10000,
"ttl": 86400
},
"checkingDeviceActivity": {
"checkDeviceInactivity": false,
"inactivityTimeoutSeconds": 300,
"inactivityCheckPeriodSeconds": 10
},
"rateLimits": "DEFAULT_TELEMETRY_RATE_LIMIT",
"dpRateLimits": "DEFAULT_TELEMETRY_DP_RATE_LIMIT",
"messagesRateLimits": "DEFAULT_MESSAGES_RATE_LIMIT",
"deviceMessagesRateLimits": "DEFAULT_MESSAGES_RATE_LIMIT",
"deviceRateLimits": "DEFAULT_TELEMETRY_RATE_LIMIT",
"deviceDpRateLimits": "DEFAULT_TELEMETRY_DP_RATE_LIMIT",
"ts": 1766557695202
},
"storage": {
"type": "memory",
"read_records_count": 100,
"max_records_count": 100000,
"data_folder_path": "./data/",
"max_file_count": 10,
"max_read_records_count": 10,
"max_records_per_file": 10000,
"data_file_path": "./data/data.db",
"messages_ttl_check_in_hours": 1,
"messages_ttl_in_days": 7,
"ts": 1766557695202
},
"grpc": {
"enabled": false,
"serverPort": 9595,
"keepAliveTimeMs": 10001,
"keepAliveTimeoutMs": 5000,
"keepAlivePermitWithoutCalls": true,
"maxPingsWithoutData": 0,
"minTimeBetweenPingsMs": 10000,
"minPingIntervalWithoutDataMs": 5000
},
"connectors": [
{
"type": "modbus",
"name": "master_moubus",
"configuration": "masterMoubus.json"
}
]
}