i was trying to change filament colours at specific layers and saw lots of people having problems. After trying to insert various M code commands unsuccessfuly i realised that some of the commands either arent implemented in the printer firmware or only work if printing from the SD Card , which i dont do. anyways after a bit of research heres how to do it
here is how to invoke an automaitc filament change at specific layers
- update the pause and resume scripts in octoprint settings GCode scripts (see GCODE Scripts — OctoPrint master documentation)
- use a gode viewer to view the gcode print file you want to print and find the layer you want to change filaments at ( i used https://gcode.ws/)
- use a text editor (i use notepad++) to edit the GCode file you want to print. Search for "Layer" and find the layer you want to stop at.
- add a line "@pause" , this will invoke a pause as though you pressed the button in octoprint (see @ Commands — OctoPrint master documentation)
- save the modified Gcode.
- Print the GCode file from from octorprint , (not from the SD card)
- The print will pause at the layer and move the print head to x0 y0.
- change the filament
- Press resume in octoprint to continue the print.