INRO: Update reconnection logic if modbus timeouts but TCP is still connected
parent
c61d0fc6cd
commit
e5b4856072
|
|
@ -274,9 +274,19 @@ void IntegrationPluginInro::setupConnection(ThingSetupInfo *info)
|
||||||
|
|
||||||
connection->modbusTcpMaster()->setHostAddress(deviceInfo.ipAddress);
|
connection->modbusTcpMaster()->setHostAddress(deviceInfo.ipAddress);
|
||||||
|
|
||||||
if (!thing->stateValue("connected").toBool()) {
|
if (!connection->reachable()) {
|
||||||
qCDebug(dcInro()) << "Received discovery paket for" << thing << "Start connecting to the PANTABOX on" << deviceInfo.ipAddress.toString();
|
|
||||||
connection->connectDevice();
|
if (connection->modbusTcpMaster()->connected()) {
|
||||||
|
qCDebug(dcInro()) << "Received discovery paket for" << thing->name() <<
|
||||||
|
"which is not reachable but the TCP socket is still connected. Reconnecting the TCP socket on" <<
|
||||||
|
deviceInfo.ipAddress.toString();
|
||||||
|
connection->modbusTcpMaster()->reconnectDevice();
|
||||||
|
} else {
|
||||||
|
qCDebug(dcInro()) << "Received discovery paket for" << thing->name() <<
|
||||||
|
"which is not reachable and not connected. Start connecting to the PANTABOX on" <<
|
||||||
|
deviceInfo.ipAddress.toString();
|
||||||
|
connection->connectDevice();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue