bambulab / BambuStudio

PC Software for BambuLab and other 3D printers
GNU Affero General Public License v3.0
1.87k stars 261 forks source link

MQTT semi-broken in P1P/S 01.04.00.00 firmware - only the last connection gets data. Especially breaks Lan Mode usage. #2404

Open AdrianGarside opened 1 year ago

AdrianGarside commented 1 year ago

Bambu Studio Version

1.6.2.4

Where is the application from?

Bambu Lab Official website

OS version

Windows 11

Additional system information

No response

Printer

P1P

How to reproduce

  1. Connect to printer by MQTT Explorer / Home Assistant integration.
  2. Some of the time it will connect sucessfully but never receive any data back
  3. In that scenario, you can reconnect as many times as you like - it won't get data until the printer is restarted.
  4. And then it's hit and miss if it will get data. If it gets data it seems like it will continue to get data indefinitely. If it doesn't get data only a printer restart may fix that.

Seems likely to be related to: "Fixed the printer restart problem caused by continuous reconnection of MQTT using third-party tools." - see https://wiki.bambulab.com/en/p1/manual/p1p-firmware-release-history As the issue started with the P1 series OTA version01.04.00.00(20230807)firmware update.

Actual results

If mqtt data doesn't flow only a printer restart can fix it but not consistently.

Expected results

Successful MQTT connection should always result in receiving MQTT data on the report topic.

Project file & Debug log uploads

N/A

Checklist of files to include

AdrianGarside commented 1 year ago

From more investigation the behavioral problem is simple - only the most recent connection gets the data. But it's a stack. So if I connect my home assistant instance it will work until I also start up mqtt explorer at which point only the latter gets data but once I disconnect that my home assistant instance will start getting data again. This breaks my ability to use a separate long running test instance of home assistant to work on the integration since it breaks my production instance.

slynn1324 commented 1 year ago

I've noticed the same problem on my P1S with the latest firmware. It's not the most elegant solution, but as a workaround I hacked in a webhook into my fork of BambuStudio to echo out the received status information so I can ingest it into Home Assistant --> https://github.com/slynn1324/BambuStudio/commit/d919b7bdc5d72e870ba60f77d85b5de6e9fcd232. This puts the extra load on the PC running BambuStudio rather on the printer. I don't really propose adding this as a main feature... but wasn't sure how else to get it working for my case.

AdrianGarside commented 1 year ago

This also breaks lan mode usage by multiple clients (e.g. Bambu Studio and Orca Slicer).

npike commented 1 year ago

Is there a version of the P1 firmware that we can roll back to that works as intended?

sodachen22 commented 1 year ago

Does the latest Bambu Studio support P1S LAN only mode with the latest firmware?

AdrianGarside commented 12 months ago

Is there a version of the P1 firmware that we can roll back to that works as intended?

01.04.00.00 introduced the bug. Earlier firmware versions behaved ok.

gustafssone commented 11 months ago

I've noticed the same problem on my P1S with the latest firmware. It's not the most elegant solution, but as a workaround I hacked in a webhook into my fork of BambuStudio to echo out the received status information so I can ingest it into Home Assistant --> slynn1324@d919b7b. This puts the extra load on the PC running BambuStudio rather on the printer. I don't really propose adding this as a main feature... but wasn't sure how else to get it working for my case.

Interesting workaround. That in combination with a slicer that is always running, e.g. https://hub.docker.com/r/mikeah/orcaslicer-novnc could work for now. How do you access the webhook? Got any more details?

TackleBerryCrash commented 11 months ago

Will this bug be addressed in a short time frame ? I was hoping it would have been with new fw update but it is still replicable

AdrianGarside commented 11 months ago

It's out of our control since it's a bug in the P1P firmware. Only Bambu can fix it. The only workaround is to not use lan mode and configure this integration to connect to bambu cloud mqtt. That's working without any known issues.

AdrianGarside commented 10 months ago

@sodachen22 is there any hope this will be fixed soon? It breaks lan mode configuration and affects integrations like the home assistant ones and XTouch (formerly P1Touch).

sodachen22 commented 10 months ago

Thank you for your feedback. We have identified a software issue here. The issue occurs when multiple MQTT clients are connected, causing only the last connection to receive data. This problem will be fixed in the upcoming versions. The temporary solution for now is to keep only one connection."

AdrianGarside commented 9 months ago

@sodachen22 do you know if it is slated to be fixed in the next firmware update? This continues to generate a lot of complaints.

xperiments commented 9 months ago

Yes , we have a lot of user reports with this also in xtouch Any ETA? We need to provide a "bridge" solution? Thanks

kenkamm commented 9 months ago

@sodachen22 Any updates on this? Would really like to see this fixed in the next update if at all possible.

raster commented 9 months ago

MQTT needs to work reliably. Hoping this gets fixed soon.

smford commented 9 months ago

This is a very frustrating bug, hopefully it gets fixed soon.

TackleBerryCrash commented 9 months ago

This was working 2 versions ago so needs to be fixed ASAP. Telling users "Don't use multiple connections" is not a good solution :)

NoAdO commented 9 months ago

Have a same bug but need to restart printer and make magic with logging in to make it work. If i use only Orca - all is ok. If i try to add HA integration - cconnection fails. If i use Bambu Studio - connection fails. If i even try to download my timelapses with winSCP - connection fails. Every time i need to dance with a tambourine around my P1P. It's disappointing, my previous cheap printer made of crap working with Klipper+Moonracker+fluidd on Pi 3 was much more intelligent, i had an auto-off feature in HomeAssistant, could get print status photo via TG, download every file without problem and knew progress of work from every device in a pair of seconds.

I do not want to tell all this is needed, just let me get printer data in 2 connections and i will do the rest. Also, the problem is that even if i not use 2 connections at once, if i used one more (ex. winscp) my main connection breaks till i do some tricks to get it back.

electricar commented 9 months ago

+1

Sprawlie commented 8 months ago

Is there an update on this and the latest version? On 1.04.02 and this is still occurring.

AdrianGarside commented 8 months ago

@sodachen22 Please say this is going to be fixed in the v1.5 firmware that's soon to be released.

Genygo commented 8 months ago

The BambuLab support confirmed to me, that this will be fixed in the next release. But the printer will only support to bind to 4 devices.

TackleBerryCrash commented 8 months ago

The BambuLab support confirmed to me, that this will be fixed in the next release. But the printer will only support to bind to 4 devices.

I guess it was the "next" next release...

AdrianGarside commented 8 months ago

The BambuLab support confirmed to me, that this will be fixed in the next release. But the printer will only support to bind to 4 devices.

I guess it was the "next" next release...

Seems to be fixed in 1.0.5.0