Print File Corruption Precheck
Before starting a print, run a local health check on the G-code file: check whether the file is corrupted or garbled, and gather statistics such as the print range, dimensions, build height, and layer count.
Feature Overview
- Garbled / corruption check: Performs a byte-by-byte UTF-8 validity check (compatible with multi-byte sequences spanning chunks), precisely locating the line number and byte offset of the first illegal byte; able to identify non-UTF-8 text caused by slicer software writing Chinese in encodings such as GBK, as well as garbled text from copy corruption
- Control character detection: Specifically identifies abnormal bytes in G-code that have been corrupted into
0x00–0x1F(e.g., the parameter letterEchanged to0x05). Such bytes are valid ASCII and cannot be found by UTF-8 validation, but they will cause Klipper to report parsing errors on the corresponding line; the tool provides the line number and byte offset - Non-ASCII statistics: Counts the number of non-ASCII bytes in the file; as long as the file is valid UTF-8, these bytes are not considered corruption whether they appear in comments or Chinese parameter names (such as heater names), and do not affect printing; if a command line contains non-ASCII, the line numbers are listed neutrally for verification
- Print range analysis: Parses
G0/G1coordinates to provide the minimum, maximum, and travel of each of the X / Y / Z axes, and summarizes the print dimensions (X × Y) and build height (Z) - Print information statistics: Estimates the print dimensions (X × Y), build height (Z), and print layer count
- Host remote reading: After entering the host IP to connect to Moonraker, you can select files from two sources to download and precheck locally in the browser, both sorted by latest time in descending order:
- Print files: Lists G-code files in the
gcodesdirectory (including subdirectories), sorted by modification time in descending order, with model thumbnails lazily loaded inline (the list shows the first 50 by default, with "Show more") - History tasks: Reads the print history (Moonraker History component), sorted by most recent print time in descending order, displaying status, duration, and filament usage, and showing a model preview image when a thumbnail exists; click any entry to download the corresponding G-code file for local analysis
- Print files: Lists G-code files in the
- Local parsing: All analysis is done locally in the browser; file contents are never uploaded to any server
Notes
- Supports common print file extensions such as
.gcode/.gco/.gc/.g/.nc - It is recommended to access from a PC for a better experience; analyzing large files (e.g., hundreds of MB) takes some time, so please wait patiently for the progress bar to complete
- The print range and layer count are calculated from G-code motion commands and include travel moves; they are for reference only, and the actual build dimensions are subject to the slicer software
- If the file uses non-standard command formats or a large number of custom macros, the range statistics may be incomplete
- Host remote reading is a read-only operation; it only downloads G-code files in the
gcodesdirectory and reads print history, and will not modify or delete files on the host; ensure that the current browser can access the host's Moonraker (default port7125). The connection may fail if the network is unreachable or when HTTPS mixed content is used; in that case, use local upload instead
Loading...
Loading...