From 61e518437779fe3fdaaa12d0367a5e8a8057eaee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 12 Jul 2018 14:38:12 +0200 Subject: [PATCH] Fix "now" timestamp Should be taken *after* reading from the serial line, not before. --- src/octoprint/util/comm.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py index 65582d000..bf1870141 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -1512,11 +1512,13 @@ class MachineCom(object): self.sayHello() while self._monitoring_active: - now = time.time() try: line = self._readline() if line is None: break + + now = time.time() + if line.strip() is not "": self._consecutive_timeouts = 0 self._timeout = get_new_timeout("communicationBusy" if self._busy_protocol_detected else "communication", self._timeout_intervals)