diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2017-01-09 23:50:13 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2017-01-10 00:13:28 -0500 |
commit | 93d3a6e1d1f298bdbe4d6dc5c88226c63f7c6c41 (patch) | |
tree | 2f945555e556895f72e0782f1557e0e00189975e /klippy/klippy.py | |
parent | eebaeeff96450c840db1a86f08877420d3dd5073 (diff) | |
download | kutter-93d3a6e1d1f298bdbe4d6dc5c88226c63f7c6c41.tar.gz kutter-93d3a6e1d1f298bdbe4d6dc5c88226c63f7c6c41.tar.xz kutter-93d3a6e1d1f298bdbe4d6dc5c88226c63f7c6c41.zip |
klippy: Warn the user on common errors due to old firmware
Check for msgproto.error and warn the user about version firmware
version mismatch. Raise msgproto.error when extracting firmware
constants.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/klippy.py')
-rw-r--r-- | klippy/klippy.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/klippy/klippy.py b/klippy/klippy.py index 7af2e9b8..92fe6363 100644 --- a/klippy/klippy.py +++ b/klippy/klippy.py @@ -6,6 +6,7 @@ # This file may be distributed under the terms of the GNU GPLv3 license. import sys, optparse, ConfigParser, logging, time, threading import gcode, toolhead, util, mcu, fan, heater, extruder, reactor, queuelogger +import msgproto message_startup = """ The klippy host software is attempting to connect. Please @@ -19,6 +20,15 @@ command to reload the config and restart the host software. Printer is halted """ +message_protocol_error = """ +This type of error is frequently caused by running an older +version of the firmware on the micro-controller (fix by +recompiling and flashing the firmware). +Once the underlying issue is corrected, use the "RESTART" +command to reload the config and restart the host software. +Protocol error connecting to printer +""" + message_mcu_connect_error = """ This is an unrecoverable error. Please manually restart the micro-controller and then issue the "RESTART" command to @@ -169,6 +179,10 @@ class Printer: logging.exception("Config error") self.state_message = "%s%s" % (str(e), message_restart) self.reactor.update_timer(self.stats_timer, self.reactor.NEVER) + except msgproto.error, e: + logging.exception("Protocol error") + self.state_message = "%s%s" % (str(e), message_protocol_error) + self.reactor.update_timer(self.stats_timer, self.reactor.NEVER) except mcu.error, e: logging.exception("MCU error during connect") self.state_message = "%s%s" % (str(e), message_mcu_connect_error) |