phase 2 serial

This commit is contained in:
flower_linux
2026-06-12 18:34:49 +08:00
parent 0cf0713dc5
commit 628ccf1409
78 changed files with 2571 additions and 345 deletions

View File

@@ -0,0 +1,20 @@
{
"bindings": [
{
"bindingId": "bind_temp_01",
"edgeId": "edge01",
"physicalPointId": "edge01/phy_modbus_s1_r40001",
"logicalPointId": "EdgeDevice_01/MotorTemperature",
"scale": 0.1,
"enabled": false
},
{
"bindingId": "bind_valve_01",
"edgeId": "edge01",
"physicalPointId": "edge01/phy_modbus_s1_r40002",
"logicalPointId": "EdgeDevice_01/ValveOpening",
"scale": 1.0,
"enabled": true
}
]
}

View File

@@ -0,0 +1,37 @@
{
"site": "DemoSite",
"system": "DemoSystem",
"asset": "DemoAsset",
"devices": [
{
"logicalDeviceId": "EdgeDevice_01",
"displayName": "边缘设备01",
"points": [
{
"logicalPointId": "MotorTemperature",
"displayName": "电机温度",
"signalType": "AI",
"unit": "℃",
"range": [0, 200],
"access": "read",
"writable": false,
"opcuaNodeId": "ns=1;s=DemoSite/DemoSystem/DemoAsset/EdgeDevice_01/MotorTemperature",
"dataTopic": "data/EdgeDevice_01/MotorTemperature"
},
{
"logicalPointId": "ValveOpening",
"displayName": "阀门开度",
"signalType": "AO",
"unit": "%",
"range": [0, 100],
"access": "read_write",
"writable": true,
"opcuaNodeId": "ns=1;s=DemoSite/DemoSystem/DemoAsset/EdgeDevice_01/ValveOpening",
"cmdTopic": "control/cmd/EdgeDevice_01/ValveOpening/set",
"ackTopic": "control/ack/EdgeDevice_01/ValveOpening",
"dataTopic": "data/EdgeDevice_01/ValveOpening"
}
]
}
]
}

View File

@@ -1,9 +0,0 @@
{
"edge": {
"deviceId": "EdgeDevice_01",
"daemonHost": "127.0.0.1",
"daemonPort": 9000,
"heartbeatPeriodMs": 1000,
"pointTable": "config/point_table.json"
}
}

View File

@@ -0,0 +1,17 @@
{
"edgeId": "edge01",
"bindings": [
{
"bindingId": "bind_temp_01",
"physicalPointId": "edge01/phy_modbus_s1_r40001",
"logicalPointId": "EdgeDevice_01/MotorTemperature",
"enabled": false
},
{
"bindingId": "bind_valve_01",
"physicalPointId": "edge01/phy_modbus_s1_r40002",
"logicalPointId": "EdgeDevice_01/ValveOpening",
"enabled": true
}
]
}

13
config/edge/edge.json Normal file
View File

@@ -0,0 +1,13 @@
{
"edge": {
"edgeId": "edge01",
"deviceId": "EdgeDevice_01",
"daemonHost": "127.0.0.1",
"daemonPort": 9000,
"heartbeatPeriodMs": 1000,
"uplinkReconnectPeriodMs": 5000,
"physicalChannels": "physical_channels.json",
"physicalDevices": "physical_devices.json",
"bindingsLocal": "bindings_local.json"
}
}

View File

@@ -0,0 +1,15 @@
{
"channels": [
{
"channelId": "serial_0",
"protocol": "modbus",
"transport": "rtu",
"port": "/dev/ttyS3",
"baudRate": 9600,
"parity": "N",
"dataBits": 8,
"stopBits": 1,
"pollIntervalMs": 500
}
]
}

View File

@@ -0,0 +1,29 @@
{
"devices": [
{
"physicalDeviceId": "phy_modbus_slave_1",
"channelId": "serial_0",
"protocol": "modbus",
"slaveId": 1,
"points": [
{
"physicalPointId": "phy_modbus_s1_r40001",
"register": 40001,
"function": 3,
"scale": 0.1,
"signalType": "AI",
"writable": false
},
{
"physicalPointId": "phy_modbus_s1_r40002",
"register": 40002,
"function": 3,
"writeFunction": 6,
"scale": 1.0,
"signalType": "AO",
"writable": true
}
]
}
]
}