cameroncros / OctoPrint-DiscordRemote

Discord plugin for OctoPrint
MIT License
66 stars 34 forks source link

Send a notification when <X> layer starts. #234

Open McStebb opened 1 year ago

McStebb commented 1 year ago

Is your feature request related to a problem? Please describe. No.

Describe the solution you'd like Sometimes I print multi-color models by manually pausing and changing filament at a specific layer, but it usually involves me babysitting the print until I can visually tell it's at the right layer.

It would be nice if Octoprint had a setting that sent a notification (with optional webcam snapshot) when the print reached a specified layer. That way I can go pause and change filament when I get notified.

Most slicers append a layer number comment line at the start of each layer, so triggering the bot to send a notification could simply look for ";LAYER (x)" for when to send the notification.

Or just have the user add custom comment gcode at layer via the slicer. Something like this. (Add custom GCode at layer 173...) " ;NOTIFY "

And then the bot notifies me at that layer because of the " ;NOTIFY " comment.

Describe alternatives you've considered I could just install a multi-filament mod, but that's a considerable undertaking.

Additional context N/A

cameroncros commented 1 year ago

Im more than happy for someone to investigate further, but from memory there is no obvious/easy way for the plugin to get notified of layer changes. As in, Octoprint does not tell plugins when a layer changes. This means we have to start parsing the GCode as it is printing, which will consume precious CPU resources, potentially leading to print defects.

My goal was to make octoprint as light weight as possible, so I didnt go down that road.

For your specific use case, can you not insert GCode to pause the print at a given layer? If the print pauses, you will get a notification for that event, which can prompt you to do the filament switch?