Bambu Lab X1 X1C MQTT

Should be able to send a project_file command from a local http server if the endpoint is a 3mf file. But if you print directly from Makerworld as well (from the site, not downloading to slicer and sending) it will also print using an HTTP address. You could use makerworld to verify the outbound connection.

Additionally, P1 series used to (and in some cases still does if cloud connected) unpack in the cloud and print via http as well.

Tried with http and https… printer didnt make any outbound connection… can you please share more details? Perhaps an example mqtt message?

Changed this to http://myip/blah.3mf and nothing happened on printer… no error either

I don’t have an example handy but you can easily generate one by printing directly from makerworld and looking at the project_file command. But it doesn’t do any checks on the origin IP, sometime back in Oct/Nov last year I had tested with a local python-flask server hosting a 3mf file I had sliced in orcaslicer - worked like a charm. I also believe others have had it working since then on current firmware.

Wanted to let other folks here know - with X1Plus, my bed-mesh visualization flows are updated and now work again!

My other flows are updated with some extra sensors, but are already compatible as is, but I’ve done quite a few optimizations and cleanup as well as part of my v2.1.0 release.

1 Like

This site has been tremendous in helping me create my own app for connecting to bambu printers. Im not using ha to connect at all but the info has helped me a lot. I cant seem to figure out how to view the network debug logs in orca slicer though. Is there a certain way to view the .enc files? I have WireShark from many years pass and it tries to open it but it says its invalid file. Im not sure how the files are encoded so any help would be much appreciated.

Working with X1Plus confirmed, including bed-mesh. sweet!
I rebuilt almost everything using the guide.
the only issue i have now, is both my AMS sensor attributes report to one device. for example, sensor.ams_0_x1_carbon_ams and sensor.ams_1_x1_carbon_ams both belong to AMS_1_X1_Carbon device, and AMS_0_X1_Carbon device has no entities.

That’s strange, might be some desync with device identifiers. Could you try connecting to the mqtt broker via mqtt explorer or other and deleting all AMS_0 and AMS_1 topics - with the printer off. Then restart HA and when it’s settled, turn on the printer?

I did 2-3 updates ago adjust the uniqueness of device identifiers, and in “most” cases it should pick up the new ones but sometimes mqtt doesn’t apply that immediately, or if it does, HA doesn’t pick up on moving entities around quite yet.

EDIT: I also might see one minor logic bug in the code for that actually, so I just pushed a potential fix (not changing version). Just redo the basic flow (configurator updates automatically) and hopefully it fixes it, but still do the steps above perhaps just to clean things up?

didn’t fix it.
in HA, i disabled mqtt, deleted all sensor.ams* entities. restarted HA.
in node-red, replaced new basic flow and deployed.
in mqtt, there were AMS_0_X1_Carbon and AMS_1_X1_Carbon topics. deleted them both.
started x1plus x1c, enabled mqtt, and restarted flows.
AMS_0_X1_Carbon and AMS_1_X1_Carbon topics recreated.
HA shows AMS_1_X1_Carbon having all sensor.ams_0_x1* and sensor.ams_1_x1* sensors.

Was thinking more to delete it from MQTT before any HA stuff - deleting from HA won’t do anything as it’ll just remake or potentially mess up when they get back to working.

I tried simulating this (I only have one AMS) by duplicating an AMS entry with a fake S/N and id of 1 (compared to my only with id of 0) and did not encounter the issue. However, I did push another change just now that might fix it still in the basic_flow if you want to retry that.

I would say this time just import the new basic flow and delete only from mqtt in mqtt explorer the AMS_1* and AMS_0* topics in sensor.

Give it about 5-10min after importing the new one. I think potentially the nodered flow array I had for storing AMS serial numbers could be half-broken in your case, which means it’ll need to be remade (as recent nodered versions persist flow variables between deployments now), so you’ll have to wait for the “fetch versions” node to run once or twice, or manually run it a few times after it initially connects to the printer.

image

all good now! updated basic. but it took a few attempts to get it all working right. first, there was a ghost ams device i had to clean up (deleted mqtt in HA, mqtt topics, node red restart). then the 2nd ams didnt report the same entities. cleaned up again and it finally is all good. thanks!!!

1 Like

Just wanted to mention that I’ve once again updated my flows + dashboard yamls. Dashboard yamls are now much more modular and friendly, intended to be deployed with HA’s new “Sections” view layout.

As for new features, I’ve added a custom speed percentage slider. Lets you set a custom speed setting from 30%-180% in 2% increments. I’ve also added a home-axis button with a preview setting of what axes are currently homed.


2 Likes

I finally got around to updating mine but the advanced setup is still eluding me. One day I’ll figure it out.

Awesome work @WolfwithSword !

1 Like

Pretty sure I have bigger problems since I get nothing in Grafana but how do I create a hard-code value in a template sensor?

For Grafana you would need to look up on connecting to the postgres DB as a datasource and select it when importing the dashboards.

For the hardcoded value for the template sensor, you should be able to do that through the UI. Go to devices and services → Helpers tab in the top, create new helper and go to Template sensor (not binary). Then in the state template you could just type in the value.

1 Like

Thank you. I was trying to create the template sensor the old way and screwing it up. That worked much easier :slight_smile:

For the Grafana, I’m connected correctly to the DB anc can pull the table but no data in there seemingly so I mush have something wrong going into Postgres. I’ll review that further.

Also, in NodeRed I keep getting this error:
Advanced Flow cannot be used without the Basic Flow group in the same flow.

I have the standard flow in one tab and the advanced in a separate. Doe this error mean they need to be on the same tab?

image

Yes they need to be in the same tab. The idea is that each “Tab” is for one whole printer ideally, and the advanced flow is pulling variables and sharing data with the basic flow, which can only safely be done in the same tab.

This is also likely why your grafana data is not working - there’s nothing in the DB yet and it hasn’t even made the tables since the advanced flow has not been working.

1 Like

Yep, that made all the difference!

Ok, that gives me somethings to play with. One more item that just has me scratching my head. I can’t get the start time. I didn’t change anything but it hasn’t worked since I loaded the new/updated config.

image
image

It should start working if you start a new print - sometimes on the first round of setting up it won’t immediately work especially if done during a print. This was the behaviour with P1 series stuff most of the time but recent patch firmwares for X1 also “removed” start timestamps from the payload (hence now I have to pull it a different way). But yeah once you “start” a new print I believe it should populate from then onward.

Though if it continues after starting more then there might be something I missed.

1 Like

I will keep an eye on the ‘start time’. I’ve been printing this little coin holder over and over trying to test this out.

Amazing what you have developed! Always impressed!

1 Like

Hm if it’s been a few prints and still hasn’t shown up it’s a bit weird. I don’t have time for a bit to try debugging that (assuming you’re on newest FW?) though it seems you did get the start epoch at least, so worst case you could try to look into how to replace it in the yaml with the epoch and have it format visually into a timestamp.

Also notice the Aux fan controls isn’t showing up for you there, unless you manually removed that?