derekantrican / BambuLabsListener

4 stars 0 forks source link

!! - THIS PROJECT HAS BEEN ARCHIVED - !!

This project has been archived as a better option has come along: OctoEverywhere [GitHub] which now supports BambuLabs printers.

I'd rather point people in that direction than use my "example code" that most likely will get very little focus from me with my limited free time.

BambuLabsListener

This is a listener & notifier for Bambu Labs printers using MQTT to listen on the messages the printer sends and provide print notifications via Discord.

AT THIS TIME, THIS CODE IS ONLY TO SERVE AS AN EXAMPLE - NOT A SOLUTION

While this works (and is enough for my needs) this is meant to just be a starting point & inspiration for other developers. I don't have the capacity at this time to take on & support another project.

This has only been tested on a P1P as that's the only printer I have. If you have a X1C and are willing to test this out, please visit https://github.com/derekantrican/BambuLabsListener/issues/2

Demo

https://github.com/derekantrican/BambuLabsListener/assets/1558019/c08882ff-e89c-4caa-8848-8a92f62c486e

Cross-plat compatibility

Getting started

For this to work, you need to be on the same network as your printer

  1. Install .NET 6 if you do not have it installed already (https://dotnet.microsoft.com/en-us/download/dotnet/6.0 - ".NET Runtime" for your platform)
  2. Clone the repo
  3. Open your terminal & cd into the repository folder
  4. Run dotnet run
  5. A settings.json file will be created for you. Open it up and populate the values listed
  6. Run dotnet run again and the application will start listening to messages from your printer
  7. Start a print! You should be able to watch the console for message updates such as when a print starts, layer progress, and print finishing. Discord notifications will be sent to the webhook specified when a print starts & finishes

Troubleshooting

As mentioned in https://github.com/derekantrican/BambuLabsListener/issues/3#issuecomment-1714352307 I had some issues getting this to work unless I installed MQTT Explorer first & got it working listening to my printer's message stream. After that, this tool seemed to work (no idea why that might be).

Questions/Issues

Support/Donate to this project

Thank you so much for considering donating to this project! The more donations I get, the more I can justify putting work into this project.

ko-fi

Future plans

Todos:

UI

It has been suggested that I turn this into an OctoPrint-like interface. That would be a lot of work (and a lot of learning new things for me), but I can see the value in it. If this gets enough demand and there's enough sponsorship of this project, I'll be able to justify time towards this feature.

Sending messages

Theoretically, MQTT could also be used to send (publish) messages TO the printer (eg starting a print job). I haven't tested that and don't know if it works. I have no plans to do this currently - this repository is only meant to serve as a small tool & example code for building something similar. But anyone is welcome to fork & create a PR to contribute!