From 8a5fe8b1a1c2c29544035cd70949e6f6d1506084 Mon Sep 17 00:00:00 2001 From: Marcio Teixeira Date: Mon, 14 Aug 2017 08:48:18 -0600 Subject: [PATCH] Fixes to MarlinSerialProtocol --- tests/pyMarlin/marlinSerialProtocol.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/pyMarlin/marlinSerialProtocol.py b/tests/pyMarlin/marlinSerialProtocol.py index 59a6afd58..92f568022 100644 --- a/tests/pyMarlin/marlinSerialProtocol.py +++ b/tests/pyMarlin/marlinSerialProtocol.py @@ -87,7 +87,7 @@ class MarlinSerialProtocol: self.marlinBufSize = 4 self.marlinReserve = 1 self.history = GCodeHistory() - self.slow_commands = re.compile("M109|M190|G28|G29") + self.slow_commands = re.compile(b"M109|M190|G28|G29") self.restart() def _stripCommentsAndWhitespace(self, str): @@ -150,15 +150,15 @@ class MarlinSerialProtocol: def _stallWatchdog(self, line): """Watches for a stall in the print. This can happen if a number of - okays are lost in transmission. To recover, we send Marlin a command - with an invalid checksum. One it requests a resend, we will back into - a known good state.""" + okays are lost in transmission. To recover, we send Marlin an invalid + command (no line number, with an asterisk). One it requests a resend, + we will back into a known good state.""" if line == b"": if self.stallCountdown > 0: self.stallCountdown -= 1 else: self.stallCountdown = 2 - self._sendImmediate("\nN0M105*0\n") + self._sendImmediate("\nM105*\n") else: estimated_duration = 15 if self.slow_commands.search(line) else 2 self.stallCountdown = max(estimated_duration, self.stallCountdown-1)