Repository navigation
Conversation
Uploads run through startprint, which sends M110 N-1 at the start and end of a print. With M28 open the firmware writes those lines into the file, so uploaded files gained lines that weren't in the original. The start of an upload still needs the line number reset, so send it before M28 instead. Add an upload option to startprint that leaves out both, and use it from Pronterface and pronsole.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Uploads to SD run through
startprint, which sendsM110 N-1at the start and end of a print. WhileM28has a file open, the firmware writes those lines into the file, so an uploaded file ends up with lines that weren't in the original.This PR adds an
uploadoption tostartprintthat leaves out both, and uses it from Pronterface and pronsole. The start of an upload still needs the line number reset, so both now sendM110 N-1beforeM28. Normal prints still send it at the start and end.Testing
Tested on an MKS TinyBee running Marlin
bugfix-2.1.xat 250000 baud. The stored lines were read back by running each file from SD withM111 S1echo on.G4lines (35 bytes)masterM110lines storedM110lines storedA Pronterface upload of the first 15000 lines of a PrusaSlicer file, whose stored lines come to 448969 bytes, was 448989 bytes on
masterand 448969 bytes with this PR.With this PR, two uploads in a row and then a normal print all ran with no line number or checksum errors, in both Pronterface and pronsole.
tests/test_printcore.pyhas three new tests, with a mocked printer: a print sends both resets, an upload sends only its own lines, and a print after an upload still sends both resets. All tests intests/pass.AI disclosure
Full disclosure: I don't know your policy on AI, so please treat this PR accordingly.
AI used: Claude Opus 5.5 (Anthropic), via Claude Code. It wrote the code and this description, and ran the tests above on @ellensp's board. @ellensp found the problem, directed the work and verified the result.