How to change a filament at specific layers through octoprint

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

  1. update the pause and resume scripts in octoprint settings GCode scripts (see GCODE Scripts β€” OctoPrint master documentation)
  2. 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/)
  3. 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.
  4. add a line "@pause" , this will invoke a pause as though you pressed the button in octoprint (see @ Commands β€” OctoPrint master documentation)
  5. save the modified Gcode.
  6. Print the GCode file from from octorprint , (not from the SD card)
  7. The print will pause at the layer and move the print head to x0 y0.
  8. change the filament
  9. Press resume in octoprint to continue the print.

job done

1 Like

you can also do this in most slicers, for example Cura uses post processing scripts extension, just make sure to select the option for repetier style (@pause) and you're good to go.

i tried the cura post processing scripts, such as change filament at height but they didnt work me , the firmware in the cr10s prov2 doesnt have the advanced config enabled (i looked at the source code) . ill have a look at the repetier options to see what gcode they produce. thanks for the heads up.

Yeah, there's a drop down in one of those cura post processing options that you can change the command being used.

Some Creality firmware does not support M600. You would need to install the latest version of Marlin to enable M600

Bill

good point, that's why I recommended using @PAUSE as that will handle the pausing within OctoPrint directly and doesn't matter what firmware is running.