From e04d6ea149b7dd01def1248db5150c7149f07404 Mon Sep 17 00:00:00 2001 From: DivingDuck Date: Thu, 12 Sep 2024 23:40:04 +0200 Subject: [PATCH] Add old behavior of M110 back and combine it with the actual behavior of Prusa firmware >3.12.x --- printrun/printcore.py | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/printrun/printcore.py b/printrun/printcore.py index f0f3da8f5..0845052a6 100644 --- a/printrun/printcore.py +++ b/printrun/printcore.py @@ -416,7 +416,17 @@ def startprint(self, gcode, startindex = 0): return True self.clear = False - self._send("M110 N-1") + + '''Reset Gcode line number for printer + Actual Prusa firmware >3.12.x needs "M110 N-1" + Smoothieware firmware needs "N-1 M110" + Old Marlin firmware 1.0.0 needs in addition line checksum + self._send("M110 N-1", -1, True) work for Smoothieware and old Marlin firmware. + Test for Prusa is needed + ''' + #self._send("M110 N-1") #Prusa firmware >3.12.x + self._send("M110 N-1", -1, True) #all in one if Prusa works with "N-1 M110 N-1 + checksum" + #self._send("M110", -1, True) #older or other firmware, like Smoothieware + Marlin 1.0 needs checksum in addition resuming = (startindex != 0) self.print_thread = threading.Thread(target = self._print, @@ -675,7 +685,17 @@ def _sendnext(self): if not self.paused: self.queueindex = 0 self.lineno = 0 - self._send("M110 N-1") + + '''Reset Gcode Line number for Printer + Actual Prusa firmware >3.12.x needs "M110 N-1" + Smoothieware firmware needs "N-1 M110" + Old Marlin firmware 1.0.0 needs in addition line checksum + self._send("M110 N-1", -1, True) work for Smoothieware and old Marlin firmware. + Test for Prusa is needed + ''' + #self._send("M110 N-1") #Prusa firmware >3.12.x + self._send("M110 N-1", -1, True) #all in one if Prusa works with "N-1 M110 N-1 + checksum" + #self._send("M110", -1, True) #older or other firmware, like Smoothieware + Marlin 1.0 needs checksum in addition def _send(self, command, lineno = 0, calcchecksum = False): # Only add checksums if over serial (tcp does the flow control itself)