Skip to content

Instantly share code, notes, and snippets.

@igb
Created October 14, 2021 19:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igb/1c42e42c686cbb4b3e9bbf87d6b0e9d1 to your computer and use it in GitHub Desktop.
Save igb/1c42e42c686cbb4b3e9bbf87d6b0e9d1 to your computer and use it in GitHub Desktop.
Wrapper around slic3r to make easier and more reliable prints with a Creality Ender Pro v3
#!/bin/bash -e
FILENAME="${1%%.*}"
if [ $2 ]
then
DUPLICATES="--duplicate $2"
echo "PRINTING $2 DUPLICATES"
fi
BED_TEMP=70
NOZZLE_TEMP=200
echo "SLICING..."
CMD="slic3r $FILENAME.stl --layer-height 0.2 --filament-diameter 1.75 --first-layer-height 0.22 --retract-length 3 --brim-width 10 --bottom-solid-layers 10 --top-solid-layers 10 $DUPLICATES -o $FILENAME.gcode"
echo
echo $CMD
echo
$CMD
echo "POST PROCESSING GCODE..."
sed -i "s/M104 S200/M140 S$BED_TEMP ; set bed temp\nM190 S$BED_TEMP ; wait for bed temp \nM104 S$NOZZLE_TEMP/" $FILENAME.gcode
sed -i "s/M109 S200/M109 S$NOZZLE_TEMP/" $FILENAME.gcode
sed -i "s/M104 S0/M140 S0 ; turn off bed temp\nM104 S0/" $FILENAME.gcode
echo "COPYING TO OCTOPI..."
scp $FILENAME.gcode octopi.local:/home/pi/.octoprint/watched/
echo "DONE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment