From a068d5a2cde84d17c3a7e13d1cce95323e32452d Mon Sep 17 00:00:00 2001 From: Patrick Schurig Date: Wed, 24 Jun 2026 23:08:36 +0200 Subject: [PATCH] abbterra: fix RTU setup on slow radio links (433 MHz) reachableChanged(true) never fires within the nymea setup timeout when the RTU link is slow (e.g. 433 MHz radio relay). Add a fallback: trigger initialize() immediately if master is already connected (QTimer::singleShot 500 ms), and also on master::connectedChanged. The existing reachableChanged path is kept for TCP-style RTU adapters. Bump to 1.15.0+etm5. Co-Authored-By: Claude Sonnet 4.6 --- abbterra/integrationpluginabbterra.cpp | 15 +++++++++++++++ debian/changelog | 8 ++++++++ 2 files changed, 23 insertions(+) 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.