From 9936f71ebd2ed0aa866cb649cd371fa50816b401 Mon Sep 17 00:00:00 2001 From: suchmememanyskill <38142618+suchmememanyskill@users.noreply.github.com> Date: Sun, 4 Oct 2026 21:02:21 +0200 Subject: [PATCH 1/8] [unverified] split cc1 and cc2 cosmos.conf --- .../config-manager/config-manager_0.1.bb | 5 +- .../centauri-carbon-1/default-machine.conf | 49 +++++++++++++++++++ .../centauri-carbon-2/default-machine.conf | 47 ++++++++++++++++++ .../config-manager/files/config_manager.py | 24 +++++---- 4 files changed, 115 insertions(+), 10 deletions(-) create mode 100644 meta-opencentauri/recipes-data/config-manager/files/centauri-carbon-1/default-machine.conf create mode 100644 meta-opencentauri/recipes-data/config-manager/files/centauri-carbon-2/default-machine.conf diff --git a/meta-opencentauri/recipes-data/config-manager/config-manager_0.1.bb b/meta-opencentauri/recipes-data/config-manager/config-manager_0.1.bb index 08dcd19e..1b3851cd 100644 --- a/meta-opencentauri/recipes-data/config-manager/config-manager_0.1.bb +++ b/meta-opencentauri/recipes-data/config-manager/config-manager_0.1.bb @@ -8,6 +8,7 @@ SRC_URI = " \ file://config_manager.py \ file://build-klipper-var-config.sh \ file://default.conf \ + file://default-machine.conf \ " S = "${UNPACKDIR}" @@ -19,10 +20,11 @@ do_install() { sed -i -e 's,@MACHINE@,${MACHINE},g' ${D}${bindir}/build-klipper-var-config install -d ${D}${sysconfdir}/klipper/config - install -m 0644 ${S}/default.conf ${D}${sysconfdir}/klipper/config/cosmos.conf + install -m 0644 ${S}/default-machine.conf ${D}${sysconfdir}/klipper/config/cosmos.conf install -d ${D}${datadir}/config-manager install -m 0644 ${S}/default.conf ${D}${datadir}/config-manager/default.conf + install -m 0644 ${S}/default-machine.conf ${D}${datadir}/config-manager/default-machine.conf } FILES:${PN} = " \ @@ -30,6 +32,7 @@ FILES:${PN} = " \ ${bindir}/build-klipper-var-config \ ${sysconfdir}/klipper/config/cosmos.conf \ ${datadir}/config-manager/default.conf \ + ${datadir}/config-manager/default-machine.conf \ " RDEPENDS:${PN} = "python3-core" diff --git a/meta-opencentauri/recipes-data/config-manager/files/centauri-carbon-1/default-machine.conf b/meta-opencentauri/recipes-data/config-manager/files/centauri-carbon-1/default-machine.conf new file mode 100644 index 00000000..05c9f1a4 --- /dev/null +++ b/meta-opencentauri/recipes-data/config-manager/files/centauri-carbon-1/default-machine.conf @@ -0,0 +1,49 @@ +# OpenCentauri COSMOS settings. +# Changes to these settings require rebooting the entire machine to apply. +# Power cycle the machine or run the REBOOT_MACHINE macro after editing. + +[ui] +# User interface used on the built in screen. Options: grumpyscreen, none. +screen_ui = grumpyscreen +# User interface used for the webui. Options: mainsail, fluidd. +web_ui = mainsail +# Brightness of the built in screen. Range: 0-100. +screen_brightness = 100 + +[update] +# Update channel used by the COSMOS updater. Options: stable, nightly. +release = stable +# Check for updates automatically on startup. Options: True, False. +check_for_updates = True + +[extras] +# Enable support for the CANVAS unit. Also enables the AFC subsystem. +elegoo_canvas = False + +[klipper] +# Keep the camera LED state in sync with the chamber LED. +sync_camera_led_to_chamber_led = False +# Turn the camera LED on automatically when Klipper starts. +camera_led_default_on = True +# Allow printing before the initial calibration checks have passed. +bypass_calibration = False +# Minutes to wait after the bed reaches temperature before starting a print. Range: 0-30 minutes. +heatsoak = 1 +# Probe only the print area for each print instead of loading the default bed mesh. Requires nozzle_z_homing to be enabled. +adaptive_mesh = False +# Prime the nozzle near the print area before each print. +adaptive_purge = True +# Unload filament automatically when a print finishes. +unload_after_print = False +# Clean the nozzle automatically when a print finishes. +clean_nozzle_after_print = True +# Use the nozzle and load cell probe for Z homing. +nozzle_z_homing = False +# Drop the bed to this height in millimeters when a print finishes. Range: 0-256. +z_ideal_lifting_distance = 170 +# Hotend temperature in Celsius used during the full calibration workflow. Range: 200-300. +full_calibrate_hotend_temperature = 250 +# Bed temperature in Celsius used during the full calibration workflow. Range: 40-100. +full_calibrate_bed_temperature = 60 +# Turn on Toolhead LED for printing and loading filament +toolhead_led = False diff --git a/meta-opencentauri/recipes-data/config-manager/files/centauri-carbon-2/default-machine.conf b/meta-opencentauri/recipes-data/config-manager/files/centauri-carbon-2/default-machine.conf new file mode 100644 index 00000000..34225fc6 --- /dev/null +++ b/meta-opencentauri/recipes-data/config-manager/files/centauri-carbon-2/default-machine.conf @@ -0,0 +1,47 @@ +# OpenCentauri COSMOS settings. +# Changes to these settings require rebooting the entire machine to apply. +# Power cycle the machine or run the REBOOT_MACHINE macro after editing. + +[ui] +# User interface used on the built in screen. Options: grumpyscreen, none. +screen_ui = grumpyscreen +# User interface used for the webui. Options: mainsail, fluidd. +web_ui = mainsail +# Brightness of the built in screen. Range: 0-100. +screen_brightness = 100 + +[update] +# Update channel used by the COSMOS updater. Options: stable, nightly. +release = stable +# Check for updates automatically on startup. Options: True, False. +check_for_updates = True + +[extras] +# Enable support for the CANVAS unit. Also enables the AFC subsystem. +elegoo_canvas = False + +[klipper] +# Keep the camera LED state in sync with the chamber LED. +sync_camera_led_to_chamber_led = False +# Turn the camera LED on automatically when Klipper starts. +camera_led_default_on = True +# Allow printing before the initial calibration checks have passed. +bypass_calibration = False +# Minutes to wait after the bed reaches temperature before starting a print. Range: 0-30 minutes. +heatsoak = 1 +# Probe only the print area for each print instead of loading the default bed mesh. Requires nozzle_z_homing to be enabled. +adaptive_mesh = False +# Prime the nozzle near the print area before each print. +adaptive_purge = True +# Unload filament automatically when a print finishes. +unload_after_print = False +# Clean the nozzle automatically when a print finishes. +clean_nozzle_after_print = True +# Use the nozzle and load cell probe for Z homing. +nozzle_z_homing = False +# Drop the bed to this height in millimeters when a print finishes. Range: 0-256. +z_ideal_lifting_distance = 170 +# Hotend temperature in Celsius used during the full calibration workflow. Range: 200-300. +full_calibrate_hotend_temperature = 250 +# Bed temperature in Celsius used during the full calibration workflow. Range: 40-100. +full_calibrate_bed_temperature = 60 diff --git a/meta-opencentauri/recipes-data/config-manager/files/config_manager.py b/meta-opencentauri/recipes-data/config-manager/files/config_manager.py index 4c4c961c..b3fb434c 100644 --- a/meta-opencentauri/recipes-data/config-manager/files/config_manager.py +++ b/meta-opencentauri/recipes-data/config-manager/files/config_manager.py @@ -33,6 +33,7 @@ VARIABLE_CONFIG_PATH = '/etc/klipper/config/cosmos.conf' DEFAULT_CONFIG_PATH = '/usr/share/config-manager/default.conf' +MACHINE_CONFIG_PATH = '/usr/share/config-manager/default-machine.conf' def validate_config(config : dict): for section, options in VALIDATORS.items(): @@ -147,9 +148,9 @@ def merge_configs(default_config : dict, user_config : dict) -> dict: return default_config def main(section : str, option : str, value : str|None = None): - default_config = load_config(DEFAULT_CONFIG_PATH) - default_comments = load_config_comments(DEFAULT_CONFIG_PATH) - default_header = load_config_header(DEFAULT_CONFIG_PATH) + machine_config = load_config(MACHINE_CONFIG_PATH) + machine_comments = load_config_comments(MACHINE_CONFIG_PATH) + machine_header = load_config_header(MACHINE_CONFIG_PATH) user_config = load_config(VARIABLE_CONFIG_PATH) if value is not None: if section not in user_config: @@ -157,15 +158,20 @@ def main(section : str, option : str, value : str|None = None): user_config[section][option] = value normalize_boolean_values(user_config) validate_config(user_config) - merged_config = merge_configs(default_config, user_config) + merged_config = merge_configs(machine_config, user_config) - if user_config != merged_config or config_needs_update(VARIABLE_CONFIG_PATH, merged_config, default_comments, default_header): - save_config(VARIABLE_CONFIG_PATH, merged_config, default_comments, default_header) + if user_config != merged_config or config_needs_update(VARIABLE_CONFIG_PATH, merged_config, machine_comments, machine_header): + save_config(VARIABLE_CONFIG_PATH, merged_config, machine_comments, machine_header) - if section not in merged_config or option not in merged_config[section]: - raise ValueError(f"Option '{option}' not found in section '{section}'") + if section in merged_config and option in merged_config[section]: + result = merged_config[section][option] + else: + global_config = load_config(DEFAULT_CONFIG_PATH) + if section not in global_config or option not in global_config[section]: + raise ValueError(f"Option '{option}' not found in section '{section}'") + result = global_config[section][option] - print(merged_config[section][option], end='') + print(result, end='') if __name__ == "__main__": if len(sys.argv) not in (3, 4): From 9c324b5ae46a283d2cf4e40476c5074bc9479c1b Mon Sep 17 00:00:00 2001 From: suchmememanyskill <38142618+suchmememanyskill@users.noreply.github.com> Date: Mon, 5 Oct 2026 22:32:11 +0200 Subject: [PATCH 2/8] Merge canvas-toolhead.cfg with canvas.cfg on CC2 --- .../recipes-data/klipper-afc-addon/afc_0.1.bb | 16 ++++++++++++---- .../files/centauri-carbon-2/canvas-toolhead.cfg | 11 ----------- .../files/centauri-carbon-2/canvas.cfg | 13 ++++++++++++- 3 files changed, 24 insertions(+), 16 deletions(-) delete mode 100644 meta-opencentauri/recipes-data/klipper-afc-addon/files/centauri-carbon-2/canvas-toolhead.cfg diff --git a/meta-opencentauri/recipes-data/klipper-afc-addon/afc_0.1.bb b/meta-opencentauri/recipes-data/klipper-afc-addon/afc_0.1.bb index 6f0acbe5..34dfe485 100644 --- a/meta-opencentauri/recipes-data/klipper-afc-addon/afc_0.1.bb +++ b/meta-opencentauri/recipes-data/klipper-afc-addon/afc_0.1.bb @@ -9,12 +9,13 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/files:" SRC_URI = " \ git://github.com/suchmememanyskill/AFC-Klipper-Add-On.git;protocol=https;branch=DEV \ file://afc.cfg \ - file://canvas-toolhead.cfg \ file://canvas.cfg \ file://boxturtle.cfg \ file://canvas_rfid.cfg \ " +SRC_URI:append:centauri-carbon-1 = " file://canvas-toolhead.cfg" + SRCREV = "484a09b4c16674b586bf33035f1ab1b9dccc67b9" DEPENDS = " \ @@ -36,7 +37,11 @@ do_install() { # Install config files install -d ${D}${sysconfdir}/klipper/config/extras-readonly - install -m 0644 ${UNPACKDIR}/canvas.cfg ${UNPACKDIR}/canvas_rfid.cfg ${UNPACKDIR}/afc.cfg ${UNPACKDIR}/canvas-toolhead.cfg ${UNPACKDIR}/boxturtle.cfg ${D}${sysconfdir}/klipper/config/extras-readonly + install -m 0644 ${UNPACKDIR}/canvas.cfg ${UNPACKDIR}/canvas_rfid.cfg ${UNPACKDIR}/afc.cfg ${UNPACKDIR}/boxturtle.cfg ${D}${sysconfdir}/klipper/config/extras-readonly +} + +do_install:append:centauri-carbon-1() { + install -m 0644 ${UNPACKDIR}/canvas-toolhead.cfg ${D}${sysconfdir}/klipper/config/extras-readonly } FILES:${PN} = " \ @@ -76,7 +81,10 @@ FILES:${PN} = " \ ${datadir}/klipper/klippy/extras/AFC_EMU.py \ ${sysconfdir}/klipper/config/extras-readonly/afc.cfg \ ${sysconfdir}/klipper/config/extras-readonly/canvas.cfg \ - ${sysconfdir}/klipper/config/extras-readonly/canvas-toolhead.cfg \ ${sysconfdir}/klipper/config/extras-readonly/boxturtle.cfg \ ${sysconfdir}/klipper/config/extras-readonly/canvas_rfid.cfg \ -" \ No newline at end of file +" + +FILES:${PN}:append:centauri-carbon-1 = " \ + ${sysconfdir}/klipper/config/extras-readonly/canvas-toolhead.cfg \ +" diff --git a/meta-opencentauri/recipes-data/klipper-afc-addon/files/centauri-carbon-2/canvas-toolhead.cfg b/meta-opencentauri/recipes-data/klipper-afc-addon/files/centauri-carbon-2/canvas-toolhead.cfg deleted file mode 100644 index 77829c0c..00000000 --- a/meta-opencentauri/recipes-data/klipper-afc-addon/files/centauri-carbon-2/canvas-toolhead.cfg +++ /dev/null @@ -1,11 +0,0 @@ -[gcode_button toolhead_tangle_detection] -pin: !hotend:PA1 -debounce_delay: 0.5 -press_gcode: - RESPOND TYPE=echo MSG="Filament tangle detected!" - - {% if printer.print_stats.state == "printing" %} - PAUSE - {% endif %} -release_gcode: - RESPOND TYPE=echo MSG="Filament tangle has been resolved" diff --git a/meta-opencentauri/recipes-data/klipper-afc-addon/files/centauri-carbon-2/canvas.cfg b/meta-opencentauri/recipes-data/klipper-afc-addon/files/centauri-carbon-2/canvas.cfg index 2607ff10..c10c1a42 100644 --- a/meta-opencentauri/recipes-data/klipper-afc-addon/files/centauri-carbon-2/canvas.cfg +++ b/meta-opencentauri/recipes-data/klipper-afc-addon/files/centauri-carbon-2/canvas.cfg @@ -4,7 +4,6 @@ # ----- [include afc.cfg] -[include canvas-toolhead.cfg] [gcode_macro _AFC_GLOBAL_VARS] variable_stepper_name: 'CANVAS_' @@ -189,3 +188,15 @@ clear_spool_after_eject: False [pwm_cycle_time _buzzer_canvas] pin: canvas:PC15 + +[gcode_button toolhead_tangle_detection] +pin: !hotend:PA1 +debounce_delay: 0.5 +press_gcode: + RESPOND TYPE=echo MSG="Filament tangle detected!" + + {% if printer.print_stats.state == "printing" %} + PAUSE + {% endif %} +release_gcode: + RESPOND TYPE=echo MSG="Filament tangle has been resolved" \ No newline at end of file From 250b56374a5962d729d373000ce4a99efafd1d3d Mon Sep 17 00:00:00 2001 From: suchmememanyskill <38142618+suchmememanyskill@users.noreply.github.com> Date: Mon, 5 Oct 2026 22:47:36 +0200 Subject: [PATCH 3/8] Split C2 and CC2 config (untested) --- .../files/centauri-carbon-2/enclosed.cfg | 48 +++++++++++++++++++ .../files/centauri-carbon-2/machine.cfg | 43 ----------------- .../klipper/files/shared-macros.cfg | 4 +- .../recipes-apps/klipper/kalico_2026.02.00.bb | 7 +++ .../ustreamer/files/ustreamer-init-d | 8 +++- .../files/build-klipper-var-config.sh | 8 +++- .../centauri-carbon-2/default-machine.conf | 2 + .../config-manager/files/config_manager.py | 1 + .../config-manager/files/default.conf | 2 + 9 files changed, 75 insertions(+), 48 deletions(-) create mode 100644 meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/enclosed.cfg diff --git a/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/enclosed.cfg b/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/enclosed.cfg new file mode 100644 index 00000000..79aa49e9 --- /dev/null +++ b/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/enclosed.cfg @@ -0,0 +1,48 @@ +# ----- +# PLEASE DO NOT EDIT THIS FILE. EDIT printer.cfg INSTEAD. +# UPDATES WILL RESET THIS FILE. YOUR EDITS WILL BE LOST WHEN UPDATING. +# ----- + +[fan_generic aux_fan] +pin: PD15 +tachometer_pin: PD14 + +[fan_generic case_fan] +pin: PD17 +tachometer_pin: PD16 + +[servo case_servo] +pin: PB7 +initial_angle: 90.0 + +[gcode_button case_servo_sensor] +pin: PB2 +press_gcode: + UPDATE_DELAYED_GCODE ID=case_servo_timeout DURATION=0 + G4 P400 ; We have no way to detect when the fan cover is fully open. Instead, the sensor triggers somewhere halfway, and around 400ms is needed to fully open it. + SET_SERVO SERVO=case_servo ANGLE=90 +release_gcode: + UPDATE_DELAYED_GCODE ID=case_servo_timeout DURATION=0 + SET_SERVO SERVO=case_servo ANGLE=90 + +[delayed_gcode case_servo_timeout] +gcode: + SET_SERVO SERVO=case_servo ANGLE=90 + RESPOND TYPE=error MSG="Servo timeout: sensor did not change" + +[gcode_macro EXHAUST_OPEN] +gcode: + {% if printer["gcode_button case_servo_sensor"].state == "PRESSED" %} ; Currently closed + RESPOND MSG="Opening exhaust cover" + UPDATE_DELAYED_GCODE ID=case_servo_timeout DURATION=5 + SET_SERVO SERVO=case_servo ANGLE=135 + {% endif %} + +[gcode_macro EXHAUST_CLOSE] +gcode: + {% if printer["gcode_button case_servo_sensor"].state == "RELEASED" %} ; Currently open + RESPOND MSG="Closing exhaust cover" + UPDATE_DELAYED_GCODE ID=case_servo_timeout DURATION=5 + SET_SERVO SERVO=case_servo ANGLE=45 + {% endif %} + diff --git a/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/machine.cfg b/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/machine.cfg index c32b08fe..bc480cfd 100644 --- a/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/machine.cfg +++ b/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/machine.cfg @@ -375,49 +375,6 @@ pullup_resistor: 22000 min_temp: 0 max_temp: 125 -[fan_generic aux_fan] -pin: PD15 -tachometer_pin: PD14 - -[fan_generic case_fan] -pin: PD17 -tachometer_pin: PD16 - -[servo case_servo] -pin: PB7 -initial_angle: 90.0 - -[gcode_button case_servo_sensor] -pin: PB2 -press_gcode: - UPDATE_DELAYED_GCODE ID=case_servo_timeout DURATION=0 - G4 P400 ; We have no way to detect when the fan cover is fully open. Instead, the sensor triggers somewhere halfway, and around 400ms is needed to fully open it. - SET_SERVO SERVO=case_servo ANGLE=90 -release_gcode: - UPDATE_DELAYED_GCODE ID=case_servo_timeout DURATION=0 - SET_SERVO SERVO=case_servo ANGLE=90 - -[delayed_gcode case_servo_timeout] -gcode: - SET_SERVO SERVO=case_servo ANGLE=90 - RESPOND TYPE=error MSG="Servo timeout: sensor did not change" - -[gcode_macro EXHAUST_OPEN] -gcode: - {% if printer["gcode_button case_servo_sensor"].state == "PRESSED" %} ; Currently closed - RESPOND MSG="Opening exhaust cover" - UPDATE_DELAYED_GCODE ID=case_servo_timeout DURATION=5 - SET_SERVO SERVO=case_servo ANGLE=135 - {% endif %} - -[gcode_macro EXHAUST_CLOSE] -gcode: - {% if printer["gcode_button case_servo_sensor"].state == "RELEASED" %} ; Currently open - RESPOND MSG="Closing exhaust cover" - UPDATE_DELAYED_GCODE ID=case_servo_timeout DURATION=5 - SET_SERVO SERVO=case_servo ANGLE=45 - {% endif %} - [temperature_fan mainboard] pin: PG15 tachometer_pin: PB9 diff --git a/meta-opencentauri/recipes-apps/klipper/files/shared-macros.cfg b/meta-opencentauri/recipes-apps/klipper/files/shared-macros.cfg index 04638900..a72a64e8 100644 --- a/meta-opencentauri/recipes-apps/klipper/files/shared-macros.cfg +++ b/meta-opencentauri/recipes-apps/klipper/files/shared-macros.cfg @@ -782,9 +782,9 @@ gcode: {% if index == 1 %} # Part cooling fan M006 S{speed} - {% elif index == 2 %} # Aux cooling fan + {% elif index == 2 and 'fan_generic aux_fan' in printer %} # Aux cooling fan SET_FAN_SPEED FAN=aux_fan SPEED={nspeed} - {% elif index == 3 %} # Exhaust fan + {% elif index == 3 and 'fan_generic case_fan' in printer %} # Exhaust fan SET_FAN_SPEED FAN=case_fan SPEED={nspeed} {% else %} {action_raise_error("Invalid fan index")} diff --git a/meta-opencentauri/recipes-apps/klipper/kalico_2026.02.00.bb b/meta-opencentauri/recipes-apps/klipper/kalico_2026.02.00.bb index 66dda624..89af82ed 100644 --- a/meta-opencentauri/recipes-apps/klipper/kalico_2026.02.00.bb +++ b/meta-opencentauri/recipes-apps/klipper/kalico_2026.02.00.bb @@ -20,6 +20,8 @@ SRC_URI += " \ file://client.cfg \ " +SRC_URI:append:centauri-carbon-2 = " file://enclosed.cfg" + inherit python3-dir update-rc.d RDEPENDS:${PN} = " \ @@ -113,6 +115,11 @@ do_install() { install -m 0755 ${UNPACKDIR}/klipper-init-d ${D}${sysconfdir}/init.d/klipper } +do_install:append:centauri-carbon-2() { + install -d ${D}${sysconfdir}/klipper/config/extras-readonly + install -m 0644 ${UNPACKDIR}/enclosed.cfg ${D}${sysconfdir}/klipper/config/extras-readonly/ +} + FILES:${PN} = " \ ${datadir}/klipper \ ${sysconfdir}/init.d/klipper \ diff --git a/meta-opencentauri/recipes-apps/ustreamer/files/ustreamer-init-d b/meta-opencentauri/recipes-apps/ustreamer/files/ustreamer-init-d index b513fcfe..bb42913c 100644 --- a/meta-opencentauri/recipes-apps/ustreamer/files/ustreamer-init-d +++ b/meta-opencentauri/recipes-apps/ustreamer/files/ustreamer-init-d @@ -9,11 +9,17 @@ ### END INIT INFO USTREAMER_EXEC="/usr/bin/ustreamer" -USTREAMER_ARGS="-r 864x480 -c HW -m MJPEG -b 1 -w 1 -f 10 -l --host=0.0.0.0 --allow-origin=*" +CAMERA_DEVICE="/dev/video0" +USTREAMER_ARGS="-d $CAMERA_DEVICE -r 864x480 -c HW -m MJPEG -b 1 -w 1 -f 10 -l --host=0.0.0.0 --allow-origin=*" PIDFILE="/var/run/ustreamer.pid" case "$1" in start) + if [ ! -c "$CAMERA_DEVICE" ]; then + echo "Skipping ustreamer: camera device $CAMERA_DEVICE is unavailable." + exit 0 + fi + echo "Starting ustreamer..." start-stop-daemon -S -b -m -p $PIDFILE \ -x $USTREAMER_EXEC -- $USTREAMER_ARGS diff --git a/meta-opencentauri/recipes-data/config-manager/files/build-klipper-var-config.sh b/meta-opencentauri/recipes-data/config-manager/files/build-klipper-var-config.sh index 1a387074..c9e29c98 100644 --- a/meta-opencentauri/recipes-data/config-manager/files/build-klipper-var-config.sh +++ b/meta-opencentauri/recipes-data/config-manager/files/build-klipper-var-config.sh @@ -28,6 +28,7 @@ toolhead_led=$(get_config_value toolhead_led) elegoo_canvas=$("${CONFIG_MANAGER}" extras elegoo_canvas) check_for_updates=$("${CONFIG_MANAGER}" update check_for_updates) release=$("${CONFIG_MANAGER}" update release) +enclosed=$("${CONFIG_MANAGER}" extras enclosed) mkdir -p "${OUTPUT_DIR}" @@ -63,6 +64,10 @@ if [ "${elegoo_canvas}" = "True" ]; then echo "[include ../extras-readonly/canvas.cfg]" >> "${EXTRAS_OUTPUT_FILE}" fi +if [ "${enclosed}" = "True" ]; then + echo "[include ../extras-readonly/enclosed.cfg]" >> "${EXTRAS_OUTPUT_FILE}" +fi + cat > "${MOONRAKER_UPDATE_FILE}" <> "${MOONRAKER_UPDATE_FILE}" fi -fi - +fi \ No newline at end of file diff --git a/meta-opencentauri/recipes-data/config-manager/files/centauri-carbon-2/default-machine.conf b/meta-opencentauri/recipes-data/config-manager/files/centauri-carbon-2/default-machine.conf index 34225fc6..ba84a572 100644 --- a/meta-opencentauri/recipes-data/config-manager/files/centauri-carbon-2/default-machine.conf +++ b/meta-opencentauri/recipes-data/config-manager/files/centauri-carbon-2/default-machine.conf @@ -19,6 +19,8 @@ check_for_updates = True [extras] # Enable support for the CANVAS unit. Also enables the AFC subsystem. elegoo_canvas = False +# Enable the aux and exhaust fans and exhaust servo, available only on the CC2 and CC2C. +enclosed = False [klipper] # Keep the camera LED state in sync with the chamber LED. diff --git a/meta-opencentauri/recipes-data/config-manager/files/config_manager.py b/meta-opencentauri/recipes-data/config-manager/files/config_manager.py index b3fb434c..9203b5dc 100644 --- a/meta-opencentauri/recipes-data/config-manager/files/config_manager.py +++ b/meta-opencentauri/recipes-data/config-manager/files/config_manager.py @@ -13,6 +13,7 @@ }, 'extras': { 'elegoo_canvas': ['True', 'False'], + 'enclosed': ['True', 'False'], }, 'klipper': { 'sync_camera_led_to_chamber_led': ['True', 'False'], diff --git a/meta-opencentauri/recipes-data/config-manager/files/default.conf b/meta-opencentauri/recipes-data/config-manager/files/default.conf index 05c9f1a4..bb38cc1a 100644 --- a/meta-opencentauri/recipes-data/config-manager/files/default.conf +++ b/meta-opencentauri/recipes-data/config-manager/files/default.conf @@ -19,6 +19,8 @@ check_for_updates = True [extras] # Enable support for the CANVAS unit. Also enables the AFC subsystem. elegoo_canvas = False +# Enable the aux and exhaust fans and exhaust servo, available only on the CC2 and CC2C. +enclosed = False [klipper] # Keep the camera LED state in sync with the chamber LED. From d611fa80d7b6beb595fb4e7deb8aecfab25e747e Mon Sep 17 00:00:00 2001 From: suchmememanyskill <38142618+suchmememanyskill@users.noreply.github.com> Date: Mon, 5 Oct 2026 22:49:31 +0200 Subject: [PATCH 4/8] Move canvas-toolhead.cfg from afc folder to klipper's folder --- .../files/centauri-carbon-1/canvas-toolhead.cfg | 0 .../recipes-apps/klipper/kalico_2026.02.00.bb | 6 ++++++ .../recipes-data/klipper-afc-addon/afc_0.1.bb | 10 ---------- 3 files changed, 6 insertions(+), 10 deletions(-) rename meta-opencentauri/{recipes-data/klipper-afc-addon => recipes-apps/klipper}/files/centauri-carbon-1/canvas-toolhead.cfg (100%) diff --git a/meta-opencentauri/recipes-data/klipper-afc-addon/files/centauri-carbon-1/canvas-toolhead.cfg b/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-1/canvas-toolhead.cfg similarity index 100% rename from meta-opencentauri/recipes-data/klipper-afc-addon/files/centauri-carbon-1/canvas-toolhead.cfg rename to meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-1/canvas-toolhead.cfg diff --git a/meta-opencentauri/recipes-apps/klipper/kalico_2026.02.00.bb b/meta-opencentauri/recipes-apps/klipper/kalico_2026.02.00.bb index 89af82ed..804ce9de 100644 --- a/meta-opencentauri/recipes-apps/klipper/kalico_2026.02.00.bb +++ b/meta-opencentauri/recipes-apps/klipper/kalico_2026.02.00.bb @@ -20,6 +20,7 @@ SRC_URI += " \ file://client.cfg \ " +SRC_URI:append:centauri-carbon-1 = " file://canvas-toolhead.cfg" SRC_URI:append:centauri-carbon-2 = " file://enclosed.cfg" inherit python3-dir update-rc.d @@ -115,6 +116,11 @@ do_install() { install -m 0755 ${UNPACKDIR}/klipper-init-d ${D}${sysconfdir}/init.d/klipper } +do_install:append:centauri-carbon-1() { + install -d ${D}${sysconfdir}/klipper/config/extras-readonly + install -m 0644 ${UNPACKDIR}/canvas-toolhead.cfg ${D}${sysconfdir}/klipper/config/extras-readonly/ +} + do_install:append:centauri-carbon-2() { install -d ${D}${sysconfdir}/klipper/config/extras-readonly install -m 0644 ${UNPACKDIR}/enclosed.cfg ${D}${sysconfdir}/klipper/config/extras-readonly/ diff --git a/meta-opencentauri/recipes-data/klipper-afc-addon/afc_0.1.bb b/meta-opencentauri/recipes-data/klipper-afc-addon/afc_0.1.bb index 34dfe485..d3046ef5 100644 --- a/meta-opencentauri/recipes-data/klipper-afc-addon/afc_0.1.bb +++ b/meta-opencentauri/recipes-data/klipper-afc-addon/afc_0.1.bb @@ -14,8 +14,6 @@ SRC_URI = " \ file://canvas_rfid.cfg \ " -SRC_URI:append:centauri-carbon-1 = " file://canvas-toolhead.cfg" - SRCREV = "484a09b4c16674b586bf33035f1ab1b9dccc67b9" DEPENDS = " \ @@ -40,10 +38,6 @@ do_install() { install -m 0644 ${UNPACKDIR}/canvas.cfg ${UNPACKDIR}/canvas_rfid.cfg ${UNPACKDIR}/afc.cfg ${UNPACKDIR}/boxturtle.cfg ${D}${sysconfdir}/klipper/config/extras-readonly } -do_install:append:centauri-carbon-1() { - install -m 0644 ${UNPACKDIR}/canvas-toolhead.cfg ${D}${sysconfdir}/klipper/config/extras-readonly -} - FILES:${PN} = " \ ${datadir}/klipper/klippy/extras/AFC_buffer.py \ ${datadir}/klipper/klippy/extras/AFC_stats.py \ @@ -84,7 +78,3 @@ FILES:${PN} = " \ ${sysconfdir}/klipper/config/extras-readonly/boxturtle.cfg \ ${sysconfdir}/klipper/config/extras-readonly/canvas_rfid.cfg \ " - -FILES:${PN}:append:centauri-carbon-1 = " \ - ${sysconfdir}/klipper/config/extras-readonly/canvas-toolhead.cfg \ -" From a7105df0d9ab7055f754093e5c5fd32fc8fc552e Mon Sep 17 00:00:00 2001 From: suchmememanyskill <38142618+suchmememanyskill@users.noreply.github.com> Date: Tue, 6 Oct 2026 20:35:30 +0200 Subject: [PATCH 5/8] Remove led from default cc2 cfg, remove stale cc1 camera led options --- .../klipper/files/centauri-carbon-2/enclosed.cfg | 7 +++++-- .../klipper/files/centauri-carbon-2/machine.cfg | 4 ---- .../files/centauri-carbon-2/default-machine.conf | 4 ---- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/enclosed.cfg b/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/enclosed.cfg index 79aa49e9..9a30dd16 100644 --- a/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/enclosed.cfg +++ b/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/enclosed.cfg @@ -15,6 +15,10 @@ tachometer_pin: PD16 pin: PB7 initial_angle: 90.0 +[led case] +white_pin: PB5 +initial_WHITE: 1 + [gcode_button case_servo_sensor] pin: PB2 press_gcode: @@ -44,5 +48,4 @@ gcode: RESPOND MSG="Closing exhaust cover" UPDATE_DELAYED_GCODE ID=case_servo_timeout DURATION=5 SET_SERVO SERVO=case_servo ANGLE=45 - {% endif %} - + {% endif %} \ No newline at end of file diff --git a/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/machine.cfg b/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/machine.cfg index bc480cfd..9eb06c0b 100644 --- a/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/machine.cfg +++ b/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-2/machine.cfg @@ -364,10 +364,6 @@ runout_gcode: PAUSE {% endif %} -[led case] -white_pin: PB5 -initial_WHITE: 1 - [temperature_sensor chamber] sensor_pin: PB13 sensor_type: NTC 100K beta 3950 diff --git a/meta-opencentauri/recipes-data/config-manager/files/centauri-carbon-2/default-machine.conf b/meta-opencentauri/recipes-data/config-manager/files/centauri-carbon-2/default-machine.conf index ba84a572..b34c73d6 100644 --- a/meta-opencentauri/recipes-data/config-manager/files/centauri-carbon-2/default-machine.conf +++ b/meta-opencentauri/recipes-data/config-manager/files/centauri-carbon-2/default-machine.conf @@ -23,10 +23,6 @@ elegoo_canvas = False enclosed = False [klipper] -# Keep the camera LED state in sync with the chamber LED. -sync_camera_led_to_chamber_led = False -# Turn the camera LED on automatically when Klipper starts. -camera_led_default_on = True # Allow printing before the initial calibration checks have passed. bypass_calibration = False # Minutes to wait after the bed reaches temperature before starting a print. Range: 0-30 minutes. From 30a5edface69a8b713f4ecc9015836e3e8a87755 Mon Sep 17 00:00:00 2001 From: suchmememanyskill <38142618+suchmememanyskill@users.noreply.github.com> Date: Tue, 6 Oct 2026 22:19:33 +0200 Subject: [PATCH 6/8] Clean up configs a little --- .../centauri-carbon-2/default-machine.conf | 2 +- .../config-manager/files/default.conf | 24 ------------------- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/meta-opencentauri/recipes-data/config-manager/files/centauri-carbon-2/default-machine.conf b/meta-opencentauri/recipes-data/config-manager/files/centauri-carbon-2/default-machine.conf index b34c73d6..6aede88a 100644 --- a/meta-opencentauri/recipes-data/config-manager/files/centauri-carbon-2/default-machine.conf +++ b/meta-opencentauri/recipes-data/config-manager/files/centauri-carbon-2/default-machine.conf @@ -19,7 +19,7 @@ check_for_updates = True [extras] # Enable support for the CANVAS unit. Also enables the AFC subsystem. elegoo_canvas = False -# Enable the aux and exhaust fans and exhaust servo, available only on the CC2 and CC2C. +# Enable the aux fan, exhaust fan and chamber light. Available only on the CC2 and CC2C. enclosed = False [klipper] diff --git a/meta-opencentauri/recipes-data/config-manager/files/default.conf b/meta-opencentauri/recipes-data/config-manager/files/default.conf index bb38cc1a..9f9a19a0 100644 --- a/meta-opencentauri/recipes-data/config-manager/files/default.conf +++ b/meta-opencentauri/recipes-data/config-manager/files/default.conf @@ -1,51 +1,27 @@ -# OpenCentauri COSMOS settings. -# Changes to these settings require rebooting the entire machine to apply. -# Power cycle the machine or run the REBOOT_MACHINE macro after editing. - [ui] -# User interface used on the built in screen. Options: grumpyscreen, none. screen_ui = grumpyscreen -# User interface used for the webui. Options: mainsail, fluidd. web_ui = mainsail -# Brightness of the built in screen. Range: 0-100. screen_brightness = 100 [update] -# Update channel used by the COSMOS updater. Options: stable, nightly. release = stable -# Check for updates automatically on startup. Options: True, False. check_for_updates = True [extras] -# Enable support for the CANVAS unit. Also enables the AFC subsystem. elegoo_canvas = False -# Enable the aux and exhaust fans and exhaust servo, available only on the CC2 and CC2C. enclosed = False [klipper] -# Keep the camera LED state in sync with the chamber LED. sync_camera_led_to_chamber_led = False -# Turn the camera LED on automatically when Klipper starts. camera_led_default_on = True -# Allow printing before the initial calibration checks have passed. bypass_calibration = False -# Minutes to wait after the bed reaches temperature before starting a print. Range: 0-30 minutes. heatsoak = 1 -# Probe only the print area for each print instead of loading the default bed mesh. Requires nozzle_z_homing to be enabled. adaptive_mesh = False -# Prime the nozzle near the print area before each print. adaptive_purge = True -# Unload filament automatically when a print finishes. unload_after_print = False -# Clean the nozzle automatically when a print finishes. clean_nozzle_after_print = True -# Use the nozzle and load cell probe for Z homing. nozzle_z_homing = False -# Drop the bed to this height in millimeters when a print finishes. Range: 0-256. z_ideal_lifting_distance = 170 -# Hotend temperature in Celsius used during the full calibration workflow. Range: 200-300. full_calibrate_hotend_temperature = 250 -# Bed temperature in Celsius used during the full calibration workflow. Range: 40-100. full_calibrate_bed_temperature = 60 -# Turn on Toolhead LED for printing and loading filament toolhead_led = False From 3a37256d6a6651cd5f7a05ae47b0dc2aa276626b Mon Sep 17 00:00:00 2001 From: suchmememanyskill <38142618+suchmememanyskill@users.noreply.github.com> Date: Wed, 7 Oct 2026 17:14:09 +0200 Subject: [PATCH 7/8] Remove duplicate cosmos.conf file, take first value from the validator instead --- .../config-manager/config-manager_0.1.bb | 3 --- .../config-manager/files/config_manager.py | 23 ++++++++-------- .../config-manager/files/default.conf | 27 ------------------- 3 files changed, 11 insertions(+), 42 deletions(-) delete mode 100644 meta-opencentauri/recipes-data/config-manager/files/default.conf diff --git a/meta-opencentauri/recipes-data/config-manager/config-manager_0.1.bb b/meta-opencentauri/recipes-data/config-manager/config-manager_0.1.bb index 1b3851cd..5e5a202f 100644 --- a/meta-opencentauri/recipes-data/config-manager/config-manager_0.1.bb +++ b/meta-opencentauri/recipes-data/config-manager/config-manager_0.1.bb @@ -7,7 +7,6 @@ PACKAGE_ARCH = "${MACHINE_ARCH}" SRC_URI = " \ file://config_manager.py \ file://build-klipper-var-config.sh \ - file://default.conf \ file://default-machine.conf \ " @@ -23,7 +22,6 @@ do_install() { install -m 0644 ${S}/default-machine.conf ${D}${sysconfdir}/klipper/config/cosmos.conf install -d ${D}${datadir}/config-manager - install -m 0644 ${S}/default.conf ${D}${datadir}/config-manager/default.conf install -m 0644 ${S}/default-machine.conf ${D}${datadir}/config-manager/default-machine.conf } @@ -31,7 +29,6 @@ FILES:${PN} = " \ ${bindir}/config-manager \ ${bindir}/build-klipper-var-config \ ${sysconfdir}/klipper/config/cosmos.conf \ - ${datadir}/config-manager/default.conf \ ${datadir}/config-manager/default-machine.conf \ " diff --git a/meta-opencentauri/recipes-data/config-manager/files/config_manager.py b/meta-opencentauri/recipes-data/config-manager/files/config_manager.py index 9203b5dc..6b180850 100644 --- a/meta-opencentauri/recipes-data/config-manager/files/config_manager.py +++ b/meta-opencentauri/recipes-data/config-manager/files/config_manager.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 import os, configparser, sys +# The first valid value is the fallback when no configured default is present. VALIDATORS = { 'ui': { 'screen_ui': ['grumpyscreen', 'guppyscreen', 'atomscreen', 'none'], @@ -12,28 +13,27 @@ 'check_for_updates': ['True', 'False'], }, 'extras': { - 'elegoo_canvas': ['True', 'False'], - 'enclosed': ['True', 'False'], + 'elegoo_canvas': ['False', 'True'], + 'enclosed': ['False', 'True'], }, 'klipper': { - 'sync_camera_led_to_chamber_led': ['True', 'False'], + 'sync_camera_led_to_chamber_led': ['False', 'True'], 'camera_led_default_on': ['True', 'False'], - 'bypass_calibration': ['True', 'False'], + 'bypass_calibration': ['False', 'True'], 'heatsoak': [str(x / 10) for x in range(100)] + [str(x) for x in range(31)], - 'adaptive_mesh': ['True', 'False'], + 'adaptive_mesh': ['False', 'True'], 'adaptive_purge': ['True', 'False'], - 'unload_after_print': ['True', 'False'], + 'unload_after_print': ['False', 'True'], 'clean_nozzle_after_print': ['True', 'False'], - 'nozzle_z_homing': ['True', 'False'], + 'nozzle_z_homing': ['False', 'True'], 'z_ideal_lifting_distance': [str(i) for i in range(257)], 'full_calibrate_hotend_temperature': [str(i) for i in range(200, 301)], 'full_calibrate_bed_temperature': [str(i) for i in range(30, 111)], - 'toolhead_led': ['True', 'False'], + 'toolhead_led': ['False', 'True'], }, } VARIABLE_CONFIG_PATH = '/etc/klipper/config/cosmos.conf' -DEFAULT_CONFIG_PATH = '/usr/share/config-manager/default.conf' MACHINE_CONFIG_PATH = '/usr/share/config-manager/default-machine.conf' def validate_config(config : dict): @@ -167,10 +167,9 @@ def main(section : str, option : str, value : str|None = None): if section in merged_config and option in merged_config[section]: result = merged_config[section][option] else: - global_config = load_config(DEFAULT_CONFIG_PATH) - if section not in global_config or option not in global_config[section]: + if section not in VALIDATORS or option not in VALIDATORS[section]: raise ValueError(f"Option '{option}' not found in section '{section}'") - result = global_config[section][option] + result = VALIDATORS[section][option][0] print(result, end='') diff --git a/meta-opencentauri/recipes-data/config-manager/files/default.conf b/meta-opencentauri/recipes-data/config-manager/files/default.conf deleted file mode 100644 index 9f9a19a0..00000000 --- a/meta-opencentauri/recipes-data/config-manager/files/default.conf +++ /dev/null @@ -1,27 +0,0 @@ -[ui] -screen_ui = grumpyscreen -web_ui = mainsail -screen_brightness = 100 - -[update] -release = stable -check_for_updates = True - -[extras] -elegoo_canvas = False -enclosed = False - -[klipper] -sync_camera_led_to_chamber_led = False -camera_led_default_on = True -bypass_calibration = False -heatsoak = 1 -adaptive_mesh = False -adaptive_purge = True -unload_after_print = False -clean_nozzle_after_print = True -nozzle_z_homing = False -z_ideal_lifting_distance = 170 -full_calibrate_hotend_temperature = 250 -full_calibrate_bed_temperature = 60 -toolhead_led = False From 66c8ab91c1d9976cbb9c2495de98d73a9e77734b Mon Sep 17 00:00:00 2001 From: suchmememanyskill <38142618+suchmememanyskill@users.noreply.github.com> Date: Wed, 7 Oct 2026 17:15:35 +0200 Subject: [PATCH 8/8] Move toolhead_tangle_detection to canvas cfg --- .../files/centauri-carbon-1/canvas-toolhead.cfg | 12 ------------ .../files/centauri-carbon-1/canvas.cfg | 12 ++++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-1/canvas-toolhead.cfg b/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-1/canvas-toolhead.cfg index c6b21198..600f5c5c 100644 --- a/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-1/canvas-toolhead.cfg +++ b/meta-opencentauri/recipes-apps/klipper/files/centauri-carbon-1/canvas-toolhead.cfg @@ -48,17 +48,5 @@ press_gcode: release_gcode: RESPOND TYPE=echo MSG="Front cover has been re-attached" -[gcode_button toolhead_tangle_detection] -pin: !hotend:PB0 -debounce_delay: 0.5 -press_gcode: - RESPOND TYPE=echo MSG="Filament tangle detected!" - - {% if printer.print_stats.state == "printing" %} - PAUSE - {% endif %} -release_gcode: - RESPOND TYPE=echo MSG="Filament tangle has been resolved" - [extruder] pulldown_resistor: 100000 diff --git a/meta-opencentauri/recipes-data/klipper-afc-addon/files/centauri-carbon-1/canvas.cfg b/meta-opencentauri/recipes-data/klipper-afc-addon/files/centauri-carbon-1/canvas.cfg index 92fd423d..b56232a1 100644 --- a/meta-opencentauri/recipes-data/klipper-afc-addon/files/centauri-carbon-1/canvas.cfg +++ b/meta-opencentauri/recipes-data/klipper-afc-addon/files/centauri-carbon-1/canvas.cfg @@ -192,3 +192,15 @@ sensor_mcu: canvas [pwm_cycle_time _buzzer_canvas] pin: canvas:PB13 + +[gcode_button toolhead_tangle_detection] +pin: !hotend:PB0 +debounce_delay: 0.5 +press_gcode: + RESPOND TYPE=echo MSG="Filament tangle detected!" + + {% if printer.print_stats.state == "printing" %} + PAUSE + {% endif %} +release_gcode: + RESPOND TYPE=echo MSG="Filament tangle has been resolved" \ No newline at end of file