1
0
Fork 0
mirror of https://github.com/maziggy/bambuddy.git synced 2026-05-09 08:25:54 +02:00

[GH-ISSUE #813] [Bug]: Status showing Printing when printer is Idle #545

Closed
opened 2026-05-07 00:11:27 +02:00 by BreizhHardware · 13 comments

Originally created by @inkdawgz on GitHub (Mar 25, 2026).
Original GitHub issue: https://github.com/maziggy/bambuddy/issues/813

Originally assigned to: @maziggy on GitHub.

Bug Description

Just a little confusing when the status shows "Printing" when it show say "Idle" instead

Expected Behavior

Change Status when idle from Printing to Idle

Steps to Reproduce

no steps to reproduce check screen shot

Printer Model

P1S

Bambuddy Version

v0.2.2.1

Printer Firmware Version

01.09.01.00

Installation Method

Other

Operating System

Linux (Ubuntu/Debian)

Relevant Logs / Support Package

No response

Screenshots

Image

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 @inkdawgz on GitHub (Mar 25, 2026). Original GitHub issue: https://github.com/maziggy/bambuddy/issues/813 Originally assigned to: @maziggy on GitHub. ### Bug Description Just a little confusing when the status shows "Printing" when it show say "Idle" instead ### Expected Behavior Change Status when idle from Printing to Idle ### Steps to Reproduce no steps to reproduce check screen shot ### Printer Model P1S ### Bambuddy Version v0.2.2.1 ### Printer Firmware Version 01.09.01.00 ### Installation Method Other ### Operating System Linux (Ubuntu/Debian) ### Relevant Logs / Support Package _No response_ ### Screenshots <img width="1020" height="552" alt="Image" src="https://github.com/user-attachments/assets/4645ce88-1749-40ce-98f3-295bf999c6b4" /> ### 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-07 00:11:27 +02:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@maziggy commented on GitHub (Mar 25, 2026):

If the state is not correct, then there's a problem with your printer connection.

Please upload a support package -> https://wiki.bambuddy.cool/features/system-info/?h=debug#enable-debug-logging

<!-- gh-comment-id:4127160299 --> @maziggy commented on GitHub (Mar 25, 2026): If the state is not correct, then there's a problem with your printer connection. Please upload a support package -> https://wiki.bambuddy.cool/features/system-info/?h=debug#enable-debug-logging
Author
Owner

@inkdawgz commented on GitHub (Mar 25, 2026):

I highly doubt that since I have tried it on several different dockers/source install, etc.

It is all the same thing and there is no problem with the connection, it prints without fail and only time the status changes is when finished, they never show idle except in the system pages, the only place it shows idle

Image

bambuddy-support-20260325-095200.zip

<!-- gh-comment-id:4127261802 --> @inkdawgz commented on GitHub (Mar 25, 2026): I highly doubt that since I have tried it on several different dockers/source install, etc. It is all the same thing and there is no problem with the connection, it prints without fail and only time the status changes is when finished, they never show idle except in the system pages, the only place it shows idle <img width="1557" height="303" alt="Image" src="https://github.com/user-attachments/assets/5f6125a2-a1c8-4f4d-b43a-da8fb916bdc4" /> [bambuddy-support-20260325-095200.zip](https://github.com/user-attachments/files/26246941/bambuddy-support-20260325-095200.zip)
Author
Owner

@maziggy commented on GitHub (Mar 25, 2026):

That's the problem

2026-03-24 19:39:57,328 WARNING [backend.app.services.background_dispatch] Printer [PRINTER] (3) did not respond to print command within 15s (state still IDLE) — printer may need restart
2026-03-24 19:41:14,481 WARNING [backend.app.services.bambu_mqtt] SERIAL Connection stale - no message for 85.0s

the MQTT connection to the printer is stale.

Let me check the rest of the logs.....

<!-- gh-comment-id:4127316161 --> @maziggy commented on GitHub (Mar 25, 2026): That's the problem >2026-03-24 19:39:57,328 WARNING [backend.app.services.background_dispatch] Printer [PRINTER] (3) did not respond to print command within 15s (state still IDLE) — printer may need restart >2026-03-24 19:41:14,481 WARNING [backend.app.services.bambu_mqtt] [[SERIAL]] Connection stale - no message for 85.0s the MQTT connection to the printer is stale. Let me check the rest of the logs.....
Author
Owner

@inkdawgz commented on GitHub (Mar 25, 2026):

that stale was from last night, i have since then deleted and readded printers

Even readded all 3 printers just now, same status as before

<!-- gh-comment-id:4127442520 --> @inkdawgz commented on GitHub (Mar 25, 2026): that stale was from last night, i have since then deleted and readded printers Even readded all 3 printers just now, same status as before
Author
Owner

@maziggy commented on GitHub (Mar 25, 2026):

Looking at the logs, the MQTT connection to printer 3 went stale around 19:39 (no messages for 85 seconds). After that, every print command sent to that printer was silently ignored — the commands were published but the printer never acted on them. The K-profile requests also timed out, confirming the printer's MQTT broker was not processing incoming commands despite the connection appearing alive.

I found two bugs in how we handle this:

  1. Spurious disconnect filter was too aggressive — We had a safety filter to ignore false disconnect callbacks from the MQTT library, but the 30-second window was wider than the keepalive timeout (~22.5s), meaning real disconnects could be silently swallowed.
  2. No active reconnect on stale detection — When we detected the connection was stale (60s with no messages), we marked it as disconnected in the UI but didn't actually close the TCP socket. The MQTT library's auto-reconnect never kicked in because it didn't know the socket was dead.

Both are fixed now. The stale detector now force-closes the socket so the MQTT library detects the break and reconnects automatically, and we no longer suppress real error disconnects (keepalive timeout, connection lost, etc.).

That said — the printer initially ignoring the print command (before the stale detection) looks like a P1S firmware issue where the MQTT command handler becomes unresponsive. The Bambuddy fix ensures we recover from this state automatically instead of staying stuck.

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:4127451076 --> @maziggy commented on GitHub (Mar 25, 2026): Looking at the logs, the MQTT connection to printer 3 went stale around 19:39 (no messages for 85 seconds). After that, every print command sent to that printer was silently ignored — the commands were published but the printer never acted on them. The K-profile requests also timed out, confirming the printer's MQTT broker was not processing incoming commands despite the connection appearing alive. I found two bugs in how we handle this: 1. Spurious disconnect filter was too aggressive — We had a safety filter to ignore false disconnect callbacks from the MQTT library, but the 30-second window was wider than the keepalive timeout (~22.5s), meaning real disconnects could be silently swallowed. 2. No active reconnect on stale detection — When we detected the connection was stale (60s with no messages), we marked it as disconnected in the UI but didn't actually close the TCP socket. The MQTT library's auto-reconnect never kicked in because it didn't know the socket was dead. Both are fixed now. The stale detector now force-closes the socket so the MQTT library detects the break and reconnects automatically, and we no longer suppress real error disconnects (keepalive timeout, connection lost, etc.). That said — the printer initially ignoring the print command (before the stale detection) looks like a P1S firmware issue where the MQTT command handler becomes unresponsive. The Bambuddy fix ensures we recover from this state automatically instead of staying stuck. 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

@inkdawgz commented on GitHub (Mar 25, 2026):

reinstalled with dev (with your fix), still showing printing instead of idle

bambuddy-support-20260325-111337.zip

Image
<!-- gh-comment-id:4127894927 --> @inkdawgz commented on GitHub (Mar 25, 2026): reinstalled with dev (with your fix), still showing printing instead of idle [bambuddy-support-20260325-111337.zip](https://github.com/user-attachments/files/26248956/bambuddy-support-20260325-111337.zip) <img width="537" height="654" alt="Image" src="https://github.com/user-attachments/assets/e0be1d74-d520-4e05-ba61-29c67c909d11" />
Author
Owner

@maziggy commented on GitHub (Mar 25, 2026):

Looks good, the MQTT connection is no longer stale. Logs are all clear, I cannot see any errors.

So, we have 3 printers with same model and firmware running. Some of them showing correct and some not.

This is not Bambuddy. Something weird is going on. Did you

  • power cycled the printer in question?
  • do you see any errors on printer display or in HMS?
  • Cache problem? Did you forced a reload of ther page - or better - open Bambuddy in an incognito window

As of now I have no other ideas, sorry.

<!-- gh-comment-id:4127953739 --> @maziggy commented on GitHub (Mar 25, 2026): Looks good, the MQTT connection is no longer stale. Logs are all clear, I cannot see any errors. So, we have 3 printers with same model and firmware running. Some of them showing correct and some not. This is not Bambuddy. Something weird is going on. Did you - power cycled the printer in question? - do you see any errors on printer display or in HMS? - Cache problem? Did you forced a reload of ther page - or better - open Bambuddy in an incognito window As of now I have no other ideas, sorry.
Author
Owner

@inkdawgz commented on GitHub (Mar 25, 2026):

all printers power cycled
no errors
no chance problem, changed ports and cleared cache

shows the same in 7 different browsers

shows correct in system info page

<!-- gh-comment-id:4127999239 --> @inkdawgz commented on GitHub (Mar 25, 2026): all printers power cycled no errors no chance problem, changed ports and cleared cache shows the same in 7 different browsers shows correct in system info page
Author
Owner

@maziggy commented on GitHub (Mar 25, 2026):

Wait...

shows correct in system info page

Overseen that, let me check more deeply.

<!-- gh-comment-id:4128139111 --> @maziggy commented on GitHub (Mar 25, 2026): Wait... >shows correct in system info page Overseen that, let me check more deeply.
Author
Owner

@inkdawgz commented on GitHub (Mar 25, 2026):

lol oops

<!-- gh-comment-id:4128178994 --> @inkdawgz commented on GitHub (Mar 25, 2026): lol oops
Author
Owner

@maziggy commented on GitHub (Mar 25, 2026):

This is my best guess, I swear! Please pull dev branch, restart bambuddy and let me know if it works now.


The issue is a firmware quirk on P1S (and P1P): some firmware versions report stg_cur=0 when the printer is idle. Stage 0 maps to "Printing" internally, and the printer card displays the stage name with priority over the actual gcode_state. That's why the card shows "Printing" while the System Info page (which uses the raw gcode_state) correctly shows idle.

We already had a workaround for this on A1/A1 Mini — it's now extended to P1S and P1P as well.

<!-- gh-comment-id:4128207347 --> @maziggy commented on GitHub (Mar 25, 2026): This is my best guess, I swear! Please pull dev branch, restart bambuddy and let me know if it works now. --- The issue is a firmware quirk on P1S (and P1P): some firmware versions report stg_cur=0 when the printer is idle. Stage 0 maps to "Printing" internally, and the printer card displays the stage name with priority over the actual gcode_state. That's why the card shows "Printing" while the System Info page (which uses the raw gcode_state) correctly shows idle. We already had a workaround for this on A1/A1 Mini — it's now extended to P1S and P1P as well.
Author
Owner

@inkdawgz commented on GitHub (Mar 25, 2026):

perfect.. ty

<!-- gh-comment-id:4128379535 --> @inkdawgz commented on GitHub (Mar 25, 2026): perfect.. ty
Author
Owner

@maziggy commented on GitHub (Mar 25, 2026):

Puhhh :)


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

<!-- gh-comment-id:4128411905 --> @maziggy commented on GitHub (Mar 25, 2026): Puhhh :) ----- 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-maziggy-1#545
No description provided.