From 263925625bf7cbc42e501941d537a378964573ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 4 Dec 2017 11:09:22 +0100 Subject: [PATCH] resend_request_communication_errors was too narrow Didn't match Marlin's "checksum mismatch", only Repetier's "checksum error". Since the error handler checks against recoverable_communication_errors before resend_request_communication_errors, we can just switch back to the more broader check against "checksum" for the latter. We could also have added an explicit check for "checksum mismatch" instead but since we used to check for "checksum" and we don't know what other varieties for this specific error might be out there in the thousands of firmware variants (who needs consistency when they can have a free for all?), we'll err on the side of caution instead. Fixes #2262 --- src/octoprint/util/comm.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py index 425b54d8ca..d4199fe787 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -1953,18 +1953,19 @@ def default(_, port, baudrate, read_timeout): return False - _resend_request_communication_errors = ("line number", - "wrong checksum", - "missing checksum", - "format error", - "expected line") - _recoverable_communication_errors = ("no line number with checksum",) - _sd_card_errors = ("volume.init", - "openroot", - "workdir", - "error writing to file", - "cannot open", - "cannot enter") + _recoverable_communication_errors = ("no line number with checksum",) + _resend_request_communication_errors = ("line number", # since this error class get's checked after recoverable + # communication errors, we can use this broad term here + "checksum", # since this error class get's checked after recoverable + # communication errors, we can use this broad term here + "format error", + "expected line") + _sd_card_errors = ("volume.init", + "openroot", + "workdir", + "error writing to file", + "cannot open", + "cannot enter") def _handle_errors(self, line): if line is None: return