From 9caf13d620a80df37b3f08ba42debf1c94988ba3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Sun, 28 Jun 2015 16:32:07 +0200 Subject: [PATCH] Fix: SD card errors shouldn't not cause disconnect If the SD card fails to initialize with a volume.init failure, that's not a reason to break off all diplomatic relations with the printer. --- src/octoprint/util/comm.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py index 65c99025..8dd69332 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -1298,10 +1298,14 @@ class MachineCom(object): if self._regex_minMaxError.match(line): line = line.rstrip() + self._readline() - #Skip the communication errors, as those get corrected. if 'line number' in line.lower() or 'checksum' in line.lower() or 'expected line' in line.lower(): + #Skip the communication errors, as those get corrected. self._lastCommError = line[6:] if line.startswith("Error:") else line[2:] pass + elif 'volume.init' in line.lower() or "openroot" in line.lower() or 'workdir' in line.lower()\ + or "error writing to file" in line.lower(): + #Also skip errors with the SD card + pass elif not self.isError(): self._errorValue = line[6:] if line.startswith("Error:") else line[2:] self._changeState(self.STATE_ERROR)