diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py index 3a468493..c52c2c61 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -2163,7 +2163,7 @@ class MachineCom(object): self._log("Closing down send loop") def _process_command_phase(self, phase, command, command_type=None, gcode=None): - if self.isStreaming() or phase not in ("queuing", "queued", "sending", "sent"): + if (self.isStreaming() and self.isPrinting()) or phase not in ("queuing", "queued", "sending", "sent"): return command, command_type, gcode if gcode is None: @@ -2432,17 +2432,17 @@ class MachineCom(object): self._heating = True def _gcode_M110_sending(self, cmd, cmd_type=None): - newLineNumber = None + newLineNumber = 0 match = regexes_parameters["intN"].search(cmd) if match: try: newLineNumber = int(match.group("value")) except: pass - else: - newLineNumber = 0 with self._line_mutex: + self._logger.info("M110 detected, setting current line number to {}".format(newLineNumber)) + # send M110 command with new line number self._currentLine = newLineNumber