mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-30 20:09:14 +03:00
fix ecto modbus
This commit is contained in:
@@ -80,8 +80,6 @@ private:
|
||||
bool _isNetworkActive;
|
||||
bool _mqttIsConnect;
|
||||
|
||||
|
||||
|
||||
public:
|
||||
EctoControlAdapter(String parameters) : IoTItem(parameters)
|
||||
{
|
||||
@@ -119,7 +117,6 @@ public:
|
||||
node.preTransmission(modbusPreTransmission);
|
||||
node.postTransmission(modbusPostTransmission);
|
||||
|
||||
|
||||
if (_DIR_PIN)
|
||||
{
|
||||
_DIR_PIN = _DIR_PIN;
|
||||
@@ -130,16 +127,20 @@ public:
|
||||
// 0x14 – адаптер OpenTherm (вторая версия)
|
||||
// 0x15 – адаптер eBus
|
||||
// 0x16 – адаптер Navien
|
||||
if (_addr > 0)
|
||||
{
|
||||
uint16_t type;
|
||||
readFunctionModBus(0x0000, type);
|
||||
if (0x14 != (uint8_t)type || 0x15 != (uint8_t)type || 0x16 != (uint8_t)type)
|
||||
{
|
||||
SerialPrint("E", "EctoControlAdapter", "Не подходящее устройство, type: " + String(type, HEX));
|
||||
}
|
||||
|
||||
}
|
||||
else if (_addr == 0)
|
||||
{ // если адреса нет, то шлем широковещательный запрос адреса
|
||||
uint8_t addr = node.readAddresEctoControl();
|
||||
SerialPrint("I", "EctoControlAdapter", "readAddresEctoControl, addr: " + String(addr, HEX) + " - Enter to configuration");
|
||||
|
||||
}
|
||||
getModelVersion();
|
||||
getBoilerInfo();
|
||||
getBoilerStatus();
|
||||
@@ -322,8 +323,7 @@ public:
|
||||
tlgrmItem->sendTelegramMsg(false, msg);
|
||||
}
|
||||
|
||||
~EctoControlAdapter()
|
||||
{
|
||||
~EctoControlAdapter() {
|
||||
};
|
||||
|
||||
bool writeFunctionModBus(const uint16_t ®, uint16_t &data)
|
||||
@@ -792,9 +792,6 @@ public:
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
void *getAPI_EctoControlAdapter(String subtype, String param)
|
||||
|
||||
@@ -429,8 +429,12 @@ uint8_t ModbusMaster::ModbusMasterTransaction(uint8_t u8MBFunction)
|
||||
if (u8ModbusADUSize == 5)
|
||||
{
|
||||
// verify response is for correct Modbus slave
|
||||
if (u8ModbusADU[0] != _u8MBSlave || u8ModbusADU[0] != 0x00)
|
||||
if (u8ModbusADU[0] != _u8MBSlave)
|
||||
{
|
||||
// Serial.print(u8ModbusADU[0], HEX);
|
||||
// Serial.print(" != ");
|
||||
// Serial.println(_u8MBSlave, HEX);
|
||||
|
||||
u8MBStatus = ku8MBInvalidSlaveID;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -11,12 +11,12 @@
|
||||
"page": "Котёл",
|
||||
"descr": "Адаптер",
|
||||
"int": 60,
|
||||
"addr": "0xF0",
|
||||
"addr": 240,
|
||||
"RX": 18,
|
||||
"TX": 19,
|
||||
"DIR_PIN": 4,
|
||||
"baud": 9600,
|
||||
"protocol": "SERIAL_8N2",
|
||||
"baud": 19200,
|
||||
"protocol": "SERIAL_8N1",
|
||||
"debug": 1
|
||||
}
|
||||
],
|
||||
@@ -37,7 +37,7 @@
|
||||
"title": "EctoControlAdapter",
|
||||
"moduleDesc": "Управление отопительным котлом через адаптер EctoControl по протоколам OpenTherm, eBUS, Navien. Посредством Modbus RTU. Разъем 4P4C: 1-Желтый(красный)+12V; 2-Белый-GND; 3-Зелёный-A; 4-Коричневый(Синий)-B",
|
||||
"propInfo": {
|
||||
"addr": "Адрес slave",
|
||||
"addr": "Адрес slave, что бы узнать адрес - в конфиге адрес 0 и смотреть лог (требуется проверка)",
|
||||
"int": "Количество секунд между опросами датчика.",
|
||||
"RX": "Пин RX",
|
||||
"TX": "Пин TX",
|
||||
|
||||
Reference in New Issue
Block a user