mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-05-09 08:25:54 +02:00
[GH-ISSUE #1136] [Bug]: Printing from archive makes references to wrong 3mf file in mqtt, causing MicroSD Read/Write exceptions #815
Labels
No labels
A1
automated
automated
bug
bug
Closed due to inactivity
contrib
dependencies
dependencies
duplicate
enhancement
feedback
hold
invalid
Notes
P1S
pull-request
security
ThumbsUp
user-report
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/bambuddy-maziggy-1#815
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @smandon on GitHub (Apr 26, 2026).
Original GitHub issue: https://github.com/maziggy/bambuddy/issues/1136
Originally assigned to: @maziggy on GitHub.
Component
Bambuddy
Bug Description
I have an issue sometimes when trying to print from archives. After the file is sent to the printer the print never starts and I immediately get MicroSD Read/Write exception errors (0500-4003). The SD card isn't the issue as I tested with multiple cards and they all work perfectly fine when printing directly to the printer from bambu studio.
After looking at the debug logs, I can see references to a different 3mf file in mqtt's "gcode_state" lines, in particular the "gcode_file" just before the error occurs. The file referenced is part of a different unrelated archive.
When it starts happening the error always appears whatever I try to print. It works again normally if I restart the container.
Expected Behavior
The print should start normally when printing from archives.
Steps to Reproduce
Printer Model
P1S
Bambuddy Version
0.2.3.2
SpoolBuddy Version
No response
Printer Firmware Version
No response
Installation Method
Docker
Operating System
Linux (Other)
Relevant Logs / Support Package
bambuddy-support-20260426-133312.zip
Screenshots
No response
Additional Context
The original filename used when I logged is Cable_Organiser_Cable_Clip.3mf, which is correctly used when sending via FTP and when sending the mqtt print command. I can also confirm the file is written on the SD card. But later in the logs mqtt communications make references to a different file named "WARIO_Wall_decor_-_NO_AMS.3mf" which is from a different archive.
Checklist
@maziggy commented on GitHub (Apr 26, 2026):
Firmware version?
@smandon commented on GitHub (Apr 26, 2026):
It the latest for the P1S: 01.10.00.00
@maziggy commented on GitHub (Apr 26, 2026):
FIrst of all I would strongly suggest to switch to Docker network mode host - as per the docs.
Confirmed root cause from your support package — paho-mqtt's client-side QoS 1 queue. When the printer's command channel goes half-broken, Bambuddy's 15s dispatch deadline expires and it force-closes the socket to trigger paho's auto-reconnect. But same client instance, same client_id, same QoS 1 queue — so the project_file for your new archive plus any stale project_file/resume/stop from previous stuck dispatches all replay together on the next connection. Printer latches onto whichever stale path it processes last, can't find the file on its SD card, and emits 0500_4003. Container restart is the only thing that wipes paho's in-process queue, which is why that's been the only fix.
Fix is to do a full paho client teardown on stale reconnect (DISCONNECT + loop_stop + fresh mqtt.Client with new client_id) instead of just closing the socket.
Available/Fixed in branch dev and available with the next release or daily build. Please let me know if it works for you now.
If you find Bambuddy useful, please consider giving it a ⭐ on GitHub — it helps others discover the project!
@smandon commented on GitHub (Apr 26, 2026):
I can't use the host mode because of port already used, instead I'm using a macvlan network.
Thanks, I'll try a daily build.