Skip to content

Instantly share code, notes, and snippets.

@TheRealFalseReality
Last active June 2, 2025 05:09
Show Gist options
  • Save TheRealFalseReality/9f7d0fd49c24d0c8db9c04f3215753f7 to your computer and use it in GitHub Desktop.
Save TheRealFalseReality/9f7d0fd49c24d0c8db9c04f3215753f7 to your computer and use it in GitHub Desktop.
# 56
[stepper_x]
step_pin: PB13
dir_pin: !PB12
enable_pin: !PB14
microsteps: 16
rotation_distance: 40
endstop_pin: ^PC0
position_endstop: 0
position_max: 247
homing_speed: 50
[tmc2209 stepper_x]
uart_pin: PC11
tx_pin: PC10
uart_address: 0
run_current: 0.580
stealthchop_threshold: 999999
[stepper_y]
step_pin: PB10
dir_pin: !PB2
enable_pin: !PB11
microsteps: 16
rotation_distance: 40
endstop_pin: ^PC1
position_endstop: 0
position_max: 235
homing_speed: 50
[tmc2209 stepper_y]
uart_pin: PC11
tx_pin: PC10
uart_address: 2
run_current: 0.580
stealthchop_threshold: 999999
[stepper_z]
step_pin: PB0
dir_pin: PC5
enable_pin: !PB1
microsteps: 16
rotation_distance: 8
endstop_pin: probe: z_virtual_endstop
#position_endstop: 0.0
position_max: 250
position_min: -1
[tmc2209 stepper_z]
uart_pin: PC11
tx_pin: PC10
uart_address: 1
run_current: 0.580
stealthchop_threshold: 999999
[extruder]
step_pin: PB3
dir_pin: !PB4
enable_pin: !PD1
microsteps: 16
rotation_distance: 33.500
#rotation_distance: 30.552
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PC8
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PA0
#control: pid
#pid_Kp: 21.527
#pid_Ki: 1.063
#pid_Kd: 108.982
min_temp: 0
max_temp: 250
pressure_advance: 0.1265
#max_extrude_only_distance: 101
[tmc2209 extruder]
uart_pin: PC11
tx_pin: PC10
uart_address: 3
run_current: 0.650
[heater_bed]
heater_pin: PC9
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC4
control: pid
pid_Kp: 54.027
pid_Ki: 0.770
pid_Kd: 948.182
min_temp: 0
max_temp: 130
[heater_fan heatbreak_cooling_fan]
pin: PC7
heater_temp: 50.0
[heater_fan controller_fan]
pin: PB15
heater: extruder
heater_temp: 50.0
[fan]
pin: PC6
[mcu]
serial: /dev/serial/by-id/usb-Klipper_stm32g0b1xx_3900390017504B5735313920-if00
restart_method: command
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100
[board_pins]
aliases:
# EXP1 header
EXP1_1=PB5, EXP1_3=PA9, EXP1_5=PA10, EXP1_7=PB8, EXP1_9=<GND>,
EXP1_2=PA15, EXP1_4=<RST>, EXP1_6=PB9, EXP1_8=PD6, EXP1_10=<5V>
[display]
lcd_type: st7920
cs_pin: PB8
sclk_pin: PB9
sid_pin: PD6
encoder_pins: ^PA10, ^PA9
click_pin: ^!PA15
menu_timeout: 30
[gcode_macro M109]
rename_existing: M99109
gcode:
#Parameters
{% set s = params.S|float %}
M104 {% for p in params %}{'%s%s' % (p, params[p])}{% endfor %} ; Set hotend temp
{% if s != 0 %}
TEMPERATURE_WAIT SENSOR=extruder MINIMUM={s} MAXIMUM={s+1} ; Wait for hotend temp (within 1 degree)
{% endif %}
[gcode_macro M190]
rename_existing: M99190
gcode:
#Parameters
{% set s = params.S|float %}
M140 {% for p in params %}{'%s%s' % (p, params[p])}{% endfor %} ; Set bed temp
{% if s != 0 %}
TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={s} MAXIMUM={s+1} ; Wait for bed temp (within 1 degree)
{% endif %}
[output_pin beeper]
pin: PB5
pwm: True
value: 0
shutdown_value: 0
cycle_time: 0.001
[gcode_macro M300]
description: Enables M300 commands
gcode:
#use a default 1kHz tone if S is omitted
{% set S = params.S|default(1000)|int %}
#use a 10ms duration if P is omitted
{% set P = params.P|default(10)|int %}
SET_PIN PIN=beeper VALUE=0.5 CYCLE_TIME={1.0/S if S > 0 else 1}
G4 P{P}
SET_PIN PIN=beeper VALUE=0
[gcode_macro beeper_tones]
description: Beep tones.
gcode:
M300 S440 P200
# M300 S660 P250
# M300 S880 P300
[gcode_macro BEEP]
gcode:
# Parameters
{% set i = params.I|default(1)|int %} ; Iterations (number of times to beep).
{% set dur = params.DUR|default(100)|int %} ; Duration/wait of each beep in ms. Default 100ms.
{% set freq = params.FREQ|default(2000)|int %} ; Frequency in Hz. Default 2kHz.
{% for iteration in range(i|int) %}
SET_PIN PIN=beeper VALUE=0.8 CYCLE_TIME={ 1.0/freq if freq > 0 else 1 }
G4 P{dur}
SET_PIN PIN=beeper VALUE=0
G4 P{dur}
{% endfor %}
[input_shaper]
shaper_freq_x: 29.00
shaper_freq_y: 31.42
[bltouch]
sensor_pin: ^PC14
control_pin: PA1
x_offset: -40
y_offset: -10
#z_offset = 1.052
stow_on_each_sample: false
[safe_z_home]
home_xy_position: 155,125 # Nozzle coordinates
speed: 250
z_hop: 10
z_hop_speed: 5
[bed_mesh]
speed: 120
horizontal_move_z: 5
mesh_min: 10, 10
mesh_max: 185, 215
probe_count: 5, 5
mesh_pps: 2, 3
algorithm: bicubic
bicubic_tension: 0.2
move_check_distance: 5
split_delta_z: .025
zero_reference_position: 155,125
fade_start: 1.0
adaptive_margin: 5
[idle_timeout]
timeout: 600 # 10 mins
gcode:
{% if printer.pause_resume.is_paused %}
# Store previous temperature
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=prev_temp VALUE={printer.extruder.target}
M117 Idle, turning off hotend
SET_HEATER_TEMPERATURE HEATER=extruder TARGET=0
{% else %}
TURN_OFF_HEATERS
M84
{% endif %}
[gcode_macro status_ready]
description: Display Ready
gcode:
M117 Ready
[menu __main __octoprint]
type: list
name: OctoKlipperPi
[menu __main __octoprint __pause]
type: command
enable: {printer.idle_timeout.state == "Printing"}
name: Pause Printing
gcode:
PAUSE
[menu __main __octoprint __resume]
type: command
enable: {not printer.idle_timeout.state == "Printing"}
name: Resume Printing
gcode:
RESUME
[menu __main __octoprint __abort]
type: command
enable: {printer.idle_timeout.state == "Printing"}
name: Abort Printing
gcode:
CANCEL_PRINT
# [menu __main __control __bed_mesh]
# type: command
# enable: {not printer.idle_timeout.state == "Printing" and ('bed_mesh' in printer)}
# name: Level Bed
# gcode:
# BED_MESH_CALIBRATE
[exclude_object]
[firmware_retraction]
# retract_length: 0.8
# retract_speed: 60
# unretract_extra_length: 0
# unretract_speed: 60
[gcode_macro PAUSE]
rename_existing: BASE_PAUSE
gcode:
# Parameters
{% set z = params.Z|default(10)|int %} ; z hop amount
{% set x_park = printer.toolhead.axis_maximum.x/2 %}
{% set y_park = printer.toolhead.axis_maximum.y %}
BEEP I=2
M117 Print Paused
{% if printer['pause_resume'].is_paused|int == 0 %}
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=zhop VALUE={z} ; set z hop variable for reference in resume macro
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=etemp VALUE={printer['extruder'].target} ; set hotend temp variable for reference in resume macro
SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 ; disable filament sensor
SAVE_GCODE_STATE NAME=PAUSE ; save current print position for resume
BASE_PAUSE ; pause print
{% if (printer.gcode_move.position.z + z) < printer.toolhead.axis_maximum.z %} ; check that zhop doesn't exceed z max
G91 ; relative positioning
G1 Z{z} F900 ; raise Z up by z hop amount
{% else %}
{ action_respond_info("Pause zhop exceeds maximum Z height.") } ; if z max is exceeded, show message and set zhop value for resume to 0
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=zhop VALUE=0
{% endif %}
G90 ; absolute positioning
G1 X{x_park} Y{y_park} F6000 ; park toolhead at front center
SAVE_GCODE_STATE NAME=PAUSEPARK ; save parked position in case toolhead is moved during the pause (otherwise the return zhop can error)
M104 S0 ; turn off hotend
SET_IDLE_TIMEOUT TIMEOUT=43200 ; set timeout to 12 hours
{% endif %}
M117 Print Paused
[gcode_macro RESUME]
rename_existing: BASE_RESUME
variable_zhop: 0
variable_etemp: 0
gcode:
beep
M117 Print Resuming
# Parameters
{% set e = params.E|default(0.5)|int %} ; hotend prime amount (in mm)
{% if printer['pause_resume'].is_paused|int == 1 %}
SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1 ; enable filament sensor
SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout} ; set timeout back to configured value
{% if etemp > 150 %}
M109 S{etemp|int} ; wait for hotend to heat back up
{% endif %}
RESTORE_GCODE_STATE NAME=PAUSEPARK MOVE=1 MOVE_SPEED=100 ; go back to parked position in case toolhead was moved during pause (otherwise the return zhop can error)
RESTORE_GCODE_STATE NAME=PAUSE MOVE=1 MOVE_SPEED=60 ; restore position
; G91 ; relative positioning
M83 ; relative extruder positioning
{% if printer[printer.toolhead.extruder].temperature >= 150 %}
; G1 Z{zhop * -1} E{e} F900 ; prime nozzle by E, lower Z back down
G1 E{e} F900 ; prime nozzle by e
; {% else %}
; G1 Z{zhop * -1} F900 ; lower Z back down without priming (just in case we are testing the macro with cold hotend)
{% endif %}
BASE_RESUME ; resume print
{% endif %}
M117 Print Resuming
# Park front center
[gcode_macro PARKFRONT]
gcode:
_CG28
SAVE_GCODE_STATE NAME=PARKFRONT
G90 ; absolute positioning
G0 X{printer.toolhead.axis_maximum.x/2} Y{printer.toolhead.axis_minimum.y+5} Z{printer.toolhead.axis_maximum.z/2} F6000
RESTORE_GCODE_STATE NAME=PARKFRONT
M117 Park Front Center
# Park front center, but low down.
[gcode_macro PARKFRONTLOW]
gcode:
_CG28
SAVE_GCODE_STATE NAME=PARKFRONT
G90 ; absolute positioning
G0 X{printer.toolhead.axis_maximum.x/2} Y{printer.toolhead.axis_minimum.y+5} Z20 F6000
RESTORE_GCODE_STATE NAME=PARKFRONT
M117 Park Low Center
# Park top rear left
[gcode_macro PARKREAR]
gcode:
_CG28
SAVE_GCODE_STATE NAME=PARKREAR
G90 ; absolute positioning
G0 X{printer.toolhead.axis_minimum.x+10} Y{printer.toolhead.axis_maximum.y-10} Z{printer.toolhead.axis_maximum.z-50} F6000
RESTORE_GCODE_STATE NAME=PARKREAR
M117 Park Rear
# Park back rear far right
[gcode_macro PARKFARREAR]
gcode:
_CG28
SAVE_GCODE_STATE NAME=PARKREAR
G90 ; absolute positioning
G0 X{printer.toolhead.axis_maximum.x} Y{printer.toolhead.axis_maximum.y} Z{printer.toolhead.axis_minimum.z+20} F6000
RESTORE_GCODE_STATE NAME=PARKREAR
M117 Park Far Back
# Park at center of build volume
[gcode_macro PARKCENTER]
gcode:
_CG28
SAVE_GCODE_STATE NAME=PARKCENTER
G90 ; absolute positioning
G0 X{printer.toolhead.axis_maximum.x/2} Y{printer.toolhead.axis_maximum.y/2} Z{printer.toolhead.axis_maximum.z/2} F6000
RESTORE_GCODE_STATE NAME=PARKCENTER
M117 Park Center
# Park 15mm above center of bed
[gcode_macro PARKBED]
gcode:
_CG28
SAVE_GCODE_STATE NAME=PARKBED
G90 ; absolute positioning
G0 X{printer.toolhead.axis_maximum.x/2} Y{printer.toolhead.axis_maximum.y/2} Z15 F6000
RESTORE_GCODE_STATE NAME=PARKBED
M117 Park Bed Center
[gcode_macro PARKHIGH]
gcode:
_CG28
SAVE_GCODE_STATE NAME=PARKCENTER
G90 ; absolute positioning
G0 X{printer.toolhead.axis_maximum.x/2} Y{printer.toolhead.axis_maximum.y/2} Z180 F6000
RESTORE_GCODE_STATE NAME=PARKCENTER
M117 Park High
[gcode_macro OFF]
gcode:
M84 ; turn steppers off
TURN_OFF_HEATERS ; turn bed / hotend off
M107 ; turn print cooling fan off
#SET_FAN_SPEED FAN=Exhaust SPEED=0 ; turn exhaust fan off
#SET_FAN_SPEED FAN=BedFans SPEED=0 ; bed fan off
#SET_PIN PIN=caselight VALUE=0 ; turn case light off
[filament_switch_sensor filament_sensor]
pause_on_runout: True # This needs to be false to use runout_gcode
runout_gcode:
_filament_runout
insert_gcode:
_filament_insert
switch_pin: PC15
[gcode_macro _filament_runout]
gcode:
M117 Runout Detected
SET_IDLE_TIMEOUT TIMEOUT=10800 # Set idle_timeout to 3hrs
#M104 S0 # turn off the hotend
#SAVE_GCODE_STATE is not required as PAUSE does this automatically
# See here: https://www.klipper3d.org/G-Codes.html#pause
G91 # Relative positioning
G1 E-10 F2100 # Retract 10mm of filament
[delayed_gcode runout_wait]
gcode:
M104 S0 # turn off the hotend
M117 Runout Timout
[gcode_macro _filament_insert]
gcode:
# Get the extruder min_extrude_temp (will be 150 if not defined)
{% set TARGET = 150.0 %}
# Get the current extruder temp
{% set TEMP = printer.extruder.temperature|float %}
{% if TEMP < TARGET %}
RESPOND TYPE=error MSG="Please heat the extruder before continuing."
M117 Please heat the extruder
{% else %}
RESPOND TYPE=error MSG="Press RESUME to continue."
M117 Press RESUME to continue
{% endif %}
M117 Insert Detected
[delayed_gcode DISABLEFILAMENTSENSOR]
initial_duration: 1
gcode:
SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0
# Use this macro to heat the extruder and then resume like so:
#
# HEAT_AND_RESUME TARGET=220
#
[gcode_macro HEAT_AND_RESUME]
description: Heat the extruder and resume print when target is reached
gcode:
# Get the extruder min_extrude_temp (will be 150 if not defined)
# {% set min_target = printer.configfile.config.extruder.min_extrude_temp|float %}
# Get the target from params or set it to min_target if none is given
# {% set TARGET = params.TARGET|default(min_target)|float %}
# Heat the extruder and wait for the target to be reached
# M109 S{TARGET}
M109 S200
# Notify that print is resuming
RESPOND TYPE=error MSG="Temperature reached. Resuming print."
M117 Resuming print
# Resume print when target is reached
# This will automatically restore to the pre-PAUSE position
# See here: https://www.klipper3d.org/G-Codes.html#resume
RESUME
[pause_resume]
[gcode_arcs]
[gcode_macro BED_MESH_CALIBRATE]
rename_existing: BASE_BED_MESH_CALIBRATE
gcode:
BEEP
M150 R92 U162 B168
M140 S50
M117 Homing all axes
_CG28
M117 Heating the bed
M190 S50
BEEP I=2
M117 Creating the bed mesh levels
BASE_BED_MESH_CALIBRATE
; @BEDLEVELVISUALIZER ; instruct plugin to start recording responses from printer.
; BED_MESH_OUTPUT ; report the bed leveling mesh points.
M140 S0 ; cooling down the bed
M117 Bed mesh levels completed
beeper_tones
G90
G1 X115 Y115 F3600
SAVE_CONFIG
[gcode_macro G29]
gcode:
BED_MESH_CALIBRATE
[gcode_macro _CG28]
gcode:
{% if "xyz" not in printer.toolhead.homed_axes %}
M117 Homing Printer
G28
{% endif %}
M117 Printer Homed
[gcode_macro START_PRINT]
gcode:
{% set BED_TEMP = params.BED_TEMP|default(45)|float %}
{% set STANDBY_TEMP = params.STANDBY_TEMP|default(175)|float %}
{% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(205)|float %}
BEEP
M117 Homing
M140 S{BED_TEMP}
_CG28
M104 S{STANDBY_TEMP}
M117 Preparing Bed
CLEAR_PAUSE
SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1
# BED_MESH_PROFILE LOAD=default
M190 S{BED_TEMP}
M104 S{EXTRUDER_TEMP}
M117 Adaptive Mesh
BASE_BED_MESH_CALIBRATE ADAPTIVE=1
M117 Heating
# Set and wait for nozzle to reach temperature
M109 S{EXTRUDER_TEMP}
# Wait for bed to reach temperature
M190 S{BED_TEMP}
M117 Starting Print
# Use absolute coordinates
G90
# Reset the G-Code Z offset
SET_GCODE_OFFSET Z=0.0
# Move the nozzle near the bed
G1 Z5 F3000
beeper_tones
# G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
# G1 X0.1 Y20 Z0.3 F5000.0 ; Move to start position
# G1 X0.1 Y200.0 Z0.3 F1500.0 E15 ; Draw the first line
# M117 Printing Lines
# G1 X0.4 Y200.0 Z0.3 F5000.0 ; Move to side a little
# M117 Printing Lines
# G1 X0.4 Y20 Z0.3 F1500.0 E30 ; Draw the second line
# G92 E0 ; Reset Extruder
# G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
# G1 X5 Y20 Z0.3 F5000.0 ; Move over to prevent blob squish
M117 Printing
[gcode_macro END_PRINT]
gcode:
{% set x_park = printer.toolhead.axis_maximum.x/2 %}
{% set y_park = printer.toolhead.axis_maximum.y%}
beeper_tones
# Turn off bed, extruder, and fan
TURN_OFF_HEATERS
# Move nozzle away from print while retracting
G91
M83
G1 X-2 Y-2 E-3 F300
# Raise nozzle by 10mm
G1 Z10 F3000
G90
M82
G1 X{x_park} Y{y_park} F6000
# Disable steppers
M84
# Turn off Fans
M107
M117 Print Finished
# 8 minutes of delay to move bed to display print
# UPDATE_DELAYED_GCODE ID=display_print DURATION=10
[gcode_macro CANCEL_PRINT]
rename_existing: BASE_CANCEL_PRINT
gcode:
BEEP I=3
M117 Cancelling Print
SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout} ; set timeout back to configured value
CLEAR_PAUSE
SDCARD_RESET_FILE
# Turn off bed, extruder, and fan
TURN_OFF_HEATERS
# Move nozzle away from print while retracting
G91
M83
G1 X-2 Y-2 E-3 F300
# Raise nozzle by 10mm
G1 Z10 F3000
display_print
BASE_CANCEL_PRINT
M117 Print Cancelled
[delayed_gcode led_off]
gcode:
M150 R0 U0 B0
[delayed_gcode display_print]
gcode:
{% set x_park = printer.toolhead.axis_maximum.x/2 %}
{% set y_park = printer.toolhead.axis_maximum.y %}
G90
M82
G1 X{x_park} Y{y_park} F6000
# Disable steppers
M84
# Turn off Fans
M107
M117 Print Finished
[gcode_macro display_print]
gcode:
{% set x_park = printer.toolhead.axis_maximum.x/2 %}
{% set y_park = printer.toolhead.axis_maximum.y %}
G90
M82
G1 X{x_park} Y{y_park} F6000
# Disable steppers
M84
# Turn off Fans
M107
M117 Print Finished
[delayed_gcode ready_display]
initial_duration: 5.
gcode:
M117 Ready to Print
[gcode_macro M117]
rename_existing: M117.1
gcode:
{% if rawparams %}
{% set escaped_msg = rawparams.split(';', 1)[0].split('\x23', 1)[0]|replace('"', '\\"') %}
SET_DISPLAY_TEXT MSG="{escaped_msg}"
RESPOND TYPE=command MSG="{escaped_msg}"
{% else %}
SET_DISPLAY_TEXT
{% endif %}
[gcode_macro M0]
description: Paused at Layer
gcode:
BEEP I=4
PAUSE_M0
RESPOND TYPE=command MSG="Paused at Layer"
M117 Paused at Layer
[gcode_macro PAUSE_M0]
gcode:
# Parameters
{% set z = params.Z|default(10)|int %} ; z hop amount
{% set x_park = printer.toolhead.axis_maximum.x %}
{% set y_park = printer.toolhead.axis_maximum.y %}
M117 Print Paused
{% if printer['pause_resume'].is_paused|int == 0 %}
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=zhop VALUE={z} ; set z hop variable for reference in resume macro
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=etemp VALUE={printer['extruder'].target} ; set hotend temp variable for reference in resume macro
SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0 ; disable filament sensor
SAVE_GCODE_STATE NAME=PAUSE ; save current print position for resume
BASE_PAUSE ; pause print
{% if (printer.gcode_move.position.z + z) < printer.toolhead.axis_maximum.z %} ; check that zhop doesn't exceed z max
G91 ; relative positioning
G1 Z{z} F900 ; raise Z up by z hop amount
{% else %}
{ action_respond_info("Pause zhop exceeds maximum Z height.") } ; if z max is exceeded, show message and set zhop value for resume to 0
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=zhop VALUE=0
{% endif %}
G90 ; absolute positioning
G1 X{x_park} Y{y_park} F6000 ; park toolhead at front center
SAVE_GCODE_STATE NAME=PAUSEPARK ; save parked position in case toolhead is moved during the pause (otherwise the return zhop can error)
M104 S0 ; turn off hotend
SET_IDLE_TIMEOUT TIMEOUT=43200 ; set timeout to 12 hours
{% endif %}
M117 Print Paused
[force_move]
enable_force_move: True
[gcode_macro M600]
gcode:
PAUSE
G91 # Relative positioning
G1 E-10 F2100 # Retract 10mm of filament
[gcode_macro M486]
gcode:
# Parameters known to M486 are as follows:
# [C<flag>] Cancel the current object
# [P<index>] Cancel the object with the given index
# [S<index>] Set the index of the current object.
# If the object with the given index has been canceled, this will cause
# the firmware to skip to the next object. The value -1 is used to
# indicate something that isn’t an object and shouldn’t be skipped.
# [T<count>] Reset the state and set the number of objects
# [U<index>] Un-cancel the object with the given index. This command will be
# ignored if the object has already been skipped
{% if 'exclude_object' not in printer %}
{action_raise_error("[exclude_object] is not enabled")}
{% endif %}
{% if 'T' in params %}
EXCLUDE_OBJECT RESET=1
{% for i in range(params.T | int) %}
EXCLUDE_OBJECT_DEFINE NAME={i}
{% endfor %}
{% endif %}
{% if 'C' in params %}
EXCLUDE_OBJECT CURRENT=1
{% endif %}
{% if 'P' in params %}
EXCLUDE_OBJECT NAME={params.P}
{% endif %}
{% if 'S' in params %}
{% if params.S == '-1' %}
{% if printer.exclude_object.current_object %}
EXCLUDE_OBJECT_END NAME={printer.exclude_object.current_object}
{% endif %}
{% else %}
EXCLUDE_OBJECT_START NAME={params.S}
{% endif %}
{% endif %}
{% if 'U' in params %}
EXCLUDE_OBJECT RESET=1 NAME={params.U}
{% endif %}
[respond]
# SDCard 'looping' (aka Marlin M808 commands) support
# Support SDCard looping
[sdcard_loop]
[virtual_sdcard]
path: ~/.octoprint/uploads/
# 'Marlin' style M808 compatibility macro for SDCard looping
[gcode_macro M808]
gcode:
{% if params.K is not defined and params.L is defined %}SDCARD_LOOP_BEGIN COUNT={params.L|int}{% endif %}
{% if params.K is not defined and params.L is not defined %}SDCARD_LOOP_END{% endif %}
{% if params.K is defined and params.L is not defined %}SDCARD_LOOP_DESIST{% endif %}
[gcode_macro DUMP_VARIABLES]
gcode:
{% set filter_name = params.NAME|default('')|string|lower %}
{% set filter_value = params.VALUE|default('')|string|lower %}
{% set show_cfg = params.SHOW_CFG|default(0)|int %}
{% set out = [] %}
{% for key1 in printer %}
{% for key2 in printer[key1] %}
{% if (show_cfg or not (key1|lower == 'configfile' and key2|lower in ['config', 'settings'])) and (filter_name in key1|lower or filter_name in key2|lower) and filter_value in printer[key1][key2]|string|lower %}
{% set dummy = out.append("printer['%s'].%s = %s" % (key1, key2, printer[key1][key2])) %}
{% endif %}
{% else %}
{% if filter_name in key1|lower and filter_value in printer[key1]|string|lower %}
{% set dummy = out.append("printer['%s'] = %s" % (key1, printer[key1])) %}
{% endif %}
{% endfor %}
{% endfor %}
{action_respond_info(out|join("\n"))}
[gcode_macro GET_VARIABLE]
gcode:
{% set names = (params.NAME).split('.')|list %}
{% set join = (params.JOIN)|default(1)|int %}
{% set _dummy0 = namespace( break = 0 ) %}
{% set _dummy1 = namespace( out = printer[names|first] ) %}
{% for name in names if _dummy0.break == 0 %}
{% if loop.index > 1 %}
{% if name in _dummy1.out %}
{% set _dummy1.out = _dummy1.out[name] %}
{% elif name[0] in '0123456789' and _dummy1.out is iterable and _dummy1.out is not string and _dummy1.out is not mapping and _dummy1.out|length > name[0]|int %}
{% set _dummy1.out = _dummy1.out[name|int] %}
{% else %}
{% set _dummy0.break = loop.index0 %}
{% endif %}
{% endif %}
{% endfor %}
{% if _dummy1.out is boolean %}
{ action_respond_info('Type: boolean') }
{% elif _dummy1.out is float %}
{ action_respond_info('Type: float') }
{% elif _dummy1.out is integer %}
{ action_respond_info('Type: integer') }
{% elif _dummy1.out is mapping %}
{ action_respond_info('Type: mapping') }
{% elif _dummy1.out is string %}
{ action_respond_info('Type: string') }
{% elif _dummy1.out is iterable %}
{ action_respond_info('Type: iterable') }
{% elif _dummy1.out is none %}
{ action_respond_info('Type: none') }
{% elif _dummy1.out is undefined %}
{ action_respond_info('Type: undefined') }
{% elif _dummy1.out is callable %}
{ action_respond_info('Type: callable') }
{% else %}
{ action_respond_info('Type: unknown') }
{% endif %}
{% if join and _dummy1.out is iterable and _dummy1.out is not string and _dummy1.out is not mapping %}
{ action_respond_info('%s' % _dummy1.out|join("\n")) }
{% else %}
{ action_respond_info('%s' % _dummy1.out) }
{% endif %}
{% if _dummy0.break != 0 %}
{ action_respond_info('"printer.%s" does not contain "%s"!' % (names[0:_dummy0.break]|join('.'), names[_dummy0.break])) }
{% endif %}
[gcode_macro SHUTDOWN]
gcode:
OFF ; Shortcut to turn everything off (see above for this macro)
{action_respond_info('action:poweroff')} ; OctoPrint compatible host shutdown
[menu __main __setup __shutdown]
type: command
enable: {not printer.idle_timeout.state == "Printing"}
name: Shut down
gcode: SHUTDOWN
[screws_tilt_adjust]
screw1: 76, 32
screw1_name: Front left
screw2: 246, 32
screw2_name: Front right
screw3: 246, 202
screw3_name: Back right
screw4: 76, 202
screw4_name: Back left
screw_thread: CW-M4
horizontal_move_z: 10.
speed: 50.
# Beeper Tones
[gcode_macro SONG_STARWARS_IMP]
gcode:
M300 S1174 P401
M300 S1174 P401
M300 S1174 P401
M300 S466 P267
M300 S1396 P133
M300 S1174 P401
M300 S466 P267
M300 S1396 P133
M300 S1174 P803
[gcode_macro Song_Simpsons]
gcode:
M300 P563 S523
M300 P375 S659
M300 P375 S740
M300 P188 S880
M300 P563 S784
M300 P375 S659
M300 P375 S523
M300 P188 S440
M300 P188 S370
M300 P188 S370
M300 P188 S370
M300 P750 S392
M300 P375 S0
M300 P188 S370
M300 P188 S370
M300 P188 S370
M300 P188 S392
M300 P563 S466
M300 P188 S523
M300 P188 S523
M300 P188 S523
M300 P375 S523
[gcode_macro SONG_LOONEY]
gcode:
M300 S2093 P428
M300 S2793 P214
M300 S2637 P214
M300 S2349 P214
M300 S2093 P214
M300 S880 P642
M300 S2093 P214
M300 S2793 P214
M300 S2637 P214
M300 S2349 P214
M300 S2489 P214
M300 S2637 P642
M300 S2637 P214
M300 S2637 P214
M300 S2093 P214
M300 S2349 P214
M300 S2093 P214
M300 S2637 P214
M300 S2093 P214
M300 S2349 P214
M300 S880 P214
M300 S2093 P214
M300 S1567 P214
M300 S932 P214
M300 S880 P214
M300 S1396 P214
[gcode_macro led_off]
gcode:
M150 R0 U0 B0
[gcode_macro led_white]
gcode:
M150 R255 U255 B255
[gcode_macro led_red]
gcode:
M150 R255 U0 B0
[gcode_macro led_green]
gcode:
M150 R0 U255 B0
[gcode_macro led_blue]
gcode:
M150 R0 U0 B255
[gcode_macro led_orange]
gcode:
M150 R255 U196 B0
[gcode_macro led_cyan]
gcode:
M150 R0 U255 B255
[gcode_macro led_purple]
gcode:
M150 R180 U0 B255
[gcode_macro led_yellow]
gcode:
M150 R255 U255 B
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [bed_mesh default]
#*# version = 1
#*# points =
#*# -0.122218, -0.087218, -0.034718, -0.019718, -0.022218
#*# -0.029718, -0.062218, -0.037218, -0.009718, -0.054718
#*# 0.035282, 0.005282, 0.000282, 0.022782, -0.037218
#*# 0.035282, -0.049718, -0.049718, -0.029718, -0.092218
#*# -0.084718, -0.092218, -0.099718, -0.077218, -0.124718
#*# tension = 0.2
#*# min_x = 10.0
#*# algo = bicubic
#*# y_count = 5
#*# mesh_y_pps = 3
#*# min_y = 10.0
#*# x_count = 5
#*# max_y = 215.0
#*# mesh_x_pps = 2
#*# max_x = 185.0
#*#
#*# [bltouch]
#*# z_offset = 1.017
#*#
#*# [extruder]
#*# control = pid
#*# pid_kp = 22.325
#*# pid_ki = 1.071
#*# pid_kd = 116.372
#*#
#*# [heater_bed]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment