From 8711702cf58def2ed13aec9794f6a14e731a11a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 19 Feb 2015 23:04:47 +0100 Subject: [PATCH] Temperature polling fixed, virtual printer having issues with resends TODO: - solve virtual printer resend issues - document hook --- src/octoprint/util/comm.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py index 6fb2d1f3..553ec1b4 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -798,10 +798,6 @@ class MachineCom(object): self._processTemperatures(line) self._callback.mcTempUpdate(self._temp, self._bedTemp) - #If we are waiting for an M109 or M190 then measure the time we lost during heatup, so we can remove that time from our printing time estimate. - if 'ok' in line and self._heatupWaitStartTime: - self._heatupWaitTimeLost = self._heatupWaitTimeLost + (time.time() - self._heatupWaitStartTime) - self._heatupWaitStartTime = None elif supportRepetierTargetTemp and ('TargetExtr' in line or 'TargetBed' in line): matchExtr = self._regex_repetierTempExtr.match(line) matchBed = self._regex_repetierTempBed.match(line) @@ -830,6 +826,11 @@ class MachineCom(object): except ValueError: pass + #If we are waiting for an M109 or M190 then measure the time we lost during heatup, so we can remove that time from our printing time estimate. + if 'ok' in line and self._heatupWaitStartTime: + self._heatupWaitTimeLost = self._heatupWaitTimeLost + (time.time() - self._heatupWaitStartTime) + self._heatupWaitStartTime = None + ##~~ SD Card handling elif 'SD init fail' in line or 'volume.init failed' in line or 'openRoot failed' in line: self._sdAvailable = False @@ -1006,11 +1007,11 @@ class MachineCom(object): if self._heatupWaitStartTime is None: if time.time() > tempRequestTimeout: - self._sendCommand("M105") + self._sendCommand("M105", sendChecksum=True) tempRequestTimeout = getNewTimeout("temperature") if self.isSdPrinting() and time.time() > sdStatusRequestTimeout: - self._sendCommand("M27") + self._sendCommand("M27", sendChecksum=True) sdStatusRequestTimeout = getNewTimeout("sdStatus") if "ok" in line: