mirror of
git://soft.sys114.com/klipper
synced 2026-02-10 17:38:07 +09:00
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>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user