From fcecb5c0f0ad904460842b09694034c0eb345e57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 3 Apr 2018 15:41:13 +0200 Subject: [PATCH] Fix heatup flag not resetting on external SD print start If the start of the SD print could only be verified after the blocking heatup was through, the start time was reset to None and hence the heatup flag was not cleared on receival of the first ok, causing no commands to be sent out and things to run into a timeout. Fixes #2536 --- src/octoprint/util/comm.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py index a82ad6950..51eb1393c 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -1003,7 +1003,7 @@ class MachineCom(object): if self._currentFile is None: raise ValueError("No file selected for printing") - self._heatupWaitStartTime = None + self._heatupWaitStartTime = None if not self._heating else time.time() self._heatupWaitTimeLost = 0.0 self._pauseWaitStartTime = 0 self._pauseWaitTimeLost = 0.0 @@ -1631,7 +1631,7 @@ class MachineCom(object): if not disable_external_heatup_detection and not self._temperature_autoreporting \ and not line.strip().startswith("ok") and not self._heating \ and self._firmware_info_received: - self._logger.debug("Externally triggered heatup detected") + self._logger.info("Externally triggered heatup detected") self._heating = True self._heatupWaitStartTime = time.time() @@ -2043,9 +2043,10 @@ class MachineCom(object): self._clear_to_send.set() def _finish_heatup(self): - if self._heatupWaitStartTime: - self._heatupWaitTimeLost = self._heatupWaitTimeLost + (time.time() - self._heatupWaitStartTime) - self._heatupWaitStartTime = None + if self._heating: + if self._heatupWaitStartTime: + self._heatupWaitTimeLost = self._heatupWaitTimeLost + (time.time() - self._heatupWaitStartTime) + self._heatupWaitStartTime = None self._heating = False def _continue_sending(self):