Yet another fix for the M999 resend issue
Should hopefully now be also fixed in case of a newly established connection with the printer, which was a regression due to the fix of the resending code.master
parent
24bb0fdf05
commit
dd3e9030fa
|
@ -578,6 +578,7 @@ class MachineCom(object):
|
|||
sdStatusRequestTimeout = timeout
|
||||
startSeen = not settings().getBoolean(["feature", "waitForStartOnConnect"])
|
||||
while True:
|
||||
try:
|
||||
line = self._readline()
|
||||
if line == None:
|
||||
break
|
||||
|
@ -766,6 +767,13 @@ class MachineCom(object):
|
|||
self._sendNext()
|
||||
elif "resend" in line.lower() or "rs" in line:
|
||||
self._handleResendRequest(line)
|
||||
except:
|
||||
self._logger.exception("Something crashed inside the serial connection loop, please report this in OctoPrint's bug tracker:")
|
||||
|
||||
errorMsg = "See octoprint.log for details"
|
||||
self._log(errorMsg)
|
||||
self._errorValue = errorMsg
|
||||
self._changeState(self.STATE_ERROR)
|
||||
self._log("Connection closed, closing down monitor")
|
||||
|
||||
def _handleResendRequest(self, line):
|
||||
|
@ -778,7 +786,7 @@ class MachineCom(object):
|
|||
|
||||
if lineToResend is not None:
|
||||
self._resendDelta = self._currentLine - lineToResend
|
||||
if self._resendDelta > len(self._lastLines):
|
||||
if self._resendDelta > len(self._lastLines) or len(self._lastLines) == 0:
|
||||
self._errorValue = "Printer requested line %d but no sufficient history is available, can't resend" % lineToResend
|
||||
self._logger.warn(self._errorValue)
|
||||
if self.isPrinting():
|
||||
|
|
Loading…
Reference in New Issue