diff --git a/abbterra/integrationpluginabbterra.cpp b/abbterra/integrationpluginabbterra.cpp index 762181a..d7185eb 100644 --- a/abbterra/integrationpluginabbterra.cpp +++ b/abbterra/integrationpluginabbterra.cpp @@ -11,6 +11,7 @@ #include "plugininfo.h" #include +#include #include #include @@ -332,6 +333,20 @@ void IntegrationPluginAbbterra::setupRtuThing(ThingSetupInfo *info) const quint16 slaveId = static_cast(thing->paramValue(terraAcRtuThingSlaveIdParamTypeId).toUInt()); AbbTerraModbusRtuConnection *connection = new AbbTerraModbusRtuConnection(master, slaveId, thing); + // reachableChanged(true) may never fire on slow radio links (e.g. 433 MHz) + // before the setup timeout expires, so we also trigger initialize() as soon + // as the master port is open. + if (master->connected()) { + QTimer::singleShot(500, connection, [connection]() { + connection->initialize(); + }); + } + connect(master, &ModbusRtuMaster::connectedChanged, connection, [connection](bool connected) { + if (connected) { + connection->initialize(); + } + }); + connect(connection, &AbbTerraModbusRtuConnection::reachableChanged, thing, [this, thing, connection](bool reachable) { if (reachable) { connection->initialize(); diff --git a/debian/changelog b/debian/changelog index b0f174e..6a288cb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +etm-powersync-plugins-modbus (1.15.0+etm5) trixie; urgency=medium + + * abbterra: fix RTU setup on slow radio links — trigger initialize() on + master connectedChanged, not only on reachableChanged (which never fires + within setup timeout over 433 MHz). + + -- ETM-Schurig SARL Tue, 24 Jun 2026 10:00:00 +0200 + etm-powersync-plugins-modbus (1.15.0+etm4) trixie; urgency=medium * Correction modbus registers.