Добрый день! Подключен модуль разумного дома, в messages постоянно ошибки:
Dec 9 13:45:19 wirenboard user.notice serial: TRegisterHandler::Flush(): warning: Serial protocol error: failed to write holding @ 7 for device modbus:24
Dec 9 13:45:42 wirenboard user.notice serial: TRegisterHandler::Flush(): warning: Serial protocol error: failed to write holding @ 7 for device modbus:24
Dec 9 13:45:42 wirenboard user.notice serial: TRegisterHandler::Flush(): warning: Serial protocol error: failed to write holding @ 6 for device modbus:24
Dec 9 13:46:05 wirenboard user.notice serial: TRegisterHandler::Flush(): warning: Serial protocol error: failed to write holding @ 7 for device modbus:24
Dec 9 13:46:05 wirenboard user.notice serial: TRegisterHandler::Flush(): warning: Serial protocol error: failed to write holding @ 6 for device modbus:24
Dec 9 13:46:28 wirenboard user.notice serial: TRegisterHandler::Flush(): warning: Serial protocol error: failed to write holding @ 7 for device modbus:24
Dec 9 13:46:28 wirenboard user.notice serial: TRegisterHandler::Flush(): warning: Serial protocol error: failed to write holding @ 6 for device modbus:24
Dec 9 13:46:51 wirenboard user.notice serial: TRegisterHandler::Flush(): warning: Serial protocol error: failed to write holding @ 7 for device modbus:24
Dec 9 13:47:14 wirenboard user.notice serial: TRegisterHandler::Flush(): warning: Serial protocol error: failed to write holding @ 5 for device modbus:24
Dec 9 13:47:14 wirenboard user.notice serial: TRegisterHandler::Flush(): warning: Serial protocol error: failed to write holding @ 7 for device modbus:24
“Переопределил” устройство так:
// Configuration options
{
"device_type" : "DDL24l",
"device" : {
"name": "DDL24 left",
"id": "ddl24",
"enabled": true,
"channels": [
{
"name" : "2heat",
"reg_type" : "holding",
"address" : 4,
"type": "range",
"max": "0xff"
},
{
"name" : "2floor",
"reg_type" : "holding",
"address" : 5,
"type": "range",
"max": "0xff"
},
{
"name" : "1floor",
"reg_type" : "holding",
"address" : 6,
"type": "range",
"max": "0xff"
},
{
"name" : "1heat",
"reg_type" : "holding",
"address" : 7,
"type": "range",
"max": "0xff"
},
{
"name" : "channel_all",
"reg_type" : "holding",
"address" : 8,
"type": "range",
"max": 100
}
]
}
}
есть подозрение, что это происходит из-за того, что скриптик пытается одновременно записывать, но ведь это должно как-то разруливаться…
function makePID(name, target, detector, control_dev, control_str) {
var et = 0;
var et_1 = 0;
var It = 0;
var It_1 = 0;
var u = 0;
var t = 0;
defineRule(name, {
when: cron("@every 23s"),
then: function(newValue, devName, cellName) {
t = dev["kotelnaya"][detector];
et = dev["temp_control"][target] - t;
It = It_1 + (dev["temp_control"]["Ki"] / 10) * et;
if (It > 255) {
It = 255;
};
if (It < 12) {
It = 12;
};
if (dev["temp_control"]["debug"]) {
log(detector + " It= " + Math.round(It * 1000) / 1000 + " It_1= " + Math.round(It_1 * 1000) / 1000 + " текущая t=" + t + " целевая t=" + dev["temp_control"][target]);
};
It_1 = It;
u = Math.round((dev["temp_control"]["Kp"] / 10) * et + It + (dev["temp_control"]["Kd"] / 10) * (et - et_1));
if (dev.temp_control.debug) {
log(detector + " raw=" + Math.round(u * 1000) / 1000 + " et=" + Math.round(et * 1000) / 1000 + " et_1=" + Math.round(et_1 * 1000) / 1000);
};
et_1 = et;
if (u > 255) {
u = 255;
};
if (u < 0) {
u = 0;
};
dev[control_dev][control_str] = u;
if (dev.temp_control.debug) {
log(detector + " curr t=" + Math.round(t * 1000) / 1000 + " " + control_str + " u=" + u);
};
}
})
};
makePID("control1_heat", "подача_1_батареи", "подача_1_батареи", "ddl24_24", "1heat");
makePID("control2_heat", "подача_2_батареи", "подача_2_батареи", "ddl24_24", "2heat");
makePID("control0_floor", "подача_0_пол", "подача_0_пол", "ddl24_23", "0_floor");
makePID("control1_floor", "подача_1_пол", "подача_1_пол", "ddl24_24", "1floor");
makePID("control2_floor", "подача_2_пол", "подача_2_пол", "ddl24_24", "2floor");