EF5600-DN1 LoRaWAN 电气火灾监控器用户手册
设备信息:型号 EF5600-DN1,devEui ffffff100004e99f,网关 IP 192.168.31.205,Modbus Slave ID 7,BACnet Device ID 106
1 协议概览
EF5600-DN1 在 Fport 210 上报三相电压、电流、功率、功率因数、能量、漏电流、温度传感器、环境数据及报警状态。
1.1 上行数据协议(Fport 210)
载荷格式(Fport 210):
| 字节位置 | 字段 | 说明 |
|---|---|---|
| 0 | 保留 | 固定 0x00(协议版本) |
| 1 … N | TLV 对 | [Type(1 B)][Value(N B)] … 循环至结束 |
每个 Type 字节决定字段名称和后续 value 字节数:
| Type | Value字节数 | 字段名称 | 编码方式 | 换算 | 单位 | 说明 |
|---|---|---|---|---|---|---|
0x01 |
1 | model |
uint8 | — | — | 型号码 = 0x5B |
0x6D |
1 | packetType |
uint8 | — | — | 0x00=心跳 0x01=数据上报 |
0x22 |
1 | switch |
uint8 | — | — | 0=断路 1=合闸 |
0xC6 |
1+N | elecData |
block | — | — | 长度字节 (0x66=102) + 102字节电气数据块;详见下方子表 |
0xC7 |
2 | alarmAttribute |
bitfield16 BE | — | — | 报警属性位域;详见下方报警位定义 |
0xC8 |
2 | alarmEvent |
bitfield16 BE | — | — | 报警事件位域(与 0xC7 位布局相同) |
EF5600-DN1 0xC6 电气数据块(长度字节后 102 字节)
| 偏移 | 字节数 | 字段 | 编码 | 换算 | 单位 |
|---|---|---|---|---|---|
| 0 | 2 | voltageA | uint16 BE | ÷10 | V |
| 2 | 2 | voltageB | uint16 BE | ÷10 | V |
| 4 | 2 | voltageC | uint16 BE | ÷10 | V |
| 6 | 2 | currentA | uint16 BE | ÷10 | A |
| 8 | 2 | currentB | uint16 BE | ÷10 | A |
| 10 | 2 | currentC | uint16 BE | ÷10 | A |
| 12 | 2 | leakageCurrent | uint16 BE | ÷10 | mA |
| 14 | 2 | tempSensor1 | int16 BE | ÷10 | °C |
| 16 | 2 | tempSensor2 | int16 BE | ÷10 | °C |
| 18 | 2 | tempSensor3 | int16 BE | ÷10 | °C |
| 20 | 2 | tempSensor4 | int16 BE | ÷10 | °C |
| 22 | 2 | envTemperature | int16 BE | ÷10 | °C |
| 24 | 2 | envHumidity | uint16 BE | ÷10 | % |
| 26 | 4 | activePowerA | float32 BE | — | W |
| 30 | 4 | activePowerB | float32 BE | — | W |
| 34 | 4 | activePowerC | float32 BE | — | W |
| 38 | 4 | activePowerTotal | float32 BE | — | W |
| 42 | 4 | reactivePowerA | float32 BE | — | var |
| 46 | 4 | reactivePowerB | float32 BE | — | var |
| 50 | 4 | reactivePowerC | float32 BE | — | var |
| 54 | 4 | reactivePowerTotal | float32 BE | — | var |
| 58 | 4 | apparentPowerA | float32 BE | — | VA |
| 62 | 4 | apparentPowerB | float32 BE | — | VA |
| 66 | 4 | apparentPowerC | float32 BE | — | VA |
| 70 | 4 | apparentPowerTotal | float32 BE | — | VA |
| 74 | 4 | powerFactorA | float32 BE | — | — |
| 78 | 4 | powerFactorB | float32 BE | — | — |
| 82 | 4 | powerFactorC | float32 BE | — | — |
| 86 | 4 | powerFactorTotal | float32 BE | — | — |
| 90 | 4 | activeEnergy | float32 BE | — | kWh |
| 94 | 4 | reactiveEnergy | float32 BE | — | kvarh |
| 98 | 4 | apparentEnergy | float32 BE | — | kVAh |
0xC7 / 0xC8 报警位域(16 位,大端):
| 位 | 字段 |
|---|---|
| 0 | A 相过流 |
| 1 | B 相过流 |
| 2 | C 相过流 |
| 3 | A 相过压 |
| 4 | B 相过压 |
| 5 | C 相过压 |
| 6 | A 相欠压 |
| 7 | B 相欠压 |
| 8 | C 相欠压 |
| 9 | 短路 |
| 10 | 温度传感器1报警 |
| 11 | 温度传感器2报警 |
| 12 | 温度传感器3报警 |
| 13 | 温度传感器4报警 |
| 14 | 漏电流报警 |
JavaScript 解码示例:
// EF5600-DN1 Electrical Fire Monitor — Fport 210 uplink decoder
function decodeUplink(bytes) {
var i = 1, r = {};
function u16(b,o){ return (b[o]<<8)|b[o+1]; }
function i16(b,o){ var v=u16(b,o); return v>32767?v-65536:v; }
function flt(b,o){ // IEEE 754 float32 big-endian
var bits=((b[o]<<24)|(b[o+1]<<16)|(b[o+2]<<8)|b[o+3])>>>0;
var s=(bits>>>31)?-1:1, e=(bits>>>23)&0xFF, m=bits&0x7FFFFF;
if(e===255) return m?NaN:s*Infinity;
return s*(e?1+m/8388608:m/8388608)*Math.pow(2,e?e-127:-126);
}
function alarmBits(bits){
return {
alarmOvercurrentA:(bits&0x0001)!==0, alarmOvercurrentB:(bits&0x0002)!==0,
alarmOvercurrentC:(bits&0x0004)!==0, alarmOvervoltageA:(bits&0x0008)!==0,
alarmOvervoltageB:(bits&0x0010)!==0, alarmOvervoltageC:(bits&0x0020)!==0,
alarmUndervoltageA:(bits&0x0040)!==0, alarmLeakage:(bits&0x4000)!==0
};
}
while (i < bytes.length) {
var t = bytes[i++];
switch (t) {
case 0x01: r.model = bytes[i++]; break;
case 0x22: r.switch = bytes[i++]; break; // 0=open 1=closed
case 0x6D: r.packetType= bytes[i++]; break;
case 0xC6: {
var len = bytes[i++], o = i;
r.voltageA = u16(bytes,o)/10; r.voltageB=u16(bytes,o+2)/10; r.voltageC=u16(bytes,o+4)/10;
r.currentA = u16(bytes,o+6)/10; r.currentB=u16(bytes,o+8)/10; r.currentC=u16(bytes,o+10)/10;
r.leakageCurrent = u16(bytes,o+12)/10;
r.tempSensor1= i16(bytes,o+14)/10; r.tempSensor2=i16(bytes,o+16)/10;
r.tempSensor3= i16(bytes,o+18)/10; r.tempSensor4=i16(bytes,o+20)/10;
r.envTemperature=i16(bytes,o+22)/10; r.envHumidity=u16(bytes,o+24)/10;
r.activePowerA=flt(bytes,o+26); r.activePowerB=flt(bytes,o+30);
r.activePowerC=flt(bytes,o+34); r.activePowerTotal=flt(bytes,o+38);
r.activeEnergy=flt(bytes,o+90);
i += len; break;
}
case 0xC7: { r.alarmAttribute = Object.assign(alarmBits(u16(bytes,i)),{raw:u16(bytes,i)}); i+=2; break; }
case 0xC8: { r.alarmEvent = Object.assign(alarmBits(u16(bytes,i)),{raw:u16(bytes,i)}); i+=2; break; }
default: i++; break;
}
}
return r;
}
脚本下载:LPP.zip
版本说明: LPP.js 基于 ChirpStack v4.17.0 开发和测试。不同版本的 ChirpStack JavaScript 编解码器 API 可能存在差异——如果您使用的是其他版本,请在部署前检查并根据需要调整脚本。
1.2 下行控制协议
EF5600-DN1 支持继电器断开(断路)和闭合(通路)指令,下行使用 Fport 2。
Fport:2 — 0x09 0x5B(设备型号标识头)
载荷格式:09 5B [ActionCode] [Params...] 设置地址 A 和写入值 V 均为 uint16 BE。 地址 0x1001–0x1007 分别对应各阈值设置(过流 %、过压 %、欠压 %、过温、温湿度、漏电流)。
| 命令码 | 载荷字节 | 说明 |
|---|---|---|
0x01 |
09 5B 01 |
复位设备 |
0x02 |
09 5B 02 |
自检 |
0x03 |
09 5B 03 |
消音 |
0x04 |
09 5B 04 |
断路器断开(断电) |
0x05 |
09 5B 05 |
断路器闭合(通电) |
0x06 |
09 5B 06 A1 A0 |
查询地址 A 处的设置值(uint16 BE) |
0x07 |
09 5B 07 A1 A0 V1 V0 |
写入设置:地址 A 写入值 V(均为 uint16 BE) |
JavaScript 编码器示例:
// EF5600-DN1 Electrical Fire Monitor — Fport 2 downlink encoder
function encodeDownlink(data) {
// data.command : 'reset'|'selfTest'|'silence'|'breakerOpen'|'breakerClose'
// data.queryAddress (optional uint16) : address to query
// data.setAddress (optional uint16) : address to write
// data.setValue (optional uint16) : value to write
var H = [0x09, 0x5B];
var u16 = function(n){ return [(n>>8)&0xFF, n&0xFF]; };
var cmd = String(data.command||'').trim().toLowerCase();
switch(cmd) {
case 'reset': return H.concat([0x01]);
case 'selftest': case 'self_test': return H.concat([0x02]);
case 'silence': return H.concat([0x03]);
case 'breakeropen': case 'open': return H.concat([0x04]);
case 'breakerclose': case 'close': return H.concat([0x05]);
case 'query':
if (data.queryAddress === undefined) return [];
return H.concat([0x06]).concat(u16(Number(data.queryAddress)));
case 'set': case 'write':
if (data.setAddress === undefined || data.setValue === undefined) return [];
return H.concat([0x07]).concat(u16(Number(data.setAddress))).concat(u16(Number(data.setValue)));
default: return [];
}
}
// Examples:
// encodeDownlink({command:'breakerClose'}) → [0x09,0x5B,0x05]
// encodeDownlink({command:'query', queryAddress:0x1002}) → [0x09,0x5B,0x06,0x10,0x02]
// encodeDownlink({command:'set', setAddress:0x1002, setValue:120}) → [0x09,0x5B,0x07,0x10,0x02,0x00,0x78]
2 获取上行数据
⚠️ 以下示例中的 IP 地址(192.168.31.205/192.168.31.193)、ChirpStack API token、Slave ID、BACnet Device ID 及 devEui 均为演示示例,请替换为实际网关 IP、ChirpStack API token 及设备参数。
2.1 ChirpStack MQTT 订阅
订阅 MQTT topic 以接收实时上行数据:
应用 ID —3ef9e6b9-ec54-4eda-86b8-a5fb46899f39是网关内置的出厂默认 ChirpStack 应用。
如果您创建了其他应用,请替换为实际的应用 ID。
网关 IP —192.168.31.205为示例网关 WAN 口 IP,
请替换为您实际的网关 IP 地址。
设备 EUI —ffffff100004e99f为示例设备 EUI,
请替换为网关设备列表中显示的实际 EUI;
也可用+通配符一次订阅所有设备的数据。
# 订阅指定设备
mosquitto_sub -h 192.168.31.205 -p 1883 \
-u gateway -P mqtt88888888 \
-t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff100004e99f/event/up"
# 订阅所有应用下所有设备(通配符)
mosquitto_sub -h 192.168.31.205 -p 1883 \
-u gateway -P mqtt88888888 \
-t "application/+/device/+/event/up"
上行数据载荷示例(JSON):
{
"devEui": "ffffff100004e99f",
"fPort": 210,
"object": {
... (已解码的 LPP 字段)
}
}
2.2 IoT Hub HTTP API
发送 GET 请求获取设备最新状态:
curl -s "http://192.168.31.205:8070/api/getStatus?devEui=ffffff100004e99f"
{
"success": true,
"result": {
"switch": true,
"voltageA": 236.7,
"voltageB": 235.8,
"voltageC": 237,
"voltageAvg": 236.5,
"currentA": 0,
"currentB": 0,
"currentC": 0,
"currentAvg": 0,
"activePowerA": 0,
"activePowerB": 0,
"activePowerC": 0,
"activePowerTotal": 0,
"reactivePowerA": 0,
"reactivePowerB": 0,
"reactivePowerC": 0,
"reactivePowerTotal": 0,
"apparentPowerA": 0,
"apparentPowerB": 0,
"apparentPowerC": 0,
"apparentPowerTotal": 0.08,
"powerFactorA": 1,
"powerFactorB": 1,
"powerFactorC": 1,
"powerFactorTotal": -1,
"activeEnergy": 10.4,
"reactiveEnergy": 0.8,
"apparentEnergy": 31.2,
"leakageCurrent": 0,
"tempSensor1": 31.3,
"tempSensor2": 32,
"tempSensor3": 0,
"tempSensor4": 0,
"tempAvg": 15.8,
"envTemperature": 33,
"envHumidity": 41.9,
"electricalAlarm": false,
"alarmOvercurrentA": false,
"alarmOvercurrentB": false,
"alarmOvercurrentC": false,
"alarmOvercurrentAEvent": false,
"alarmOvercurrentBEvent": false,
"alarmOvercurrentCEvent": false,
"alarmOvervoltageA": false,
"alarmOvervoltageB": false,
"alarmOvervoltageC": false,
"alarmOvervoltageAEvent": false,
"alarmOvervoltageBEvent": false,
"alarmOvervoltageCEvent": false,
"alarmUndervoltageA": false,
"alarmUndervoltageB": false,
"alarmUndervoltageC": false,
"alarmUndervoltageAEvent": false,
"alarmUndervoltageBEvent": false,
"alarmUndervoltageCEvent": false,
"alarmShortCircuit": false,
"alarmShortCircuitEvent": false,
"alarmTempSensor1": false,
"alarmTempSensor2": false,
"alarmTempSensor3": false,
"alarmTempSensor4": false,
"alarmTempSensor1Event": false,
"alarmTempSensor2Event": false,
"alarmTempSensor3Event": false,
"alarmTempSensor4Event": false,
"alarmLeakage": false,
"alarmLeakageEvent": false,
"model": "EF5600-DN1"
}
}
2.3 IoT Hub Modbus TCP — Python 脚本
脚本下载:modbus_tcp_read.py
使用 modbus_tcp_read.py 一次性读取所有寄存器:
python3 modbus_tcp_read.py --ip 192.168.31.205 --port 502 \
--slaveId 7 --sensorType EF5600-DN1
Target: 192.168.31.205:502 | Slave ID: 7 | Sensor: EF5600-DN1
================================================================================================================================================================
Attribute | Addr | FC | Format | Order | Cnt | Scale | Raw(Hex) | Value | Unit
----------------------------------------------------------------------------------------------------------------------------------------------------------------
online | 6 | 03 | Bit/Bool | Big(ABCD) | 1 | x1 | 0001 | true | none
lastOnlineTime | 7 | 03 | UnixTime | Big(ABCD) | 2 | x1 | 69CC CD76 | 1775029622 | second
ef5600CommandCode | 9 | 03 | Int16 | Big(ABCD) | 1 | x1 | 0000 | 0.0 | none
ef5600SettingAddress | 10 | 03 | Int16 | Big(ABCD) | 1 | x1 | 0000 | 0.0 | none
ef5600SettingValueHigh | 11 | 03 | Int16 | Big(ABCD) | 1 | x1 | 0000 | 0.0 | none
ef5600SettingValueLow | 12 | 03 | Int16 | Big(ABCD) | 1 | x1 | 0000 | 0.0 | none
switch | 13 | 03 | Bit/Bool | Big(ABCD) | 1 | x1 | 0001 | true | none
voltageA | 14 | 03 | Int16(S) | Big(ABCD) | 1 | /10 | 093F | 236.7 | volt
voltageB | 15 | 03 | Int16(S) | Big(ABCD) | 1 | /10 | 0936 | 235.8 | volt
voltageC | 16 | 03 | Int16(S) | Big(ABCD) | 1 | /10 | 0942 | 237.0 | volt
voltageAvg | 17 | 03 | Int16(S) | Big(ABCD) | 1 | /10 | 093D | 236.5 | volt
currentA | 18 | 03 | Int16(S) | Big(ABCD) | 1 | /10 | 0000 | 0.0 | ampere
... (77 fields total)
2.4 IoT Hub Modbus TCP — Modbus Poll
工具下载:Modbus Poll 9.5.0.1507.zip
- 打开 Modbus Poll,连接
192.168.31.205:502,Slave ID7 - 菜单 Setup → Read/Write Definition,功能码选 FC03,起始地址
6,长度132 - 点击 OK — 数值实时刷新
2.5 IoT Hub BACnet BIP — Python 脚本
脚本下载:bacnet_read.py
使用 bacnet_read.py 读取所有 BACnet 对象:
python3 bacnet_read.py --ip 192.168.31.205 --port 47808 --id 106
Target: 192.168.31.205:47808 | BACnet ID: 106 | Scan: 10600-10699
------------------------------------------------------------
Type | Instance | Offset | Value | Object Name
------------------------------------------------------------
BI | 10602 | 2 | active | ffffff100004e99f.online
AI | 10603 | 3 | 1775029888.00 | ffffff100004e99f.lastOnlineTime
AV | 10604 | 4 | 0.00 | ffffff100004e99f.ef5600CommandCode
AV | 10605 | 5 | 0.00 | ffffff100004e99f.ef5600SettingAddress
AV | 10606 | 6 | 0.00 | ffffff100004e99f.ef5600SettingValueHigh
AV | 10607 | 7 | 0.00 | ffffff100004e99f.ef5600SettingValueLow
BV | 10608 | 8 | active | ffffff100004e99f.switch
AI | 10609 | 9 | 236.70 | ffffff100004e99f.voltageA
AI | 10610 | 10 | 235.80 | ffffff100004e99f.voltageB
AI | 10611 | 11 | 236.90 | ffffff100004e99f.voltageC
AI | 10612 | 12 | 236.50 | ffffff100004e99f.voltageAvg
AI | 10613 | 13 | 0.00 | ffffff100004e99f.currentA
... (80 objects total)
2.6 IoT Hub BACnet BIP — YABE
工具下载:SetupYabe_v2.1.0.exe
- 打开 YABE,连接
192.168.31.205:47808 - 在设备树中展开设备 106
- 浏览 AI/BI/AV/BV/CV 对象,查看实时数值
3 发送控制指令
EF5600-DN1 支持继电器断开(断路)和闭合(通路)指令,下行使用 Fport 2。
⚠️ 以下示例中的 IP 地址(192.168.31.205/192.168.31.193)、ChirpStack API token、Slave ID、BACnet Device ID 及 devEui 均为演示示例,请替换为实际网关 IP、ChirpStack API token 及设备参数。
脚本下载:modbus_tcp_write.py · bacnet_write.py
示例 1:控制继电器断开(断路)
Modbus TCP:
python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 7 --sensorType EF5600-DN1 breakerOpen
Target: 192.168.31.205:502 | Slave ID: 7 | Sensor: EF5600-DN1
Expected values:
ef5600CommandCode: 4
ef5600SettingAddress: 0
ef5600SettingValueHigh: 0
ef5600SettingValueLow: 0
Expected confirmed state:
switch: 0
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 4
ef5600CommandCode -> register 9 (4x40010) raw=4 signed=4
ef5600SettingAddress -> register 10 (4x40011) raw=0 signed=0
ef5600SettingValueHigh -> register 11 (4x40012) raw=0 signed=0
ef5600SettingValueLow -> register 12 (4x40013) raw=0 signed=0
Observed values:
switch: 0
Link confirmation time: 4.154s
Control completed in: 4.166s
脚本自动写入寄存器并回读验证。输出中的 Modbus Poll write guide 部分可直接用于 Modbus Poll 手动写入的参考。
Modbus Poll:
- 连接网关(IP
192.168.31.205,端口502,Slave ID7) - 菜单 Functions → 16 Write Multiple Registers
- 参照上方脚本输出中的 Modbus Poll write guide,填写寄存器地址和数值
- 点击 Send 发送写入指令
BACnet BIP:
python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 106 --sensorType EF5600-DN1 breakerOpen
Target: 192.168.31.205:47808 | BACnet ID: 106 | Sensor: EF5600-DN1
Expected values:
ef5600CommandCode: 4
ef5600SettingAddress: 0
ef5600SettingValueHigh: 0
ef5600SettingValueLow: 0
Expected confirmed state:
switch: 0
Attempt 1/1: writing control values (default)...
YABE write guide:
ef5600CommandCode -> object analog-value,10604 | property present-value | type=analog-value | write=4
ef5600SettingAddress -> object analog-value,10605 | property present-value | type=analog-value | write=0
ef5600SettingValueHigh -> object analog-value,10606 | property present-value | type=analog-value | write=0
ef5600SettingValueLow -> object analog-value,10607 | property present-value | type=analog-value | write=0
Observed values:
switch: 0
Link confirmation time: 7.754s
Control completed in: 7.809s
脚本自动写入并回读验证。输出中的 YABE write guide 部分可直接用于 YABE 手动写入的参考。
YABE:
- 连接网关(IP
192.168.31.205,端口47808),展开设备 106 - 参照上方脚本输出中的 YABE write guide,找到对应对象
- 右键该对象 → Write Property,属性选
present-value,填入目标值后点击 Write
IoT Hub HTTP:
接口路径:POST http://192.168.31.205:8070/api/sendCommand
curl -s -X POST "http://192.168.31.205:8070/api/sendCommand" \
-H "Content-Type: application/json" \
-d '{"devEui":"ffffff100004e99f","params":{"ef5600CommandCode":4,"ef5600SettingAddress":0,"ef5600SettingValueHigh":0,"ef5600SettingValueLow":0}}'
{
"success": true,
"result": {
"devEui": "ffffff100004e99f",
"status": "buffered"
}
}
ChirpStack REST API:
接口路径:POST http://192.168.31.205:8090/api/devices/ffffff100004e99f/queue
curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff100004e99f/queue' \
-H 'accept: application/json' \
-H 'Grpc-Metadata-Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{"flushQueue":true,"queueItem":{"confirmed":false,"isPending":false,"object":{"model":"EF5600-DN1","command":"breakerOpen"}}}'
{
"id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}
格式化后的 JSON 内容:
{
"flushQueue": true,
"queueItem": {
"confirmed": false,
"isPending": false,
"object": {
"model": "EF5600-DN1",
"command": "breakerOpen"
}
}
}
ChirpStack MQTT:
mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
-t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff100004e99f/command/down" \
-m '{"flushQueue":true,"devEui":"ffffff100004e99f","confirmed":false,"object":{"model":"EF5600-DN1","command":"breakerOpen"}}'
格式化后的 JSON 内容:
{
"flushQueue": true,
"devEui": "ffffff100004e99f",
"confirmed": false,
"object": {
"model": "EF5600-DN1",
"command": "breakerOpen"
}
}
示例 2:控制继电器闭合(通路)
Modbus TCP:
python3 modbus_tcp_write.py --ip 192.168.31.205 --port 502 --slaveId 7 --sensorType EF5600-DN1 breakerClose
Target: 192.168.31.205:502 | Slave ID: 7 | Sensor: EF5600-DN1
Expected values:
ef5600CommandCode: 5
ef5600SettingAddress: 0
ef5600SettingValueHigh: 0
ef5600SettingValueLow: 0
Expected confirmed state:
switch: 1
Attempt 1/1: writing control values (default)...
Modbus Poll write guide:
Batch 1: FC16 Write Multiple Registers | Start register: 9 (4x40010) | Count: 4
ef5600CommandCode -> register 9 (4x40010) raw=5 signed=5
ef5600SettingAddress -> register 10 (4x40011) raw=0 signed=0
ef5600SettingValueHigh -> register 11 (4x40012) raw=0 signed=0
ef5600SettingValueLow -> register 12 (4x40013) raw=0 signed=0
Observed values:
switch: 1
Link confirmation time: 4.154s
Control completed in: 4.166s
脚本自动写入寄存器并回读验证。输出中的 Modbus Poll write guide 部分可直接用于 Modbus Poll 手动写入的参考。
Modbus Poll:
- 连接网关(IP
192.168.31.205,端口502,Slave ID7) - 菜单 Functions → 16 Write Multiple Registers
- 参照上方脚本输出中的 Modbus Poll write guide,填写寄存器地址和数值
- 点击 Send 发送写入指令
BACnet BIP:
python3 bacnet_write.py --ip 192.168.31.205 --port 47808 --id 106 --sensorType EF5600-DN1 breakerClose
Target: 192.168.31.205:47808 | BACnet ID: 106 | Sensor: EF5600-DN1
Expected values:
ef5600CommandCode: 5
ef5600SettingAddress: 0
ef5600SettingValueHigh: 0
ef5600SettingValueLow: 0
Expected confirmed state:
switch: 1
Attempt 1/1: writing control values (default)...
YABE write guide:
ef5600CommandCode -> object analog-value,10604 | property present-value | type=analog-value | write=5
ef5600SettingAddress -> object analog-value,10605 | property present-value | type=analog-value | write=0
ef5600SettingValueHigh -> object analog-value,10606 | property present-value | type=analog-value | write=0
ef5600SettingValueLow -> object analog-value,10607 | property present-value | type=analog-value | write=0
Observed values:
switch: 1
Link confirmation time: 7.754s
Control completed in: 7.809s
脚本自动写入并回读验证。输出中的 YABE write guide 部分可直接用于 YABE 手动写入的参考。
YABE:
- 连接网关(IP
192.168.31.205,端口47808),展开设备 106 - 参照上方脚本输出中的 YABE write guide,找到对应对象
- 右键该对象 → Write Property,属性选
present-value,填入目标值后点击 Write
IoT Hub HTTP:
接口路径:POST http://192.168.31.205:8070/api/sendCommand
curl -s -X POST "http://192.168.31.205:8070/api/sendCommand" \
-H "Content-Type: application/json" \
-d '{"devEui":"ffffff100004e99f","params":{"ef5600CommandCode":5,"ef5600SettingAddress":0,"ef5600SettingValueHigh":0,"ef5600SettingValueLow":0}}'
{
"success": true,
"result": {
"devEui": "ffffff100004e99f",
"status": "buffered"
}
}
ChirpStack REST API:
接口路径:POST http://192.168.31.205:8090/api/devices/ffffff100004e99f/queue
curl -s -X POST 'http://192.168.31.205:8090/api/devices/ffffff100004e99f/queue' \
-H 'accept: application/json' \
-H 'Grpc-Metadata-Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{"flushQueue":true,"queueItem":{"confirmed":false,"isPending":false,"object":{"model":"EF5600-DN1","command":"breakerClose"}}}'
{
"id": "4e8b2c17-5f93-4a01-b8d0-2c91ef345678"
}
格式化后的 JSON 内容:
{
"flushQueue": true,
"queueItem": {
"confirmed": false,
"isPending": false,
"object": {
"model": "EF5600-DN1",
"command": "breakerClose"
}
}
}
ChirpStack MQTT:
mosquitto_pub -h 192.168.31.205 -p 1883 -u gateway -P mqtt88888888 \
-t "application/3ef9e6b9-ec54-4eda-86b8-a5fb46899f39/device/ffffff100004e99f/command/down" \
-m '{"flushQueue":true,"devEui":"ffffff100004e99f","confirmed":false,"object":{"model":"EF5600-DN1","command":"breakerClose"}}'
格式化后的 JSON 内容:
{
"flushQueue": true,
"devEui": "ffffff100004e99f",
"confirmed": false,
"object": {
"model": "EF5600-DN1",
"command": "breakerClose"
}
}