[GH-ISSUE #1164] [Bug]: Bambuddy-Printer-Connection fails after a few filament configs #840

Closed
opened 2026-05-06 12:33:18 +02:00 by BreizhHardware · 14 comments

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

Originally assigned to: @maziggy on GitHub.

Component

Bambuddy

Bug Description

I experienced the issue, that sometimes the filament slot data from bambuddy doesn't reach the printer. This happens fairly often and for me, almost always on the 6th filament change in a row on a printer. After a minute of waiting after that happens, the filament colors on the printer jump around at the different slots for 1-2 seconds, then it stops. This mapping can then be seen in bambuddy too after a short time. In the logs I configured a few slots, had the issue, pressed reconnect, configured a few slots, and had the issue again.

Expected Behavior

The filament config from bambuddy should always reach the printer.

Steps to Reproduce

Configure the slots of an ams 6-8 times

Printer Model

Not printer-related

Bambuddy Version

v0.2.4b1-daily

SpoolBuddy Version

No response

Printer Firmware Version

No response

Installation Method

Docker

Operating System

Linux (Other)

Relevant Logs / Support Package

bambuddy-support-20260429-110759.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 @RosdasHH on GitHub (Apr 29, 2026). Original GitHub issue: https://github.com/maziggy/bambuddy/issues/1164 Originally assigned to: @maziggy on GitHub. ### Component Bambuddy ### Bug Description I experienced the issue, that sometimes the filament slot data from bambuddy doesn't reach the printer. This happens fairly often and for me, almost always on the 6th filament change in a row on a printer. After a minute of waiting after that happens, the filament colors on the printer jump around at the different slots for 1-2 seconds, then it stops. This mapping can then be seen in bambuddy too after a short time. In the logs I configured a few slots, had the issue, pressed reconnect, configured a few slots, and had the issue again. ### Expected Behavior The filament config from bambuddy should always reach the printer. ### Steps to Reproduce Configure the slots of an ams 6-8 times ### Printer Model Not printer-related ### Bambuddy Version v0.2.4b1-daily ### SpoolBuddy Version _No response_ ### Printer Firmware Version _No response_ ### Installation Method Docker ### Operating System Linux (Other) ### Relevant Logs / Support Package [bambuddy-support-20260429-110759.zip](https://github.com/user-attachments/files/27197234/bambuddy-support-20260429-110759.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:18 +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.


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

<!-- gh-comment-id:4343012486 --> @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. ----- If you find Bambuddy useful, please consider giving it a ⭐ on [GitHub](https://github.com/maziggy/bambuddy) — it helps others discover the project!
Author
Owner

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

I just pulled the dev branch and tried it, but unfortunately the problem persists.

bambuddy-support-20260429-125928.zip

<!-- gh-comment-id:4343123819 --> @RosdasHH commented on GitHub (Apr 29, 2026): I just pulled the dev branch and tried it, but unfortunately the problem persists. [bambuddy-support-20260429-125928.zip](https://github.com/user-attachments/files/27199183/bambuddy-support-20260429-125928.zip)
Author
Owner

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

I traced through the logs carefully; the 0.2.4b2 fix is in place and working as intended:

  • The ams_filament_setting unanswered counter reaches count=1 a few times in your session but never escalates to count=2, so no force_reconnect fires. That cascade — which produced the original "colors jump around after a minute" symptom — is gone.

What's still visible is a separate layer of the original report: the printer itself takes 11–19 s to acknowledge some commands when several are sent in rapid succession. Slot 0 published at 12:55:44, for example, was finally acked ~19 s later. Each slot configure publishes three MQTT messages (ams_filament_setting, extrusion_cali_sel, pushall), so 4–6 configures in under 20 s adds up to a couple of dozen messages hitting the printer's broker. Some firmware (P1S 01.09.01.00 in your case) doesn't pipeline that well and queues acks.

That's not something Bambuddy can fix server-side without slowing down workflows that don't have this issue. The right place to handle it is on the API consumer side: wait for the WebSocket AMS update before sending the next configure, or insert a 1–2 s pause between calls. Bambu Handy / Studio do this implicitly because no human can click that fast.

If you're driving these calls programmatically — e.g. from a scan-and-assign workflow like BamScan — that's where I'd add the pacing. Closing this as the underlying watchdog regression is fixed; happy to reopen if you can show a case where Bambuddy itself is dropping the publish (i.e. no MQTT publish line in the log for a configure that the API accepted).

<!-- gh-comment-id:4344398095 --> @maziggy commented on GitHub (Apr 29, 2026): I traced through the logs carefully; the 0.2.4b2 fix is in place and working as intended: - The ams_filament_setting unanswered counter reaches count=1 a few times in your session but never escalates to count=2, so no force_reconnect fires. That cascade — which produced the original "colors jump around after a minute" symptom — is gone. What's still visible is a separate layer of the original report: the printer itself takes 11–19 s to acknowledge some commands when several are sent in rapid succession. Slot 0 published at 12:55:44, for example, was finally acked ~19 s later. Each slot configure publishes three MQTT messages (ams_filament_setting, extrusion_cali_sel, pushall), so 4–6 configures in under 20 s adds up to a couple of dozen messages hitting the printer's broker. Some firmware (P1S 01.09.01.00 in your case) doesn't pipeline that well and queues acks. That's not something Bambuddy can fix server-side without slowing down workflows that don't have this issue. The right place to handle it is on the API consumer side: wait for the WebSocket AMS update before sending the next configure, or insert a 1–2 s pause between calls. Bambu Handy / Studio do this implicitly because no human can click that fast. If you're driving these calls programmatically — e.g. from a scan-and-assign workflow like BamScan — that's where I'd add the pacing. Closing this as the underlying watchdog regression is fixed; happy to reopen if you can show a case where Bambuddy itself is dropping the publish (i.e. no MQTT publish line in the log for a configure that the API accepted).
Author
Owner

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

I repeated the test with 10-second intervals between AMS slot configurations. I kept Orca Slicer open alongside Bambuddy to directly compare state updates.

I changed one slot via Bambuddy, waited 10 seconds, then configured the next one, and so on. After the 4th successful change, none of the subsequent configurations were shown in Orca Slicer anymore.

After a few minutes, all previously sent configurations were then applied in rapid succession, causing the filament states in Orca to cycle quickly through each intermediate state until finally reaching the last configuration.

This behavior occurs even with a 10-second delay between requests. During the same interval, I can perform identical configuration changes directly in Orca Slicer without any issues, and they are reflected in Bambuddy. This makes me think that the request rate is not the underlying problem.

Additionally, after the 4th change, Bambuddy appears to enter a state where further configuration changes are no longer processed until the printer is reconnected. In this state, Orca Slicer continues to function normally and its changes are still accepted by the printer and reflected back in Bambuddy, but the reverse path (Bambuddy → printer → Orca) is effectively stalled.

It is the exact same behavior that we've had here: #887, but not because of long idle times.
And none of the tests before were made through any automation. They were both made through the bambuddy ui.
Since Orca Slicer continues to work normally with new filament configs, the issue seems to be specific to the Bambuddy -> printer update rather than the printer itself.

At the end of the logs (From 2026-04-29 18:07:04,219 to the end), I successfully configured 4 times, with a 10 to 13sec delay between the configs through the bambuddy ui, but the 5th one didn't make it through. I've waited a few minutes, but it didn't arrive.

bambuddy-support-20260429-181319.zip

<!-- gh-comment-id:4345563778 --> @RosdasHH commented on GitHub (Apr 29, 2026): I repeated the test with 10-second intervals between AMS slot configurations. I kept Orca Slicer open alongside Bambuddy to directly compare state updates. I changed one slot via Bambuddy, waited 10 seconds, then configured the next one, and so on. After the 4th successful change, none of the subsequent configurations were shown in Orca Slicer anymore. After a few minutes, all previously sent configurations were then applied in rapid succession, causing the filament states in Orca to cycle quickly through each intermediate state until finally reaching the last configuration. This behavior occurs even with a 10-second delay between requests. During the same interval, I can perform identical configuration changes directly in Orca Slicer without any issues, and they are reflected in Bambuddy. This makes me think that the request rate is not the underlying problem. Additionally, after the 4th change, Bambuddy appears to enter a state where further configuration changes are no longer processed until the printer is reconnected. In this state, Orca Slicer continues to function normally and its changes are still accepted by the printer and reflected back in Bambuddy, but the reverse path (Bambuddy → printer → Orca) is effectively stalled. It is the exact same behavior that we've had here: #887, but not because of long idle times. And none of the tests before were made through any automation. They were both made through the bambuddy ui. Since Orca Slicer continues to work normally with new filament configs, the issue seems to be specific to the Bambuddy -> printer update rather than the printer itself. At the end of the logs (From 2026-04-29 18:07:04,219 to the end), I successfully configured 4 times, with a 10 to 13sec delay between the configs through the bambuddy ui, but the 5th one didn't make it through. I've waited a few minutes, but it didn't arrive. [bambuddy-support-20260429-181319.zip](https://github.com/user-attachments/files/27209513/bambuddy-support-20260429-181319.zip)
Author
Owner

@maziggy commented on GitHub (May 1, 2026):

Traced through it line by line; here's what I see.

The 0.2.4b2 fix is doing its job. In this session the unanswered counter reaches count=1 once (18:08:25) and never escalates to count=2, so no force_reconnect fires. The cascade that produced your original "colors jump around after a minute" symptom is gone.

What's left is firmware-side. Your 5 configures at 13–15 s spacing: configures 1–4 get acked in 17 ms – 0.6 s, configure 5 is published successfully but the printer simply never acks it. MQTT stays alive (push_status keeps streaming the whole time), so it's not a connection problem — the printer just stopped processing that command. Your earlier observation that the queue "flushes in rapid succession after a few minutes" is the right read: P1S 01.09.01.00 is queuing, not discarding. The Orca comparison doesn't translate to a Bambuddy fix because Studio/Orca are driven by a human clicking through a dialog — they implicitly wait for the printer to settle between commands. An API consumer firing configures back-to-back doesn't have that natural pause, and even at 13 s the firmware queue fills up.

On the API side. Since you're driving these from your own app rather than the Bambuddy UI, the right place to handle the pacing is there. Two approaches that work in practice:

  • Wait for the WebSocket AMS state update confirming your previous configure landed before sending the next, or
  • Simpler: insert a ~30 s gap between configures and the firmware queue stays empty.

Closing this one — the regression watchdog fix is in, and the remaining behaviour isn't something Bambuddy can patch without slowing down workflows that don't have this issue. Happy to reopen if you can show a case where Bambuddy itself drops a publish (API accepts it but no Publishing ams_filament_setting line in the log) or the unanswered watchdog mis-fires again.

<!-- gh-comment-id:4358025308 --> @maziggy commented on GitHub (May 1, 2026): Traced through it line by line; here's what I see. The 0.2.4b2 fix is doing its job. In this session the unanswered counter reaches count=1 once (18:08:25) and never escalates to count=2, so no force_reconnect fires. The cascade that produced your original "colors jump around after a minute" symptom is gone. What's left is firmware-side. Your 5 configures at 13–15 s spacing: configures 1–4 get acked in 17 ms – 0.6 s, configure 5 is published successfully but the printer simply never acks it. MQTT stays alive (push_status keeps streaming the whole time), so it's not a connection problem — the printer just stopped processing that command. Your earlier observation that the queue "flushes in rapid succession after a few minutes" is the right read: P1S 01.09.01.00 is queuing, not discarding. The Orca comparison doesn't translate to a Bambuddy fix because Studio/Orca are driven by a human clicking through a dialog — they implicitly wait for the printer to settle between commands. An API consumer firing configures back-to-back doesn't have that natural pause, and even at 13 s the firmware queue fills up. On the API side. Since you're driving these from your own app rather than the Bambuddy UI, the right place to handle the pacing is there. Two approaches that work in practice: - Wait for the WebSocket AMS state update confirming your previous configure landed before sending the next, or - Simpler: insert a ~30 s gap between configures and the firmware queue stays empty. Closing this one — the regression watchdog fix is in, and the remaining behaviour isn't something Bambuddy can patch without slowing down workflows that don't have this issue. Happy to reopen if you can show a case where Bambuddy itself drops a publish (API accepts it but no Publishing ams_filament_setting line in the log) or the unanswered watchdog mis-fires again.
Author
Owner

@RosdasHH commented on GitHub (May 1, 2026):

Sorry, the unanswered counter reaches count=2. I just downloaded the logs too fast, so that was not in it anymore.
All tests were made independent from BamScan or any other api service. It is all directly made through the Bambuddy UI.

The problem occurs independent from the bypassed time. I can configure 4x in the morning and 2x in the evening where the first config in the evening doesn't get applied and the second fires a reconnect, because the unanswered counter reaches count=2.

I tested the same (again manually, through the bambuddy UI) with 10min between the configs (which should be overkill in my opinion, and enough time for the printers queue to empty), but after config 4 (40min), the problem was there again. When trying to configure the next one, the config modal loads longer than usual (probably due to the K-profile timeout "Failed to get K-profiles after 3 attempts"), and my selected config is not applied. As soon as I try to configure another one, after the one that didn't work, the unanswered count goes up to 2 and mqtt reconnects: "Forcing MQTT reconnect: ams_filament_setting unanswered 2×".

Tested on a Linux Docker installation and Windows dev branch respectively with P1S and a1 Mini, same results everywhere.

I know that Bambuddy seems to send the config to the printer but from my perspective anywhere has to be a problem. That was what I wanted to point out with the Orca Slicer comparison, that I can click me through the dialogs there and configure the slots as much as I want, without running into this problem. But when I do the same through the Bambuddy UI (even with long times between) I run into the issue. So there I also have the "natural pause" you mentioned.

The same problem also occurs with assigning spools, but there are more slot changes required to run into this issue.

A third person also confirms that it happened to him as well, so it is not based on my installation or printers.

Would you be able to try to reproduce this on your setup?

Here is the log with manual configs (through the bambuddy UI), and a delay of ~10min between them. So it should show that it is happening independent from the bypassed time:

bambuddy-support-20260501-161335.zip

<!-- gh-comment-id:4360686523 --> @RosdasHH commented on GitHub (May 1, 2026): Sorry, the unanswered counter reaches count=2. I just downloaded the logs too fast, so that was not in it anymore. All tests were made independent from BamScan or any other api service. It is all directly made through the Bambuddy UI. The problem occurs independent from the bypassed time. I can configure 4x in the morning and 2x in the evening where the first config in the evening doesn't get applied and the second fires a reconnect, because the unanswered counter reaches count=2. I tested the same (again manually, through the bambuddy UI) with 10min between the configs (which should be overkill in my opinion, and enough time for the printers queue to empty), but after config 4 (40min), the problem was there again. When trying to configure the next one, the config modal loads longer than usual (probably due to the K-profile timeout "Failed to get K-profiles after 3 attempts"), and my selected config is not applied. As soon as I try to configure another one, after the one that didn't work, the unanswered count goes up to 2 and mqtt reconnects: "Forcing MQTT reconnect: ams_filament_setting unanswered 2×". Tested on a Linux Docker installation and Windows dev branch respectively with P1S and a1 Mini, same results everywhere. I know that Bambuddy seems to send the config to the printer but from my perspective anywhere has to be a problem. That was what I wanted to point out with the Orca Slicer comparison, that I can click me through the dialogs there and configure the slots as much as I want, without running into this problem. But when I do the same through the Bambuddy UI (even with long times between) I run into the issue. So there I also have the "natural pause" you mentioned. The same problem also occurs with assigning spools, but there are more slot changes required to run into this issue. A third person also confirms that it happened to him as well, so it is not based on my installation or printers. Would you be able to try to reproduce this on your setup? Here is the log with manual configs (through the bambuddy UI), and a delay of ~10min between them. So it should show that it is happening independent from the bypassed time: [bambuddy-support-20260501-161335.zip](https://github.com/user-attachments/files/27282509/bambuddy-support-20260501-161335.zip)
Author
Owner

@maziggy commented on GitHub (May 2, 2026):

You're right and my earlier close was wrong on the substance. Apologies for the runaround. Reopening.

Two things in this bundle I missed before:

  1. The watchdog DID escalate to count=2 in this run (count=1 at 15:53:14, count=2 at 16:03:53 -> Forcing MQTT reconnect). So the 0.2.4b2 fix is firing as designed; force_reconnect heals the wedge. But it costs one "wasted" config attempt to trigger, which matches your "first config silently dropped, second triggers reconnect" observation exactly.

  2. More importantly, the wedge isn't ams_filament_setting-specific. Right before config 6, your K-profile fetch also timed out 3x ("Failed to get K-profiles after 3 attempts" at 16:03:18) into the same dead channel — different command, proper incrementing sequence_id, same result. So the wedge is the publish/response path itself, not anything about the AMS command shape or pacing.

The flood-on-reconnect is the giveaway: when force_reconnect fires at 16:03:53, the printer dumps every pending response within 5 seconds, including responses to commands sent ~10 minutes earlier. So the printer did process them; the path back to us was blocked until the MQTT session reset. That also rules out my earlier firmware-queue-saturation theory — 10 minutes between configs is plenty of time for any reasonable queue to drain.

Two near-term improvements I can ship while I hunt the root cause:

  1. Drop the AMS-watchdog threshold from count=2 to count=1, so the FIRST stuck publish triggers force_reconnect — no wasted user action.
  2. After a force_reconnect triggered by an unanswered configure, replay the failed command on the fresh session automatically, so your intent isn't dropped on the floor.

Going to try to reproduce on my own P1S over the next sessions. Two questions to help narrow it down:

  • Does it always wedge around the 5th change in a fresh Bambuddy session, or does the count drift (e.g. 4-7)?
  • Does the wedge happen on slot configures only, or also on spool assignments alone? (Your message hints both — just confirming.)

Thanks for the careful repro and the patience.

<!-- gh-comment-id:4363053658 --> @maziggy commented on GitHub (May 2, 2026): You're right and my earlier close was wrong on the substance. Apologies for the runaround. Reopening. Two things in this bundle I missed before: 1. The watchdog DID escalate to count=2 in this run (count=1 at 15:53:14, count=2 at 16:03:53 -> Forcing MQTT reconnect). So the 0.2.4b2 fix is firing as designed; force_reconnect heals the wedge. But it costs one "wasted" config attempt to trigger, which matches your "first config silently dropped, second triggers reconnect" observation exactly. 2. More importantly, the wedge isn't ams_filament_setting-specific. Right before config 6, your K-profile fetch also timed out 3x ("Failed to get K-profiles after 3 attempts" at 16:03:18) into the same dead channel — different command, proper incrementing sequence_id, same result. So the wedge is the publish/response path itself, not anything about the AMS command shape or pacing. The flood-on-reconnect is the giveaway: when force_reconnect fires at 16:03:53, the printer dumps every pending response within 5 seconds, including responses to commands sent ~10 minutes earlier. So the printer did process them; the path back to us was blocked until the MQTT session reset. That also rules out my earlier firmware-queue-saturation theory — 10 minutes between configs is plenty of time for any reasonable queue to drain. Two near-term improvements I can ship while I hunt the root cause: 1. Drop the AMS-watchdog threshold from count=2 to count=1, so the FIRST stuck publish triggers force_reconnect — no wasted user action. 2. After a force_reconnect triggered by an unanswered configure, replay the failed command on the fresh session automatically, so your intent isn't dropped on the floor. Going to try to reproduce on my own P1S over the next sessions. Two questions to help narrow it down: - Does it always wedge around the 5th change in a fresh Bambuddy session, or does the count drift (e.g. 4-7)? - Does the wedge happen on slot configures only, or also on spool assignments alone? (Your message hints both — just confirming.) Thanks for the careful repro and the patience.
Author
Owner

@RosdasHH commented on GitHub (May 2, 2026):

  1. Today, out of 10 attempts, I was able to configure successfully 5 times; the 6th attempt didn’t go through, and the 7th triggered a reconnect. Yesterday, I was only able to configure 4 times, so there seems to be some drift.

  2. I tried the spool assignments again. I am able to change the spool 16x before nothing comes through anymore. (2 tries, both came to 16)

The spool assignments and slot configs seem to correlate in some way, because if I change the spool assignments 8x, I get the problem after the third config. If I assign a spool 12x, I have only one successful config left.

Sometimes when I change, for example, the third slot to red, both the first and the third slot briefly turn red (Don't know if it is the first slot everytime, but had this just now). However, after about half a second, the first slot reverts to its original color.

Thanks for looking into this.

<!-- gh-comment-id:4363571866 --> @RosdasHH commented on GitHub (May 2, 2026): 1. Today, out of 10 attempts, I was able to configure successfully 5 times; the 6th attempt didn’t go through, and the 7th triggered a reconnect. Yesterday, I was only able to configure 4 times, so there seems to be some drift. 2. I tried the spool assignments again. I am able to change the spool 16x before nothing comes through anymore. (2 tries, both came to 16) The spool assignments and slot configs seem to correlate in some way, because if I change the spool assignments 8x, I get the problem after the third config. If I assign a spool 12x, I have only one successful config left. Sometimes when I change, for example, the third slot to red, both the first and the third slot briefly turn red (Don't know if it is the first slot everytime, but had this just now). However, after about half a second, the first slot reverts to its original color. Thanks for looking into this.
Author
Owner

@maziggy commented on GitHub (May 2, 2026):

Thanks for the patient testing — your data clearly characterizes the problem and rules out everything that's actionable on Bambuddy's side.

What's confirmed:

  1. The wedge is session-cumulative — slot configs and spool assignments share the same firmware-side counter (your 8+3, 12+1, 16+0 patterns make that exact). A ring buffer in the P1S firmware's MQTT response handler fills up regardless of pacing — your 10-minute-spacing test still wedged after 4 commands, which rules out request rate.
  2. It's not AMS-specific — the K-profile fetch dies into the same dead channel before configure 6 in your earlier bundle. So the wedge is the publish/response path, not anything about the command shape.
  3. Bambuddy's watchdog (0.2.4b2) does heal it — when it escalates to count=2, force_reconnect fires, the printer dumps all queued responses within 5 seconds, and the next command works. The cost is one wasted config attempt to trigger.
  4. BamScan is not a competing MQTT client — I had a look at the source. It's HTTP-only against Bambuddy's REST API; no direct printer connection. But each POST /inventory/assignments it makes does turn into one MQTT command on the printer, so BamScan and the Bambuddy UI share the same per-session command budget. If you've used BamScan earlier in the day, those assignments count toward the same firmware-side counter that wedges later when you configure slots in the UI. The auto-heal catches it either way; it just explains why your "first config of the evening" sometimes drops silently — the budget was partly consumed earlier.

Where this can actually be fixed: the printer firmware. Bambuddy can only paper over the symptom from outside. I considered tightening the watchdog from count=2 to count=1 (you'd lose zero commands instead of one), but legitimate slow ACKs on big config bursts can take 10–15 s to come back, and a count=1 trigger would loop into spurious reconnects on healthy sessions. The current count=2 is the right balance for the average user; what you're seeing is the tradeoff at the pathological end.

I'm going to close this since the auto-heal is the practical fix and there's no further bambuddy-side improvement that doesn't trade one user's experience for another's. If you want to pursue this with Bambu Lab — they're the ones who can fix the firmware queue — point them at:

  • P1S firmware 01.09.01.00
  • After ~4–16 cumulative MQTT commands (mix of ams_filament_setting, extrusion_cali_get, request_kvalue etc.), the printer accepts new commands but stops emitting command response on the report topic. MQTT session itself stays healthy (push_status keeps streaming).
  • Resetting the MQTT session triggers a flood of all queued responses within ~5 seconds, confirming the printer processed them; only the response path was wedged.

Thanks again for the thorough repros — bug reports this well-instrumented are rare.

<!-- gh-comment-id:4363609911 --> @maziggy commented on GitHub (May 2, 2026): Thanks for the patient testing — your data clearly characterizes the problem and rules out everything that's actionable on Bambuddy's side. What's confirmed: 1. The wedge is session-cumulative — slot configs and spool assignments share the same firmware-side counter (your 8+3, 12+1, 16+0 patterns make that exact). A ring buffer in the P1S firmware's MQTT response handler fills up regardless of pacing — your 10-minute-spacing test still wedged after 4 commands, which rules out request rate. 2. It's not AMS-specific — the K-profile fetch dies into the same dead channel before configure 6 in your earlier bundle. So the wedge is the publish/response path, not anything about the command shape. 3. Bambuddy's watchdog (0.2.4b2) does heal it — when it escalates to count=2, force_reconnect fires, the printer dumps all queued responses within 5 seconds, and the next command works. The cost is one wasted config attempt to trigger. 4. BamScan is not a competing MQTT client — I had a look at the source. It's HTTP-only against Bambuddy's REST API; no direct printer connection. But each POST /inventory/assignments it makes does turn into one MQTT command on the printer, so BamScan and the Bambuddy UI share the same per-session command budget. If you've used BamScan earlier in the day, those assignments count toward the same firmware-side counter that wedges later when you configure slots in the UI. The auto-heal catches it either way; it just explains why your "first config of the evening" sometimes drops silently — the budget was partly consumed earlier. Where this can actually be fixed: the printer firmware. Bambuddy can only paper over the symptom from outside. I considered tightening the watchdog from count=2 to count=1 (you'd lose zero commands instead of one), but legitimate slow ACKs on big config bursts can take 10–15 s to come back, and a count=1 trigger would loop into spurious reconnects on healthy sessions. The current count=2 is the right balance for the average user; what you're seeing is the tradeoff at the pathological end. I'm going to close this since the auto-heal is the practical fix and there's no further bambuddy-side improvement that doesn't trade one user's experience for another's. If you want to pursue this with Bambu Lab — they're the ones who can fix the firmware queue — point them at: - P1S firmware 01.09.01.00 - After ~4–16 cumulative MQTT commands (mix of ams_filament_setting, extrusion_cali_get, request_kvalue etc.), the printer accepts new commands but stops emitting command response on the report topic. MQTT session itself stays healthy (push_status keeps streaming). - Resetting the MQTT session triggers a flood of all queued responses within ~5 seconds, confirming the printer processed them; only the response path was wedged. Thanks again for the thorough repros — bug reports this well-instrumented are rare.
Author
Owner

@RosdasHH commented on GitHub (May 2, 2026):

I found out that the problem does not occurr at all with qos=0 or qos=2 in the bambu_mqtt.py, only with qos=1 it happens.

<!-- gh-comment-id:4363781446 --> @RosdasHH commented on GitHub (May 2, 2026): I found out that the problem does not occurr at all with qos=0 or qos=2 in the bambu_mqtt.py, only with qos=1 it happens.
Author
Owner

@RosdasHH commented on GitHub (May 2, 2026):

Qos 1 - at least once delivery (Resends package if not delivered)

Maybe there is an issue with the acknowledgement of the sent packet, causing it to be resent because bambuddy assumes the message has not been delivered. This could then lead to messages accumulating over time until the printer eventually stop accepting new packets? Would be my guess.

I don't think this is a firmware issue of the printer, because our slicers don't have that problem, and a quick python test didn't had this either.

<!-- gh-comment-id:4363927301 --> @RosdasHH commented on GitHub (May 2, 2026): Qos 1 - at least once delivery (Resends package if not delivered) Maybe there is an issue with the acknowledgement of the sent packet, causing it to be resent because bambuddy assumes the message has not been delivered. This could then lead to messages accumulating over time until the printer eventually stop accepting new packets? Would be my guess. I don't think this is a firmware issue of the printer, because our slicers don't have that problem, and a quick python test didn't had this either.
Author
Owner

@maziggy commented on GitHub (May 2, 2026):

Now that's a catch! 💯

Your QoS=1 vs QoS=0 vs QoS=2 bisect is the actual signal: the wedge isn't in the printer firmware, it's in paho-mqtt's QoS=1 inflight queue. Default ceiling is 20 messages; on Bambu's non-standard broker the PUBACK matching is racy, so paho's inflight slots don't all get freed, the queue silently fills up, and after ~16-20 commands publish() returns success but the packet just sits in paho's internal queue. force_reconnect heals it because the inflight queue is per-session.

I don't want to switch QoS globally — we spent weeks getting QoS=1 working reliably across all printer models (A1, P1S, X1C, H2D, P2S, X2D, ...) and that wasn't arbitrary. But your bisect points at the right spot: lifting paho's inflight ceiling solves it without touching wire-protocol behaviour. I've pushed max_inflight_messages_set(1000) to dev — that's well above any realistic session command count.

Could you pull the latest dev image and run your repro again? Specifically: configure 30+ slots / spool assignments in a session and see if the wedge still fires. If yes, the diagnosis is incomplete and I'll dig further. If no, we have the fix and the watchdog reconnect from 0.2.4b2 just becomes defence-in-depth.

Thanks for the careful bisect — without the QoS test we'd still be looking in the wrong place.

<!-- gh-comment-id:4363999943 --> @maziggy commented on GitHub (May 2, 2026): Now that's a catch! 💯 Your QoS=1 vs QoS=0 vs QoS=2 bisect is the actual signal: the wedge isn't in the printer firmware, it's in paho-mqtt's QoS=1 inflight queue. Default ceiling is 20 messages; on Bambu's non-standard broker the PUBACK matching is racy, so paho's inflight slots don't all get freed, the queue silently fills up, and after ~16-20 commands `publish()` returns success but the packet just sits in paho's internal queue. force_reconnect heals it because the inflight queue is per-session. I don't want to switch QoS globally — we spent weeks getting QoS=1 working reliably across all printer models (A1, P1S, X1C, H2D, P2S, X2D, ...) and that wasn't arbitrary. But your bisect points at the right spot: lifting paho's inflight ceiling solves it without touching wire-protocol behaviour. I've pushed `max_inflight_messages_set(1000)` to dev — that's well above any realistic session command count. Could you pull the latest dev image and run your repro again? Specifically: configure 30+ slots / spool assignments in a session and see if the wedge still fires. If yes, the diagnosis is incomplete and I'll dig further. If no, we have the fix and the watchdog reconnect from 0.2.4b2 just becomes defence-in-depth. Thanks for the careful bisect — without the QoS test we'd still be looking in the wrong place.
Author
Owner

@RosdasHH commented on GitHub (May 2, 2026):

96 configs - No problem
I think thats it! 🎊🎉

<!-- gh-comment-id:4364050258 --> @RosdasHH commented on GitHub (May 2, 2026): 96 configs - No problem I think thats it! 🎊🎉
Author
Owner

@maziggy commented on GitHub (May 2, 2026):

Yeah!

<!-- gh-comment-id:4364056353 --> @maziggy commented on GitHub (May 2, 2026): Yeah!
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#840
No description provided.