aboutsummaryrefslogtreecommitdiffstats
path: root/klippy
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2017-09-05 21:15:24 -0400
committerKevin O'Connor <kevin@koconnor.net>2017-09-05 22:12:15 -0400
commit09e32d1b8454b64b8571a15b95b27a8f9412a777 (patch)
tree1df32a48bcd98c9a619d84046043cb8f2e283dda /klippy
parent68fc6abf748487c0d24fa217ea788fb974b67697 (diff)
downloadkutter-09e32d1b8454b64b8571a15b95b27a8f9412a777.tar.gz
kutter-09e32d1b8454b64b8571a15b95b27a8f9412a777.tar.xz
kutter-09e32d1b8454b64b8571a15b95b27a8f9412a777.zip
mcu: Provide some further help on common MCU shutdown errors
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy')
-rw-r--r--klippy/klippy.py3
-rw-r--r--klippy/mcu.py30
2 files changed, 29 insertions, 4 deletions
diff --git a/klippy/klippy.py b/klippy/klippy.py
index ae4ea656..60bb9359 100644
--- a/klippy/klippy.py
+++ b/klippy/klippy.py
@@ -242,8 +242,7 @@ class Printer:
def note_shutdown(self, msg):
if self.state_message == message_ready:
self.need_dump_debug = True
- self.state_message = "Firmware shutdown: %s%s" % (
- msg, message_shutdown)
+ self.state_message = "%s%s" % (msg, message_shutdown)
self.gcode.set_printer_ready(False)
def note_mcu_error(self, msg):
self.state_message = "%s%s" % (msg, message_restart)
diff --git a/klippy/mcu.py b/klippy/mcu.py
index 7724e63e..c0fc8f6d 100644
--- a/klippy/mcu.py
+++ b/klippy/mcu.py
@@ -475,13 +475,16 @@ class MCU:
if self.is_shutdown:
return
self.is_shutdown = True
- self._shutdown_msg = params['#msg']
+ self._shutdown_msg = msg = params['#msg']
logging.info("%s: %s" % (params['#name'], self._shutdown_msg))
pst = self._print_start_time
logging.info("Clock last synchronized at %.6f (%d)" % (
pst, int(pst * self._mcu_freq)))
self.serial.dump_debug()
- self._printer.note_shutdown(self._shutdown_msg)
+ prefix = "MCU shutdown: "
+ if params['#name'] == 'is_shutdown':
+ prefix = "Previous MCU shutdown: "
+ self._printer.note_shutdown(prefix + msg + error_help(msg))
# Connection phase
def _check_restart(self, reason):
start_reason = self._printer.get_start_args().get("start_reason")
@@ -742,5 +745,28 @@ class MCU:
def __del__(self):
self.disconnect()
+Common_MCU_errors = {
+ ("Timer too close", "No next step", "Missed scheduling of next "): """
+This is generally indicative of an intermittent
+communication failure.""",
+ ("ADC out of range",): """
+This generally occurs when a heater temperature exceeds
+it's configured min_temp or max_temp.""",
+ ("Rescheduled timer in the past", "Stepper too far in past"): """
+This generally occurs when the micro-controller has been
+requested to step at a rate higher than it is capable of
+obtaining.""",
+ ("Command request",): """
+This generally occurs in response to an M112 G-Code command
+or in response to an internal error in the host software.""",
+}
+
+def error_help(msg):
+ for prefixes, help_msg in Common_MCU_errors.items():
+ for prefix in prefixes:
+ if msg.startswith(prefix):
+ return help_msg
+ return ""
+
def add_printer_objects(printer, config):
printer.add_object('mcu', MCU(printer, config.getsection('mcu')))