diff --git a/CHANGELOG.md b/CHANGELOG.md index e6ee317..0526003 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## v0.1.5 +* Added: Timeout on driver startup. Prevents problems, if the MQTT broker is not reachable on driver startup * Changed: Fixed status flapping between running and standby ## v0.1.4 diff --git a/dbus-mqtt-pv/dbus-mqtt-pv.py b/dbus-mqtt-pv/dbus-mqtt-pv.py index 7ba15a7..bc3b568 100644 --- a/dbus-mqtt-pv/dbus-mqtt-pv.py +++ b/dbus-mqtt-pv/dbus-mqtt-pv.py @@ -222,7 +222,7 @@ def __init__( self._dbusservice.add_path('/ProductId', 0xFFFF) self._dbusservice.add_path('/ProductName', productname) self._dbusservice.add_path('/CustomName', customname) - self._dbusservice.add_path('/FirmwareVersion', '0.1.4 (20231106)') + self._dbusservice.add_path('/FirmwareVersion', '0.1.5 (20231218)') # self._dbusservice.add_path('/HardwareVersion', '') self._dbusservice.add_path('/Connected', 1) @@ -363,6 +363,15 @@ def main(): logging.info("Waiting 5 seconds for receiving first data...") else: logging.warning("Waiting since %s seconds for receiving first data..." % str(i * 5)) + + # check if timeout was exceeded + if timeout <= (i * 5): + logging.error( + "Driver stopped. Timeout of %i seconds exceeded, since no new MQTT message was received in this time." + % timeout + ) + sys.exit() + sleep(5) i += 1