thomst08 / OctoLight

OctoLight with auto turn off and on
7 stars 3 forks source link

Filament change as a new Event option #6

Closed ArtSpaziano closed 5 months ago

ArtSpaziano commented 5 months ago

It would be very helpful to have the bed light come on for a period of time during manual filament / color changes during a print.

Since this is not one of the event options, I have been able to turn it on when M600 is received using the Custom Gcode option (using a Prusa MK3s+ with Prusaslicer). However, I don't believe there is a Gcode for resuming the plot, since resumption is selected via the printer's front panel, once the new filament is in and the color is correct. Therefore, the light stays on.

Here is a sample snippet of gCode which contains a filament change, as captured in an Octoprint Terminal session:

Send: N10169 G1 Z1.8 F72041 Recv: ok Send: N10170 M60034 Recv: T:269.5 /270.0 B:90.0 /90.0 T0:269.5 /270.0 @:92 B@:106 P:0.0 A:45.5 Recv: echo:busy: processing Recv: T:268.7 /270.0 B:89.8 /90.0 T0:268.7 /270.0 @:105 B@:126 P:0.0 A:45.4 Recv: echo:busy: processing Recv: T:270.9 /270.0 B:89.8 /90.0 T0:270.9 /270.0 @:68 B@:121 P:0.0 A:45.4 Recv: echo:busy: paused for user Recv: T:270.8 /270.0 B:89.8 /90.0 T0:270.8 /270.0 @:73 B@:119 P:0.0 A:45.5 Recv: echo:busy: paused for user Recv: T:272.2 /270.0 B:89.7 /90.0 T0:272.2 /270.0 @:52 B@:114 P:0.0 A:45.5 Recv: echo:busy: paused for user Recv: T:272.5 /270.0 B:89.8 /90.0 T0:272.5 /270.0 @:49 B@:96 P:0.0 A:45.5 Recv: echo:busy: paused for user ... Recv: T:271.2 /270.0 B:90.1 /90.0 T0:271.2 /270.0 @:56 B@:101 P:0.0 A:45.1 Recv: echo:busy: paused for user Recv: T:270.3 /270.0 B:90.1 /90.0 T0:270.3 /270.0 @:71 B@:100 P:0.0 A:45.3 Recv: echo:busy: paused for user Recv: LCD status changed Recv: T:270.5 /270.0 B:90.1 /90.0 T0:270.5 /270.0 @:67 B@:82 P:0.0 A:45.4 Recv: echo:busy: paused for user Recv: T:270.3 /270.0 B:90.1 /90.0 T0:270.3 /270.0 @:68 B@:74 P:0.0 A:45.2 Recv: echo:busy: paused for user Recv: T:269.4 /270.0 B:90.2 /90.0 T0:269.4 /270.0 @:82 B@:58 P:0.0 A:45.1 Recv: echo:busy: paused for user Recv: T:269.8 /270.0 B:90.2 /90.0 T0:269.8 /270.0 @:73 B@:44 P:0.0 A:45.2 Recv: echo:busy: paused for user Recv: T:268.9 /270.0 B:90.4 /90.0 T0:268.9 /270.0 @:88 B@:24 P:0.0 A:45.2 Recv: LCD status changed Recv: echo:busy: paused for user Recv: T:270.2 /270.0 B:90.5 /90.0 T0:270.2 /270.0 @:66 B@:12 P:0.0 A:45.2 Recv: echo:busy: processing Recv: T:269.5 /270.0 B:90.6 /90.0 T0:269.5 /270.0 @:76 B@:0 P:0.0 A:45.2 Recv: echo:busy: processing Recv: T:270.9 /270.0 B:90.6 /90.0 T0:270.9 /270.0 @:53 B@:7 P:0.0 A:45.2 Recv: echo:busy: processing Recv: T:269.5 /270.0 B:90.6 /90.0 T0:269.5 /270.0 @:76 B@:13 P:0.0 A:45.0 Recv: echo:busy: processing Recv: T:270.0 /270.0 B:90.5 /90.0 T0:270.0 /270.0 @:69 B@:23 P:0.0 A:45.2 Recv: echo:busy: processing Recv: T:268.6 /270.0 B:90.5 /90.0 T0:268.6 /270.0 @:92 B@:40 P:0.0 A:45.1 Recv: echo:busy: processing Recv: T:269.2 /270.0 B:90.3 /90.0 T0:269.2 /270.0 @:80 B@:57 P:0.0 A:44.9 Recv: echo:busy: paused for user Recv: T:267.5 /270.0 B:90.3 /90.0 T0:267.5 /270.0 @:105 B@:62 P:0.0 A:45.0 Recv: echo:busy: paused for user Recv: T:268.1 /270.0 B:90.1 /90.0 T0:268.1 /270.0 @:92 B@:94 P:0.0 A:45.0 Recv: echo:busy: paused for user Recv: T:267.7 /270.0 B:90.0 /90.0 T0:267.7 /270.0 @:98 B@:90 P:0.0 A:45.2 Recv: echo:busy: paused for user Recv: T:269.5 /270.0 B:89.9 /90.0 T0:269.5 /270.0 @:69 B@:99 P:0.0 A:44.9 Recv: echo:busy: processing Recv: T:270.6 /270.0 B:89.9 /90.0 T0:270.6 /270.0 @:54 B@:92 P:0.0 A:44.9 Recv: echo:busy: processing Recv: T:271.2 /270.0 B:89.9 /90.0 T0:271.2 /270.0 @:49 B@:89 P:0.0 A:44.9 Recv: echo:busy: processing Recv: T:270.9 /270.0 B:89.9 /90.0 T0:270.9 /270.0 @:58 B@:72 P:0.0 A:45.1 Recv: echo:busy: processing Recv: T:271.2 /270.0 B:90.0 /90.0 T0:271.2 /270.0 @:55 B@:54 P:0.0 A:45.0 Recv: echo:busy: processing Recv: T:270.2 /270.0 B:90.1 /90.0 T0:270.2 /270.0 @:74 B@:31 P:0.0 A:45.0 Recv: echo:busy: processing Recv: T:269.4 /270.0 B:90.2 /90.0 T0:269.4 /270.0 @:86 B@:25 P:0.0 A:45.0 Recv: echo:busy: processing Recv: T:268.6 /270.0 B:90.3 /90.0 T0:268.6 /270.0 @:96 B@:14 P:0.0 A:44.9 Recv: echo:busy: processing Recv: echo:enqueing "M220 S100" Recv: LCD status changed Recv: ok Send: N10171 G1 E0.4 F15003 Recv: ok Send: N10172 G1 E-1 F210049 Recv: ok

I'm not sure if other printers handle it the same way as Prusa does (M600), but perhaps this event could be configurable by the user. Another alternative would be to have another Custom Gcode option for timed lighting.

thomst08 commented 5 months ago

Hey @ArtSpaziano,

I have had the same thought before and how to solve it is a little tricky... OctoPrint doesn't have an event for filament changes (as far as I'm aware, there is tool changes...), this is why I added the custom GCode option as some printers are different and there is a number of ways this could be handled.

Personally I use the MMU2s with my Prusa 3Mks, I haven't tried it, but I believe you can add some code to the filament change code in Prusa slicer, this way you could force a turn on and off after the change is done. The other option is if this is manually done is to manually inject custom code after each M600 (not ideal....), I'm not sure if Prusa slicer has an GCode section for extra code when doing a filament change (might be worth looking at in settings)

I can look at adding a third custom GCode option to have the light timeout after your set period of time, would that work best in this situation?

ArtSpaziano commented 5 months ago

It looks like it may be possible to inject something after M600 but this doesn't strike me as an elegant solution. The best option IMHO is the light timeout option for custom GCode feature. I receive a Pushover notification on my phone when filament changes are required and typically deal with them right away, so the light wouldn't need to stay on for long, Also, that feature would be more in line with the behavior of your plugin which makes it a more elegant solution in my estimation.

MMU2 eh? I must say that I"m envious. I was about to buy one but I saw how many of them showed up on eBay with stories about how poorly they performed. Reviews for the MMU3 seem to be less than positive as well. I decided to stick with the manual filament change ballet for now but still may give it a try at some point.

Art

thomst08 commented 5 months ago

Your right about the delay, the only issue I see with the delay is that it might be on for while before shutting off or it turns off too quickly, I will look at adding a delayed light turnoff with custom GCode as a way of getting around this for a the moment, side note, you can interact with the API of this plugin to trigger a turn on or off, so for the more techy people other there could use this.

I got the MMU2s back when I bought my Prusa (5~ years now... :S) while I have had a few issues with it, overall its great, I very rarely have issues with it now. This is with long print jobs too. I have been watching the MMU3 and MK4..... very tempted to upgrade but shipping into Australia is abit...... One day :P

ArtSpaziano commented 5 months ago

Thanks for considering this. I'll be watching for updates. Meanwhile. I'll just need to turn the light off after the changes are done. Also, I'll have to reconsider the MMU idea. I'm considering a 2nd printer which will give me the ability to experiment with add-ons such as this while not putting my primary printer at risk.

thomst08 commented 5 months ago

Hey @ArtSpaziano,

I have released v0.2.0, this has an extra GCODE section for a turn on with a delayed off. Check if everything is working your end.

ArtSpaziano commented 5 months ago

Thanks. I'll try it later today.

ArtSpaziano commented 5 months ago

It works just as I had hoped. Thanks for the quick response !