133 lines
4.5 KiB
Plaintext
133 lines
4.5 KiB
Plaintext
[server]
|
|
host: 0.0.0.0
|
|
port: %PORT%
|
|
klippy_uds_address: %UDS%
|
|
|
|
[authorization]
|
|
trusted_clients:
|
|
%LAN%
|
|
10.0.0.0/8
|
|
127.0.0.0/8
|
|
169.254.0.0/16
|
|
172.16.0.0/12
|
|
192.168.0.0/16
|
|
FE80::/10
|
|
::1/128
|
|
cors_domains:
|
|
*.lan
|
|
*.local
|
|
*://localhost
|
|
*://localhost:*
|
|
*://my.mainsail.xyz
|
|
*://app.fluidd.xyz
|
|
|
|
[octoprint_compat]
|
|
|
|
[history]
|
|
|
|
[power Printer]
|
|
type: gpio
|
|
pin: gpiochip4/gpio13
|
|
initial_state: on
|
|
off_when_shutdown: true
|
|
off_when_shutdown_delay: 86400
|
|
on_when_job_queued: true
|
|
locked_while_printing: true
|
|
restart_klipper_when_powered: true
|
|
# restart_delay: 1
|
|
bound_services:
|
|
klipper
|
|
KlipperScreen
|
|
|
|
[button switch_button]
|
|
type: gpio
|
|
pin: ^gpiochip4/gpio12
|
|
debounce_period: .02
|
|
minimum_event_time: 0
|
|
on_press:
|
|
{% if event.elapsed_time > 5.0 %}
|
|
{% do call_method("machine.shutdown") %}
|
|
{% endif %}
|
|
on_release:
|
|
{% do call_method("machine.device_power.post_device", device="Printer", action="toggle") %}
|
|
|
|
[button power_outage]
|
|
type: gpio
|
|
pin: ^!gpiochip4/gpio19
|
|
debounce_period: .01
|
|
minimum_event_time: 0
|
|
on_press:
|
|
{% set query_objs = {"print_stats": ["state"], "toolhead": ["extruder"], "gcode_move": ["gcode_position"], "virtual_sdcard": ["file_path"]} %}
|
|
{% set status = call_method("printer.objects.query", objects=query_objs) %}
|
|
{% do call_method("printer.emergency_stop") %}
|
|
{% set data = status | tojson | fromjson %}
|
|
{% set print_state = data['status']['print_stats']['state'] %}
|
|
# Judging the printer status
|
|
{% if print_state | string == 'printing' or print_state | string == 'paused' %}
|
|
{% set x_position = data['status']['gcode_move']['gcode_position'][0] %}
|
|
{% set y_position = data['status']['gcode_move']['gcode_position'][1] %}
|
|
{% set z_position = data['status']['gcode_move']['gcode_position'][2] %}
|
|
{% set hotend = data['status']['toolhead']['extruder'] %}
|
|
{% set filepath = data['status']['virtual_sdcard']['file_path'] %}
|
|
{% set filename = filepath.split('/')[-1] %}
|
|
# save position
|
|
{% if print_state | string == 'printing' %}
|
|
{% do call_method("printer.gcode.script", script="SAVE_VARIABLE VARIABLE=power_resume_x VALUE=" + x_position | string) %}
|
|
{% do call_method("printer.gcode.script", script="SAVE_VARIABLE VARIABLE=power_resume_y VALUE=" + y_position | string) %}
|
|
{% do call_method("printer.gcode.script", script="SAVE_VARIABLE VARIABLE=power_resume_z VALUE=" + z_position | string) %}
|
|
{% do call_method("printer.gcode.script", script="SAVE_VARIABLE VARIABLE=power_loss_paused VALUE=False") %}
|
|
{% elif print_state | string == 'paused' %}
|
|
{% do call_method("printer.gcode.script", script="SAVE_VARIABLE VARIABLE=power_loss_paused VALUE=True") %}
|
|
{% endif%}
|
|
# save extruder
|
|
{% do call_method("printer.gcode.script", script="SAVE_VARIABLE VARIABLE=power_resume_extruder VALUE=\"'" + hotend | string + "'\"") %}
|
|
# save file
|
|
{% do call_method("printer.gcode.script", script="SAVE_VARIABLE VARIABLE=filepath VALUE=\"'" + filepath | string + "'\"") %}
|
|
{% do call_method("printer.gcode.script", script="SAVE_VARIABLE VARIABLE=last_file VALUE=\"'" + filename | string + "'\"") %}
|
|
# save interrupt
|
|
{% do call_method("printer.gcode.script", script="SAVE_VARIABLE VARIABLE=was_interrupted VALUE=True") %}
|
|
{% else %}
|
|
{% do call_method("printer.gcode.script", script="SAVE_VARIABLE VARIABLE=was_interrupted VALUE=False") %}
|
|
{% endif %}
|
|
# shutdown
|
|
{% do call_method("machine.shutdown") %}
|
|
|
|
[update_manager]
|
|
channel: stable
|
|
refresh_interval: 168
|
|
|
|
[update_manager klipper]
|
|
channel: stable
|
|
pinned_commit: e554ddb83c770a668a912d0e6ad23c1069bf6710
|
|
|
|
[update_manager KlipperScreen]
|
|
type: git_repo
|
|
path: /home/klipper/KlipperScreen
|
|
origin: https://github.com/CreatBotOfficail/CreatBotKlipperScreen.git
|
|
env: /home/klipper/.KlipperScreen-env/bin/python
|
|
requirements: scripts/KlipperScreen-requirements.txt
|
|
install_script: scripts/KlipperScreen-install.sh
|
|
channel: stable
|
|
pinned_commit: 629416d1f255f79f02a0341702bbc9bb8db694cb
|
|
|
|
[update_manager mainsail-config]
|
|
type: git_repo
|
|
primary_branch: master
|
|
path: ~/mainsail-config
|
|
origin: https://github.com/mainsail-crew/mainsail-config.git
|
|
managed_services: klipper
|
|
|
|
[update_manager mainsail]
|
|
type: web
|
|
channel: stable
|
|
repo: mainsail-crew/mainsail
|
|
path: ~/mainsail
|
|
|
|
# Crowsnest update_manager entry
|
|
[update_manager crowsnest]
|
|
type: git_repo
|
|
path: ~/crowsnest
|
|
origin: https://github.com/CreatBotOfficail/CreatBotCrowsnest.git
|
|
managed_services: crowsnest
|
|
install_script: tools/pkglist.sh
|