Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reprint after print not possible and ends in a runtime error, see Issue #1421 #1454

Merged
merged 5 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions printrun/printcore.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,16 @@ def startprint(self, gcode, startindex = 0):
return True

self.clear = False
self._send("M110 N-1")

'''Reset Gcode line number for printer, pls. see issue #1421.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This information if very useful but I would not clutter the code with it. I believe this kind of explanation belongs to the commit message that introduces the code change, not in the code itself. If you know what I mean. Plus you wouldn't need to repeat it twice. I'm happy with the change otherwise.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem, I removed the comments.

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) results in sending "N-1 M110 N-1*125"
and do not harm Smoothieware and old Marlin firmware.
Test for Prusa is needed.
'''
self._send("M110 N-1", -1, True) #all in one if Prusa works with "N-1 M110 N-1 + checksum"

resuming = (startindex != 0)
self.print_thread = threading.Thread(target = self._print,
Expand Down Expand Up @@ -675,7 +684,16 @@ def _sendnext(self):
if not self.paused:
self.queueindex = 0
self.lineno = 0
self._send("M110 N-1")

'''Reset Gcode line number for printer, pls. see issue #1421.
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) results in sending "N-1 M110 N-1*125"
and do not harm Smoothieware and old Marlin firmware.
Test for Prusa is needed.
'''
self._send("M110 N-1", -1, True) #all in one if Prusa works with "N-1 M110 N-1 + checksum"

def _send(self, command, lineno = 0, calcchecksum = False):
# Only add checksums if over serial (tcp does the flow control itself)
Expand Down
21 changes: 21 additions & 0 deletions testfiles/arc_test.gcode
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
; Print this file for a quick test of support for arc movements with
; G2 and G3 and z helix movement up and down +- 10 mm, 6 times a full cycle
; It takes only a half minute and prints above the print bed (z=20 mm)
; w/o heating and extrusion

G28 ; home
G0 Z10.0000 S0 ; lift z
G90 ; absolute mode
G21 ; set unit to mm

G2 X15 Y20 I30 J40 Z20 F8000
G3 X15 Y20 I30 J40 Z10 F8000
G2 X15 Y20 I30 J40 Z20 F8000
G3 X15 Y20 I30 J40 Z10 F8000
G2 X15 Y20 I30 J40 Z20 F8000
G3 X15 Y20 I30 J40 Z10 F8000

G0 X5.0000
G0 Y5.0000

M84; motors off
Loading
Loading