Environment
- OS: Windows 10/11
- Ultimaker Cura: 5.13.0
- MKS WiFi Plugin: 1.4.6-dev (this repo,
develop branch)
- Printer: MKS Robin Nano v1.x + Marlin 2.0 (Bluer / Blue Whale variant), Chitu 480×320 LCD
Summary
On Cura 5.13 the plugin silently fails to inject the ;simage: / ;;gimage:
preview header into the generated gcode. The printer's LCD shows only the
file name — the model thumbnail never appears. Affects both local
Save-to-File and WiFi upload paths.
Reproduction
- Cura 5.13.0, this plugin installed.
- Any printer profile.
- Load a model, slice, then
File → Save to File (or Print over WiFi).
- Open the produced
.gcode in a text editor — no ;simage: block.
- Printer LCD shows the file name without a thumbnail.
Log evidence
WARNING - cura.Snapshot.snapshot [200]: Failed to crop the snapshot even after 10 attempts!
DEBUG - MKSWifiPlugin.MKSPreview.add_preview: Skipping adding screenshot
Root cause
Four cascading defects — all four need to be addressed for the LCD
thumbnail to appear reliably:
cura.Snapshot.snapshot() returns None on Cura 5.13 — OpenGL /
QQuickView timing issue. After 10 retries the crop step gives up and
returns None. add_preview immediately bails out with
Skipping adding screenshot.
CuraEngineBackend.getLatestSnapshot() uses the same broken code
internally — not a valid fallback on its own.
MKSOutputDevice.requestWrite only fires its own writeStarted signal,
not OutputDeviceManager.writeStarted, so add_preview is never
invoked on the WiFi upload path (only local save triggers it).
mks_simage / mks_gimage default to 0 for community printer
profiles that don't declare them. int(None) never happens because
the if ... in meta_data guard skips it — but when a profile does
declare an invalid or zero value, an empty preview is produced.
Fix (submitted as PR)
MKSPreview.take_screenshot() — new fallback chain
Snapshot.snapshot → Snapshot.isometricSnapshot → backend.getLatestSnapshot.
Snapshot.isometricSnapshot() builds its own offscreen Camera +
PreviewPass + QtRenderer and does not depend on viewport render state,
so it works reliably on Cura 5.13.
MKSPreview.generate_preview() — sensible defaults (simage=100,
gimage=200) and clamp non-positive values.
MKSOutputDevice.requestWrite() — direct MKSPreview.add_preview(self)
call right after self.writeStarted.emit(self) so WiFi uploads inject
the preview too.
After the fix
Cura log now contains:
DEBUG - MKSWifiPlugin.MKSPreview.take_screenshot: MKSPreview: using Snapshot.isometricSnapshot fallback
Produced gcode starts with:
;simage:...
;;gimage:...
;MKSPREVIEWPROCESSED
Thumbnail appears on the printer's LCD for both Save-to-File and
Print-over-WiFi paths. Verified on real hardware (MKS Robin Nano v1.x +
Marlin 2.0 Bluer variant).
References
Disclosure
Root-cause analysis, patch and documentation developed with AI-assisted
coding (GitHub Copilot + Claude). All patches were validated on real
hardware by the human contributor before this report was filed.
Environment
developbranch)Summary
On Cura 5.13 the plugin silently fails to inject the
;simage:/;;gimage:preview header into the generated gcode. The printer's LCD shows only the
file name — the model thumbnail never appears. Affects both local
Save-to-File and WiFi upload paths.
Reproduction
File → Save to File(orPrint over WiFi)..gcodein a text editor — no;simage:block.Log evidence
Root cause
Four cascading defects — all four need to be addressed for the LCD
thumbnail to appear reliably:
cura.Snapshot.snapshot()returnsNoneon Cura 5.13 — OpenGL /QQuickView timing issue. After 10 retries the crop step gives up and
returns
None.add_previewimmediately bails out withSkipping adding screenshot.CuraEngineBackend.getLatestSnapshot()uses the same broken codeinternally — not a valid fallback on its own.
MKSOutputDevice.requestWriteonly fires its ownwriteStartedsignal,not
OutputDeviceManager.writeStarted, soadd_previewis neverinvoked on the WiFi upload path (only local save triggers it).
mks_simage/mks_gimagedefault to0for community printerprofiles that don't declare them.
int(None)never happens becausethe
if ... in meta_dataguard skips it — but when a profile doesdeclare an invalid or zero value, an empty preview is produced.
Fix (submitted as PR)
MKSPreview.take_screenshot()— new fallback chainSnapshot.snapshot → Snapshot.isometricSnapshot → backend.getLatestSnapshot.Snapshot.isometricSnapshot()builds its own offscreenCamera+PreviewPass+QtRendererand does not depend on viewport render state,so it works reliably on Cura 5.13.
MKSPreview.generate_preview()— sensible defaults (simage=100,gimage=200) and clamp non-positive values.MKSOutputDevice.requestWrite()— directMKSPreview.add_preview(self)call right after
self.writeStarted.emit(self)so WiFi uploads injectthe preview too.
After the fix
Cura log now contains:
Produced gcode starts with:
Thumbnail appears on the printer's LCD for both Save-to-File and
Print-over-WiFi paths. Verified on real hardware (MKS Robin Nano v1.x +
Marlin 2.0 Bluer variant).
References
https://github.com/hobibilgisi/MKS_Wifi_Plugin_Thumbnail_Error_Fix
No image preview on printing after upload #354, Can't save thumb in Cura 5.0.0 #299, [BUG] MKS Marlin 2.0 - Plugin 'develop' and 1.1.2 do not render preview in Cura 4.8.0 #142
Disclosure
Root-cause analysis, patch and documentation developed with AI-assisted
coding (GitHub Copilot + Claude). All patches were validated on real
hardware by the human contributor before this report was filed.