[GH-ISSUE #1166] [Bug]: Printer card always show thumbnail from first plate when printing due to missing gcode file path in MQTT gcode_file #842

Closed
opened 2026-05-06 12:33:21 +02:00 by BreizhHardware · 1 comment

Originally created by @smandon on GitHub (Apr 29, 2026).
Original GitHub issue: https://github.com/maziggy/bambuddy/issues/1166

Originally assigned to: @maziggy on GitHub.

Component

Bambuddy

Bug Description

I often print from multi-plates files where each plate was sent separately to archives, but the 3mf sent by bambu studio includes thumbnails for all plates. When I print such a file from archives, the printer card always shows the embedded image from the first plate as thumbnail, while the thumbnail displayed in archives is correct.

From what I found, in api/routes/printers.py the get_printer_cover function gets the value of gcode_file from the printer via MQTT and uses a regex match to determine the plate number and defaults to plate number 1 if it isn't found.
However I can see in my logs that gcode_file contains only the name of the 3mf file, not the path to the gcode file inside the archive, that's why it defaults to the first plate. Maybe it's specific to some printers and/or firmware versions.

From what I found analysing some 3mf files, there could be multiple ways to determine the correct plate number/and or thumbnail file from the content of the 3mf file itself:

  1. using the content of _rels/.rels file which gives the right thumbnail file path
<?xml version="1.0" encoding="UTF-8"?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
 <Relationship Target="/3D/3dmodel.model" Id="rel-1" Type="http://schemas.microsoft.com/3dmanufacturing/2013/01/3dmodel"/>
 <Relationship Target="/Metadata/plate_4.png" Id="rel-2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail"/>
 <Relationship Target="/Metadata/plate_4.png" Id="rel-4" Type="http://schemas.bambulab.com/package/2021/cover-thumbnail-middle"/>
 <Relationship Target="/Metadata/plate_4_small.png" Id="rel-5" Type="http://schemas.bambulab.com/package/2021/cover-thumbnail-small"/>
</Relationships>
  1. using the content of Metadata/_rels/model_settings.config.rels file which give the gcode file path
<?xml version="1.0" encoding="UTF-8"?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
 <Relationship Target="/Metadata/plate_4.gcode" Id="rel-1" Type="http://schemas.bambulab.com/package/2021/gcode"/>
</Relationships>
  1. using the content of Metadata/model_settings.configto find the name of the gcode file and the corresponding thumbnail since the gcode_file key is present only for the correct plate.
...
<plate>
    <metadata key="plater_id" value="4"/>
    <metadata key="plater_name" value=""/>
    <metadata key="locked" value="false"/>
    <metadata key="filament_map_mode" value="Auto For Flush"/>
    <metadata key="filament_maps" value="1 1 1 1 1 1 1"/>
    <metadata key="filament_volume_maps" value="0 0 0 0 0 0 0"/>
    <metadata key="gcode_file" value="Metadata/plate_4.gcode"/>
    <metadata key="thumbnail_file" value="Metadata/plate_4.png"/>
    <metadata key="thumbnail_no_light_file" value="Metadata/plate_no_light_4.png"/>
    <metadata key="top_file" value="Metadata/top_4.png"/>
    <metadata key="pick_file" value="Metadata/pick_4.png"/>
    <metadata key="pattern_bbox_file" value="Metadata/plate_4.json"/>
  </plate>
...
  1. Looking at the files extracted from the archives and find the name of the gcode file, use the same regex match logic to determine the plate number and use the corresponding thumbnail.

My guess is that 4 is the quickest and simplest to implement, particularly if you want to avoid parsing xml.
In case multiple gcode files are found, the same logic of falling back to the first plate as default would be fine.

Expected Behavior

It should display the thumbnail for the plate that is being printed

Steps to Reproduce

  1. launch a print from archive
  2. go to printers page and look at the thumbnail in the printer card and compare it to the thumbnail in archives

Printer Model

P1S

Bambuddy Version

v0.2.4b1 daily

SpoolBuddy Version

No response

Printer Firmware Version

01.10.00.00

Installation Method

Docker

Operating System

Linux (Other)

Relevant Logs / Support Package

bambuddy-support-20260429-133647.zip

Screenshots

No response

Additional Context

No response

Checklist

  • I have searched existing issues to ensure this bug hasn't already been reported
  • I am using the latest version of Bambuddy
  • My printer is set to LAN Only mode
  • My printer has Developer Mode enabled
Originally created by @smandon on GitHub (Apr 29, 2026). Original GitHub issue: https://github.com/maziggy/bambuddy/issues/1166 Originally assigned to: @maziggy on GitHub. ### Component Bambuddy ### Bug Description I often print from multi-plates files where each plate was sent separately to archives, but the 3mf sent by bambu studio includes thumbnails for all plates. When I print such a file from archives, the printer card always shows the embedded image from the first plate as thumbnail, while the thumbnail displayed in archives is correct. From what I found, in `api/routes/printers.py` the `get_printer_cover` function gets the value of gcode_file from the printer via MQTT and uses a regex match to determine the plate number and defaults to plate number 1 if it isn't found. However I can see in my logs that gcode_file contains only the name of the 3mf file, not the path to the gcode file inside the archive, that's why it defaults to the first plate. Maybe it's specific to some printers and/or firmware versions. From what I found analysing some 3mf files, there could be multiple ways to determine the correct plate number/and or thumbnail file from the content of the 3mf file itself: 1. using the content of `_rels/.rels` file which gives the right thumbnail file path ```xml <?xml version="1.0" encoding="UTF-8"?> <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"> <Relationship Target="/3D/3dmodel.model" Id="rel-1" Type="http://schemas.microsoft.com/3dmanufacturing/2013/01/3dmodel"/> <Relationship Target="/Metadata/plate_4.png" Id="rel-2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail"/> <Relationship Target="/Metadata/plate_4.png" Id="rel-4" Type="http://schemas.bambulab.com/package/2021/cover-thumbnail-middle"/> <Relationship Target="/Metadata/plate_4_small.png" Id="rel-5" Type="http://schemas.bambulab.com/package/2021/cover-thumbnail-small"/> </Relationships> ``` 2. using the content of `Metadata/_rels/model_settings.config.rels` file which give the gcode file path ```xml <?xml version="1.0" encoding="UTF-8"?> <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"> <Relationship Target="/Metadata/plate_4.gcode" Id="rel-1" Type="http://schemas.bambulab.com/package/2021/gcode"/> </Relationships> ``` 3. using the content of `Metadata/model_settings.config`to find the name of the gcode file and the corresponding thumbnail since the `gcode_file` key is present only for the correct plate. ```xml ... <plate> <metadata key="plater_id" value="4"/> <metadata key="plater_name" value=""/> <metadata key="locked" value="false"/> <metadata key="filament_map_mode" value="Auto For Flush"/> <metadata key="filament_maps" value="1 1 1 1 1 1 1"/> <metadata key="filament_volume_maps" value="0 0 0 0 0 0 0"/> <metadata key="gcode_file" value="Metadata/plate_4.gcode"/> <metadata key="thumbnail_file" value="Metadata/plate_4.png"/> <metadata key="thumbnail_no_light_file" value="Metadata/plate_no_light_4.png"/> <metadata key="top_file" value="Metadata/top_4.png"/> <metadata key="pick_file" value="Metadata/pick_4.png"/> <metadata key="pattern_bbox_file" value="Metadata/plate_4.json"/> </plate> ... ``` 4. Looking at the files extracted from the archives and find the name of the gcode file, use the same regex match logic to determine the plate number and use the corresponding thumbnail. My guess is that 4 is the quickest and simplest to implement, particularly if you want to avoid parsing xml. In case multiple gcode files are found, the same logic of falling back to the first plate as default would be fine. ### Expected Behavior It should display the thumbnail for the plate that is being printed ### Steps to Reproduce 1. launch a print from archive 2. go to printers page and look at the thumbnail in the printer card and compare it to the thumbnail in archives ### Printer Model P1S ### Bambuddy Version v0.2.4b1 daily ### SpoolBuddy Version _No response_ ### Printer Firmware Version 01.10.00.00 ### Installation Method Docker ### Operating System Linux (Other) ### Relevant Logs / Support Package [bambuddy-support-20260429-133647.zip](https://github.com/user-attachments/files/27201079/bambuddy-support-20260429-133647.zip) ### Screenshots _No response_ ### Additional Context _No response_ ### Checklist - [x] I have searched existing issues to ensure this bug hasn't already been reported - [x] I am using the latest version of Bambuddy - [x] My printer is set to LAN Only mode - [x] My printer has Developer Mode enabled
BreizhHardware 2026-05-06 12:33:21 +02:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@maziggy commented on GitHub (Apr 29, 2026):

Available/Fixed in branch dev and available with the next release or daily build. Please let me know if it works for you.


BTW:

"network_mode_hint": "bridge"

I strongly suggest to change to Docker network mode host - as per documentation.


If you find Bambuddy useful, please consider giving it a on GitHub — it helps others discover the project!

<!-- gh-comment-id:4344872765 --> @maziggy commented on GitHub (Apr 29, 2026): Available/Fixed in branch dev and available with the next release or daily build. Please let me know if it works for you. --- BTW: > "network_mode_hint": "bridge" I strongly suggest to change to Docker network mode host - as per documentation. ----- If you find Bambuddy useful, please consider giving it a ⭐ on [GitHub](https://github.com/maziggy/bambuddy) — it helps others discover the project!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/bambuddy#842
No description provided.