From 1b90607b385f176c86fd265b584b7e3d39e1e065 Mon Sep 17 00:00:00 2001 From: Stephan Wendel Date: Wed, 8 Nov 2023 20:00:53 +0100 Subject: [PATCH 01/10] chore: limit sbc's to rpi and bananpi m1 Signed-off-by: Stephan Wendel --- .github/workflow_config.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflow_config.yml b/.github/workflow_config.yml index 292eafac3..a47da4a6b 100644 --- a/.github/workflow_config.yml +++ b/.github/workflow_config.yml @@ -17,23 +17,24 @@ buildtest: # armbian based images - armbian/bananapim2zero - - armbian/orangepi3lts - - armbian/orangepi4lts + # - armbian/orangepi3lts + # - armbian/orangepi4lts # Orange Pi OS based images - - orangepi/orangepi_zero2 + # - orangepi/orangepi_zero2 # Raspberry Pi OS based images - - raspberry/rpi32 + # - raspberry/rpi32 - raspberry/rpi64 # This is used to setup release build chain. # Each entry will be used in setup matrix for releases release: + - armbian/bananapim2zero # armbian based images - - armbian/orangepi3lts - - armbian/orangepi4lts + # - armbian/orangepi3lts + # - armbian/orangepi4lts # Orange Pi OS based images - - orangepi/orangepi_zero2 + # - orangepi/orangepi_zero2 # Raspberry Pi OS based images - - raspberry/rpi32 + # - raspberry/rpi32 - raspberry/rpi64 From 4ff0c6af5de8d9e3d59b18925bedee2169e10140 Mon Sep 17 00:00:00 2001 From: Stephan Wendel Date: Wed, 8 Nov 2023 20:58:09 +0100 Subject: [PATCH 02/10] chore: build the100 prototype Signed-off-by: Stephan Wendel --- .../root/etc/update-motd.d/10-mainsailos | 2 +- src/modules/vendor_overlay/config | 15 + .../printer_data/Firmware-config/config | 58 ++ .../overlay/printer_data/config/Readme.md | 27 + .../overlay/printer_data/config/fluidd.cfg | 229 +++++++ .../overlay/printer_data/config/printer.cfg | 599 ++++++++++++++++++ .../vendor_overlay/start_chroot_script | 32 + 7 files changed, 961 insertions(+), 1 deletion(-) create mode 100644 src/modules/vendor_overlay/config create mode 100644 src/modules/vendor_overlay/overlay/printer_data/Firmware-config/config create mode 100644 src/modules/vendor_overlay/overlay/printer_data/config/Readme.md create mode 100644 src/modules/vendor_overlay/overlay/printer_data/config/fluidd.cfg create mode 100644 src/modules/vendor_overlay/overlay/printer_data/config/printer.cfg create mode 100644 src/modules/vendor_overlay/start_chroot_script diff --git a/src/modules/armbian/filesystem/root/etc/update-motd.d/10-mainsailos b/src/modules/armbian/filesystem/root/etc/update-motd.d/10-mainsailos index 127314f74..61d279889 100755 --- a/src/modules/armbian/filesystem/root/etc/update-motd.d/10-mainsailos +++ b/src/modules/armbian/filesystem/root/etc/update-motd.d/10-mainsailos @@ -16,7 +16,7 @@ # shellcheck enable=require-variable-braces # shellcheck disable=SC1091 -[[ -f /etc/armbian-release-info.txt ]] && . /etc/armbian-release-info.txt +[[ -f /etc/armbian-release ]] && . /etc/armbian-release if [[ -f /etc/armbian-distribution-status ]]; then . /etc/armbian-distribution-status diff --git a/src/modules/vendor_overlay/config b/src/modules/vendor_overlay/config new file mode 100644 index 000000000..8f7d81b23 --- /dev/null +++ b/src/modules/vendor_overlay/config @@ -0,0 +1,15 @@ +#!/bin/bash +#### vendor_overlay module +#### +#### Written by Stephan Wendel aka KwadFan +#### Copyright 2021 - till today +#### https://github.com/mainsail-crew/crowsnest +#### +#### This File is other than usual licensed under the http://www.wtfpl.net/ +#### This means this is only an example on how to deliver your own configurations +#### Feel free to modify to your needs. +#### A short hint that it is based on my work would be nice but isnt crucial :) +#### +# shellcheck disable=all + +# Intentionally left blank for later use ... diff --git a/src/modules/vendor_overlay/overlay/printer_data/Firmware-config/config b/src/modules/vendor_overlay/overlay/printer_data/Firmware-config/config new file mode 100644 index 000000000..828abe344 --- /dev/null +++ b/src/modules/vendor_overlay/overlay/printer_data/Firmware-config/config @@ -0,0 +1,58 @@ +CONFIG_LOW_LEVEL_OPTIONS=y +# CONFIG_MACH_AVR is not set +# CONFIG_MACH_ATSAM is not set +# CONFIG_MACH_ATSAMD is not set +# CONFIG_MACH_LPC176X is not set +# CONFIG_MACH_STM32 is not set +# CONFIG_MACH_HC32F460 is not set +CONFIG_MACH_RP2040=y +# CONFIG_MACH_PRU is not set +# CONFIG_MACH_AR100 is not set +# CONFIG_MACH_LINUX is not set +# CONFIG_MACH_SIMU is not set +CONFIG_BOARD_DIRECTORY="rp2040" +CONFIG_MCU="rp2040" +CONFIG_CLOCK_FREQ=12000000 +CONFIG_SERIAL=y +CONFIG_FLASH_SIZE=0x200000 +CONFIG_FLASH_BOOT_ADDRESS=0x10000100 +CONFIG_RAM_START=0x20000000 +CONFIG_RAM_SIZE=0x42000 +CONFIG_STACK_SIZE=512 +CONFIG_FLASH_APPLICATION_ADDRESS=0x10000100 +CONFIG_RP2040_SELECT=y +CONFIG_RP2040_HAVE_STAGE2=y +CONFIG_RP2040_FLASH_START_0100=y +# CONFIG_RP2040_FLASH_START_4000 is not set +CONFIG_RP2040_FLASH_W25Q080=y +# CONFIG_RP2040_FLASH_GENERIC_03 is not set +CONFIG_RP2040_STAGE2_FILE="boot2_w25q080.S" +CONFIG_RP2040_STAGE2_CLKDIV=2 +# CONFIG_RP2040_USB is not set +CONFIG_RP2040_SERIAL_UART0=y +# CONFIG_RP2040_CANBUS is not set +# CONFIG_RP2040_USBCANBUS is not set +CONFIG_RP2040_CANBUS_GPIO_RX=4 +CONFIG_RP2040_CANBUS_GPIO_TX=5 +CONFIG_SERIAL_BAUD=250000 +CONFIG_USB_VENDOR_ID=0x1d50 +CONFIG_USB_DEVICE_ID=0x614e +CONFIG_USB_SERIAL_NUMBER="12345" +CONFIG_WANT_GPIO_BITBANGING=y +CONFIG_WANT_DISPLAYS=y +CONFIG_WANT_SENSORS=y +CONFIG_WANT_LIS2DW=y +CONFIG_WANT_SOFTWARE_I2C=y +CONFIG_WANT_SOFTWARE_SPI=y +CONFIG_CANBUS_FREQUENCY=1000000 +CONFIG_INITIAL_PINS="" +CONFIG_HAVE_GPIO=y +CONFIG_HAVE_GPIO_ADC=y +CONFIG_HAVE_GPIO_SPI=y +CONFIG_HAVE_GPIO_I2C=y +CONFIG_HAVE_GPIO_HARD_PWM=y +CONFIG_HAVE_STRICT_TIMING=y +CONFIG_HAVE_CHIPID=y +CONFIG_HAVE_STEPPER_BOTH_EDGE=y +CONFIG_HAVE_BOOTLOADER_REQUEST=y +CONFIG_INLINE_STEPPER_HACK=y diff --git a/src/modules/vendor_overlay/overlay/printer_data/config/Readme.md b/src/modules/vendor_overlay/overlay/printer_data/config/Readme.md new file mode 100644 index 000000000..c1370131c --- /dev/null +++ b/src/modules/vendor_overlay/overlay/printer_data/config/Readme.md @@ -0,0 +1,27 @@ +# Steps to do + +- Kiss your girlfriend/boyfriend +- Thank her/him for being patient with your hobby +- Flash the mcu + +## How to flash the mcu? + +- Copy over the `config` file from `Firmware-config` + +```bash +cp -v ~/printer_data_config/Firmware-config/config ~/klipper/.config +``` + +- Run firmware build process by + +```bash +cd ~/klipper +make -j$(nproc) +``` + +- Flash firmware to mcu + Mount bla fooo .... + +--- + +**Normally, you don't need to reboot, but for the sake of completness, please reboot once!** diff --git a/src/modules/vendor_overlay/overlay/printer_data/config/fluidd.cfg b/src/modules/vendor_overlay/overlay/printer_data/config/fluidd.cfg new file mode 100644 index 000000000..a13de98c8 --- /dev/null +++ b/src/modules/vendor_overlay/overlay/printer_data/config/fluidd.cfg @@ -0,0 +1,229 @@ +## Client klipper macro definitions +## +## Copyright (C) 2022 Alex Zellner +## +## This file may be distributed under the terms of the GNU GPLv3 license +## +## !!! This file is read-only. Maybe the used editor indicates that. !!! +## +## Customization: +## 1) copy the gcode_macro _CLIENT_VARIABLE (see below) to your printer.cfg +## 2) remove the comment mark (#) from all lines +## 3) change any value in there to your needs +## +## Use the PAUSE macro direct in your M600: +## e.g. with a different park position front left and a minimal height of 50 +## [gcode_macro M600] +## description: Filament change +## gcode: PAUSE X=10 Y=10 Z_MIN=50 +## Z_MIN will park the toolhead at a minimum of 50 mm above to bed to make it easier for you to swap filament. +## +## Client variable macro for your printer.cfg +#[gcode_macro _CLIENT_VARIABLE] +#variable_use_custom_pos : False ; use custom park coordinates for x,y [True/False] +#variable_custom_park_x : 0.0 ; custom x position; value must be within your defined min and max of X +#variable_custom_park_y : 0.0 ; custom y position; value must be within your defined min and max of Y +#variable_custom_park_dz : 2.0 ; custom dz value; the value in mm to lift the nozzle when move to park position +#variable_retract : 1.0 ; the value to retract while PAUSE +#variable_cancel_retract : 5.0 ; the value to retract while CANCEL_PRINT +#variable_speed_retract : 35.0 ; retract speed in mm/s +#variable_unretract : 1.0 ; the value to unretract while RESUME +#variable_speed_unretract : 35.0 ; unretract speed in mm/s +#variable_speed_hop : 15.0 ; z move speed in mm/s +#variable_speed_move : 100.0 ; move speed in mm/s +#variable_park_at_cancel : False ; allow to move the toolhead to park while execute CANCEL_PRINT [True/False] +#variable_park_at_cancel_x : None ; different park position during CANCEL_PRINT [None/Position as Float]; park_at_cancel must be True +#variable_park_at_cancel_y : None ; different park position during CANCEL_PRINT [None/Position as Float]; park_at_cancel must be True +## !!! Caution [firmware_retraction] must be defined in the printer.cfg if you set use_fw_retract: True !!! +#variable_use_fw_retract : False ; use fw_retraction instead of the manual version [True/False] +#variable_idle_timeout : 0 ; time in sec until idle_timeout kicks in. Value 0 means that no value will be set or restored +#gcode: + +[virtual_sdcard] +path: ~/printer_data/gcodes +on_error_gcode: CANCEL_PRINT + +[pause_resume] + +[display_status] + +[gcode_macro CANCEL_PRINT] +description: Cancel the actual running print +rename_existing: CANCEL_PRINT_BASE +gcode: + ##### get user parameters or use default ##### + {% set client = printer['gcode_macro _CLIENT_VARIABLE'] | default({}) %} + {% set allow_park = client.park_at_cancel | default(false) | lower == 'true' %} + {% set retract = client.cancel_retract | default(5.0) | abs %} + ##### define park position ##### + {% set park_x = "" if (client.park_at_cancel_x | default(none) is none) + else "X=" ~ client.park_at_cancel_x %} + {% set park_y = "" if (client.park_at_cancel_y | default(none) is none) + else "Y=" ~ client.park_at_cancel_y %} + {% set custom_park = park_x | length > 0 or park_y | length > 0 %} + ##### end of definitions ##### + # restore idle_timeout time if needed + {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %} + SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout} + {% endif %} + {% if (custom_park or not printer.pause_resume.is_paused) and allow_park %} _TOOLHEAD_PARK_PAUSE_CANCEL {park_x} {park_y} {% endif %} + _CLIENT_RETRACT LENGTH={retract} + TURN_OFF_HEATERS + M106 S0 + # clear pause_next_layer and pause_at_layer as preparation for next print + SET_PAUSE_NEXT_LAYER ENABLE=0 + SET_PAUSE_AT_LAYER ENABLE=0 LAYER=0 + CANCEL_PRINT_BASE + +[gcode_macro PAUSE] +description: Pause the actual running print +rename_existing: PAUSE_BASE +variable_restore_idle_timeout: 0 +gcode: + ##### get user parameters or use default ##### + {% set client = printer['gcode_macro _CLIENT_VARIABLE'] | default({}) %} + {% set idle_timeout = client.idle_timeout | default(0) %} + ##### end of definitions ##### + SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE={printer[printer.toolhead.extruder].target} + # set a new idle_timeout value + {% if idle_timeout > 0 %} + SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout} + SET_IDLE_TIMEOUT TIMEOUT={idle_timeout} + {% endif %} + PAUSE_BASE + _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams} + +[gcode_macro RESUME] +description: Resume the actual running print +rename_existing: RESUME_BASE +variable_last_extruder_temp: 0 +gcode: + ##### get user parameters or use default ##### + {% set client = printer['gcode_macro _CLIENT_VARIABLE'] | default({}) %} + {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} + {% set sp_move = client.speed_move | default(velocity) %} + ##### end of definitions ##### + # restore idle_timeout time if needed + {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %} + SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout} + {% endif %} + M109 S{last_extruder_temp} + _CLIENT_EXTRUDE + RESUME_BASE VELOCITY={params.VELOCITY | default(sp_move)} + +# Usage: SET_PAUSE_NEXT_LAYER [ENABLE=[0 | 1]] [MACRO=] +[gcode_macro SET_PAUSE_NEXT_LAYER] +description: Enable a pause if the next layer is reached +gcode: + {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} + {% set ENABLE = params.ENABLE | default(1) | int != 0 %} + {% set MACRO = params.MACRO | default(pause_next_layer.call, True) %} + SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" + +# Usage: SET_PAUSE_AT_LAYER [ENABLE=[0 | 1]] [LAYER=] [MACRO=] +[gcode_macro SET_PAUSE_AT_LAYER] +description: Enable/disable a pause if a given layer number is reached +gcode: + {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} + {% set ENABLE = params.ENABLE | int != 0 if params.ENABLE is defined + else params.LAYER is defined %} + {% set LAYER = params.LAYER | default(pause_at_layer.layer) | int %} + {% set MACRO = params.MACRO | default(pause_at_layer.call, True) %} + SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" + +# Usage: SET_PRINT_STATS_INFO [TOTAL_LAYER=] [CURRENT_LAYER= ] +[gcode_macro SET_PRINT_STATS_INFO] +rename_existing: SET_PRINT_STATS_INFO_BASE +description: Overwrite, to get pause_next_layer and pause_at_layer feature +variable_pause_next_layer: { 'enable': False, 'call': "PAUSE" } +variable_pause_at_layer : { 'enable': False, 'layer': 0, 'call': "PAUSE" } +gcode: + {% if pause_next_layer.enable %} + {action_respond_info("%s, forced by pause_next_layer" % pause_next_layer.call)} + {pause_next_layer.call} ; execute the given gcode to pause, should be either M600 or PAUSE + SET_PAUSE_NEXT_LAYER ENABLE=0 + {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER | int == pause_at_layer.layer %} + {action_respond_info("%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer))} + {pause_at_layer.call} ; execute the given gcode to pause, should be either M600 or PAUSE + SET_PAUSE_AT_LAYER ENABLE=0 + {% endif %} + SET_PRINT_STATS_INFO_BASE {rawparams} + +##### internal use ##### +[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] +description: Helper: park toolhead used in PAUSE and CANCEL_PRINT +gcode: + ##### get user parameters or use default ##### + {% set client = printer['gcode_macro _CLIENT_VARIABLE'] | default({}) %} + {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} + {% set use_custom = client.use_custom_pos | default(false) | lower == 'true' %} + {% set custom_park_x = client.custom_park_x | default(0.0) %} + {% set custom_park_y = client.custom_park_y | default(0.0) %} + {% set park_dz = client.custom_park_dz | default(2.0) | abs %} + {% set sp_hop = client.speed_hop | default(15) * 60 %} + {% set sp_move = client.speed_move | default(velocity) * 60 %} + ##### get config and toolhead values ##### + {% set origin = printer.gcode_move.homing_origin %} + {% set act = printer.gcode_move.gcode_position %} + {% set max = printer.toolhead.axis_maximum %} + {% set cone = printer.toolhead.cone_start_z | default(max.z) %} ; height as long the toolhead can reach max and min of an delta + {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] + else False %} + ##### define park position ##### + {% set z_min = params.Z_MIN | default(0) | float %} + {% set z_park = [[(act.z + park_dz), z_min] | max, (max.z - origin.z)] | min %} + {% set x_park = params.X if params.X is defined + else custom_park_x if use_custom + else 0.0 if round_bed + else (max.x - 5.0) %} + {% set y_park = params.Y if params.Y is defined + else custom_park_y if use_custom + else (max.y - 5.0) if round_bed and z_park < cone + else 0.0 if round_bed + else (max.y - 5.0) %} + ##### end of definitions ##### + _CLIENT_RETRACT + {% if "xyz" in printer.toolhead.homed_axes %} + G90 + G1 Z{z_park} F{sp_hop} + G1 X{x_park} Y{y_park} F{sp_move} + {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} + {% else %} + {action_respond_info("Printer not homed")} + {% endif %} + +[gcode_macro _CLIENT_EXTRUDE] +description: Extrudes, if the extruder is hot enough +gcode: + {% set client = printer['gcode_macro _CLIENT_VARIABLE'] | default({}) %} + {% set use_fw_retract = (client.use_fw_retract | default(false) | lower == 'true') and (printer.firmware_retraction is defined) %} + {% set length = params.LENGTH | default(client.unretract) | default(1.0) | float %} + {% set speed = params.SPEED | default(client.speed_unretract) | default(35) %} + {% set absolute_extrude = printer.gcode_move.absolute_extrude %} + + {% if printer.extruder.can_extrude %} + {% if use_fw_retract %} + {% if length < 0 %} + G10 + {% else %} + G11 + {% endif %} + {% else %} + M83 + G1 E{length} F{(speed | float | abs) * 60} + {% if absolute_extrude %} + M82 + {% endif %} + {% endif %} + {% else %} + {action_respond_info("Extruder not hot enough")} + {% endif %} + +[gcode_macro _CLIENT_RETRACT] +description: Retracts, if the extruder is hot enough +gcode: + {% set client = printer['gcode_macro _CLIENT_VARIABLE'] | default({}) %} + {% set length = params.LENGTH | default(client.retract) | default(1.0) | float %} + {% set speed = params.SPEED | default(client.speed_retract) | default(35) %} + + _CLIENT_EXTRUDE LENGTH=-{length | float | abs} SPEED={speed | float | abs} diff --git a/src/modules/vendor_overlay/overlay/printer_data/config/printer.cfg b/src/modules/vendor_overlay/overlay/printer_data/config/printer.cfg new file mode 100644 index 000000000..8d10e1da6 --- /dev/null +++ b/src/modules/vendor_overlay/overlay/printer_data/config/printer.cfg @@ -0,0 +1,599 @@ +# If Mainsail GUI is used +[include mainsail.cfg] + +# If fluidd is used +# [include fluidd.cfg] + +# Not needed on MainsailOS +# [virtual_sdcard] +# path: /home/klipper/printer_data/gcodes +# on_error_gcode: CANCEL_PRINT + +##################################################################### +# General Settings +##################################################################### + +[mcu] +serial: /dev/ttyS3 +restart_method: command + +[printer] +kinematics: corexy +max_velocity: 1000 +max_accel: 160000 +max_z_velocity: 50 +max_z_accel: 1000 +max_accel_to_decel: 100000 +square_corner_velocity: 18.0 + +[force_move] +enable_force_move: true + +[respond] +default_type: echo +default_prefix: + +##################################################################### +# X/Y/Z Stepper Settings +##################################################################### + +[stepper_x] +step_pin: gpio11 +dir_pin: !gpio10 +enable_pin: !gpio12 +rotation_distance: 40 +microsteps: 16 +endstop_pin: tmc2209_stepper_x:virtual_endstop +position_min: -1 +position_endstop: -1 +position_max: 157 +homing_speed: 50 +homing_retract_dist: 0 + +[tmc2209 stepper_x] +uart_pin: gpio9 +tx_pin: gpio8 +uart_address: 0 +run_current: 1.0 +stealthchop_threshold: 0 +diag_pin: ^gpio4 +driver_SGTHRS: 90 +interpolate: true + +[stepper_y] +step_pin: gpio6 +dir_pin: !gpio5 +enable_pin: !gpio7 +microsteps: 16 +rotation_distance: 40 +#endstop_pin: ^gpio3 +endstop_pin: tmc2209_stepper_y:virtual_endstop +homing_retract_dist: 0 +position_min: 0 +position_endstop: 174 +position_max: 174 +homing_speed: 50 +homing_positive_dir: true + +[tmc2209 stepper_y] +uart_pin: gpio9 +tx_pin: gpio8 +uart_address: 2 +run_current: 1.0 +stealthchop_threshold: 0 +diag_pin: ^gpio3 +driver_SGTHRS: 90 +interpolate: true + +[stepper_z] +step_pin: gpio19 +dir_pin: !gpio28 +enable_pin: !gpio2 +microsteps: 32 +rotation_distance: 8 +# endstop_pin: ^gpio25 +#position_endstop: -4.3 +endstop_pin: tmc2209_stepper_z:virtual_endstop +position_min: -6 +position_max: 156 +homing_speed: 4 + +[tmc2209 stepper_z] +uart_pin: gpio9 +tx_pin: gpio8 +uart_address: 1 +run_current: 0.8 +diag_pin: ^gpio25 +driver_SGTHRS: 50 +stealthchop_threshold: 999999 + +##################################################################### +# Extruder Settings +##################################################################### + +[extruder] +step_pin: gpio14 +dir_pin: !gpio13 +enable_pin: !gpio15 +microsteps: 16 +rotation_distance: 23.153 +gear_ratio: 50:17 +#gear_ratio: 80:20 +full_steps_per_rotation: 200 +nozzle_diameter: 0.4 +filament_diameter: 1.75 +heater_pin: gpio23 +#sensor_type: EPCOS 100K B57560G104F +sensor_type: ATC Semitec 104NT-4-R025H42G +sensor_pin: gpio27 +#control: pid +#pid_Kp: 22.2 +#pid_Ki: 1.08 +#pid_Kd: 114 +min_temp: 0 +max_temp: 300 +max_extrude_cross_section:2 +pressure_advance: 0.4 +pressure_advance_smooth_time: 0.060 +max_extrude_only_distance: 500 +max_extrude_only_velocity: 240 +max_extrude_only_accel: 4000 +instantaneous_corner_velocity: 20 + +[tmc2209 extruder] +uart_pin: gpio9 +tx_pin: gpio8 +uart_address: 3 +run_current: 1.0 +stealthchop_threshold: 0 + +##################################################################### +# Bed Settings +##################################################################### + +[heater_bed] +heater_pin: gpio21 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: gpio26 +#control: pid +#pid_Kp: 54.027 +#pid_Ki: 0.770 +#pid_Kd: 948.182 +min_temp: 0 +max_temp: 130 + +[bed_screws] +screw1: 33, 25 +screw2: 128, 25 +screw3: 33, 135 +screw4: 128, 135 + +[bed_mesh] +speed: 120 +horizontal_move_z: 3 +mesh_min: 10, 10 +mesh_max: 150,150 +probe_count: 5,5 +fade_start: 1 +fade_end: 10 +fade_target: 0 +algorithm: bicubic + +##################################################################### +# Cooling Settings +##################################################################### + +[multi_pin part_cooling] +pins: gpio18,gpio20 + +[fan] +pin: multi_pin:part_cooling + +[heater_fan hotend_fan] +pin: gpio17 +heater: extruder +heater_temp: 50.0 + + +##################################################################### +# Sensor Settings +##################################################################### + +[temperature_sensor skr_pico] +sensor_type: temperature_mcu +min_temp: 0 +max_temp: 100 + +[temperature_sensor banana_pi] +sensor_type: temperature_host +min_temp: 10 +max_temp: 100 + + +#[mcu PIS] +#serial: /dev/serial/by-id/usb-Klipper_rp2040_E66160F4238C3D38-if00 +#[mcu USB-ADXL345] +#serial: /dev/serial/by-id/usb-Klipper_stm32f103xe_37FFDA054B48373254491943-if00 + +#[adxl345] +#cs_pin: USB-ADXL345:PA4 +#spi_bus:spi1 + +#[adxl345] +#cs_pin: PIS:gpio13 +#spi_software_sclk_pin: PIS:gpio10 +#spi_software_mosi_pin: PIS:gpio11 +#spi_software_miso_pin: PIS:gpio12 +#axes_map: x,-z,y + +#[resonance_tester] +#accel_chip: adxl345 +#probe_points: +# 75,75,20 # an example + +#[filament_switch_sensor runout_sensor] +#switch_pin: ^gpio16 +#pause_on_runout: True + +# [filament_motion_sensor smart_sensor] +# switch_pin: ^gpio16 +# detection_length: 2.5 + +##################################################################### +# Macros +##################################################################### + +[gcode_macro START_PRINT] +gcode: + {% set BED_TEMP = params.BED|default(60)|int %} + {% set EXTRUDER_TEMP = params.HOTEND|default(220)|int %} + CLEAR_PAUSE + + {% if printer.heater_bed.temperature < (BED_TEMP-10) %} + M140 S{BED_TEMP-10} + {% endif %} + + G90 ; use absolute coordinates + G92 E0 ; reset extruder + + {% if "xyz" not in printer.toolhead.homed_axes %} + G28 ; home all axis + {% endif %} + G1 ; set units to millimeters + + {% if printer.heater_bed.temperature < (BED_TEMP-10) %} + M190 S{BED_TEMP-10} + {% endif %} + + M104 S{EXTRUDER_TEMP} + M190 S{BED_TEMP} + M109 S{EXTRUDER_TEMP} + DRAW_LINE SPEED=1800 + G1 E-2 F900 + + +[gcode_macro CANCEL_PRINT] +rename_existing: BASE_CANCEL_PRINT +gcode: + M220 S100 ; Reset Speed factor override percentage to default (100%) + M221 S100 ; Reset Extrude factor override percentage to default (100%) + G91 ; Set coordinates to relative + {% if printer.extruder.temperature >= 170 %} + G1 F1800 E-1 ; Retract filament 3 mm to prevent oozing + {% endif %} + ;if all axis are homed, lift the hotend to leave room for hot filament to ooze and to keep it clear of the bed. + {% if printer.toolhead.homed_axes == "xyz" %} + G1 F1200 Z20 ; Move Z Axis up 10 mm to allow filament ooze freely + G90 ; Set coordinates to absolute + G1 X{ printer.toolhead.axis_minimum.x +10 } Y{ printer.toolhead.axis_maximum.y - 20 } F3600 ; Move Printer Head Out of Way + ; M84 ; Disable stepper motors - don't so the gantry stays aligned + {% endif %} + ;set part fan speed to zero. + M106 S0 + M104 S{printer.extruder.temperature-20} + ;bed and hotend are left at the print temps in case I want to restart. + CLEAR_PAUSE + BASE_CANCEL_PRINT + +[gcode_macro END_PRINT] +gcode: + + # Move nozzle away from print while retracting + G91 ;releative positioning + G1 E-2 F2700 ;Retract a bit + G1 E-2 Z0.2 F2400 ;Retract and raise Z + G1 X-3 Y-3 F3000 ;Wipe out + G1 Z10 F1800 ;Raise Z more + + # Turn off bed, extruder, and fan + M140 S0 + M104 S0 + M106 S0 + + G90 ; Absolute Positioning + G1 X{ printer.toolhead.axis_minimum.x +10 } Y{ printer.toolhead.axis_maximum.y - 20 } F3600 ; Move Printer Head Out of Way + + M84 X Y E ;Disable all steppers but Z + +[gcode_macro DRAW_LINE] +gcode: + {% set SPEED = params.SPEED|default(900)|int %} + G92 E0 ;Reset Extruder + G1 Z2.0 F1800 ;Move Z Axis up + G1 X5.1 Y40 Z0.3 F5000 ;Move to start position + G1 X5.1 Y140.0 Z0.3 F{SPEED} E15 ;Draw the first line + G1 X5.4 Y140.0 Z0.3 F{SPEED} ;Move to side a little + G1 X5.4 Y40 Z0.3 F{SPEED}.0 E30 ;Draw the second line + G92 E0 ;Reset Extruder + G1 Z2.0 F3000 ;Move Z Axis up + G4 P2000 + +[gcode_macro WAIT_FOR_BED_TEMP] +gcode: + #Parameters + {% set s = params.S|float %} + + {% if (s-20) > 0 %} + TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={s-20} MAXIMUM={s+1} ; Wait for bed temp (within 1 degree) + {% endif %} + +[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-2} MAXIMUM={s+3} ; Wait for hotend temp (within 3 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-2} MAXIMUM={s+3} ; Wait for bed temp (within 3 degree) + {% endif %} + +[gcode_macro G28] +rename_existing: G280 +gcode: + M80 + SET_KINEMATIC_POSITION Z=0 + G90 + G1 Z3 F1200 + SENSORLESS_HOME_X + SENSORLESS_HOME_Y + SENSORLESS_HOME_Z + +[gcode_macro SENSORLESS_HOME_X] +gcode: + SENSORLESS_DELAY + # Home + G280 X + # Move away + G1 X{ printer.toolhead.axis_maximum.x/2 } F6000 + +[gcode_macro SENSORLESS_HOME_Y] +gcode: + SENSORLESS_DELAY + # Home + G280 Y + # Move away + G90 + G1 Y{ printer.toolhead.axis_maximum.y/2 } F6000 + +[gcode_macro SENSORLESS_HOME_Z] +gcode: + SENSORLESS_DELAY + # Home + G1 X{ printer.toolhead.axis_maximum.x/2 } Y{ printer.toolhead.axis_maximum.y } F6000 + G280 Z + SET_KINEMATIC_POSITION Z=5 + G1 Z0 F1200 + G1 Z10 F1200 + SENSORLESS_DELAY + G280 Z + G1 Z10 F600 + G1 X{ printer.toolhead.axis_minimum.x +5 } Y{ printer.toolhead.axis_maximum.y -2 } F6000 + +[gcode_macro SENSORLESS_DELAY] +gcode: + # Pause to ensure driver stall flag is clear + G4 P2000 + + +[gcode_macro M80] +gcode: + SET_STEPPER_ENABLE STEPPER=stepper_x ENABLE=1 + SET_STEPPER_ENABLE STEPPER=stepper_y ENABLE=1 + SET_STEPPER_ENABLE STEPPER=stepper_z ENABLE=1 + + + +[gcode_macro MECHANICAL_GANTRY_CALIBRATION] +gcode: + G28 + BED_MESH_CALIBRATE + + +[gcode_macro BED_PROBE] +gcode: + G28 ; todo query for homed + G90 ; absolute + + G0 Z5 F720 + G0 X30 Y40 F6000 + PROBE + + G0 Z5 F720 + G0 X149 Y40 F6000 + PROBE + + G0 Z5 F720 + G0 X30 Y139 F6000 + PROBE + + G0 Z5 F720 + G0 X149 Y139 F6000 + PROBE + +[gcode_macro BED_PROBE_X] +gcode: + G90 ; absolute + + G0 Z5 F720 + G0 X30 Y25 F6000 + PROBE + + G0 Z5 F720 + G0 X170 Y25 F6000 + PROBE + + G0 Z5 F720 + G0 X30 Y165 F6000 + PROBE + + G0 Z5 F720 + G0 X170 Y165 F6000 + PROBE + + +# Home, get position, throw around toolhead, home again. +# If MCU stepper positions (first line in GET_POSITION) are greater than a full step different (your number of microsteps), then skipping occured. +# We only measure to a full step to accomodate for endstop variance. +# Example: TEST_SPEED SPEED=300 ACCEL=5000 ITERATIONS=10 + +[gcode_macro TEST_SPEED] +gcode: + # Speed + {% set speed = params.SPEED|default(printer.configfile.settings.printer.max_velocity)|int %} + # Iterations + {% set iterations = params.ITERATIONS|default(5)|int %} + # Acceleration + {% set accel = params.ACCEL|default(printer.configfile.settings.printer.max_accel)|int %} + # Bounding inset for large pattern (helps prevent slamming the toolhead into the sides after small skips, and helps to account for machines with imperfectly set dimensions) + {% set bound = params.BOUND|default(20)|int %} + # Size for small pattern box + {% set smallpatternsize = SMALLPATTERNSIZE|default(20)|int %} + + # Large pattern + # Max positions, inset by BOUND + {% set x_min = printer.toolhead.axis_minimum.x + bound %} + {% set x_max = printer.toolhead.axis_maximum.x - bound %} + {% set y_min = printer.toolhead.axis_minimum.y + bound %} + {% set y_max = printer.toolhead.axis_maximum.y - bound %} + + # Small pattern at center + # Find X/Y center point + {% set x_center = (printer.toolhead.axis_minimum.x|float + printer.toolhead.axis_maximum.x|float ) / 2 %} + {% set y_center = (printer.toolhead.axis_minimum.y|float + printer.toolhead.axis_maximum.y|float ) / 2 %} + + # Set small pattern box around center point + {% set x_center_min = x_center - (smallpatternsize/2) %} + {% set x_center_max = x_center + (smallpatternsize/2) %} + {% set y_center_min = y_center - (smallpatternsize/2) %} + {% set y_center_max = y_center + (smallpatternsize/2) %} + + # Save current gcode state (absolute/relative, etc) + SAVE_GCODE_STATE NAME=TEST_SPEED + + # Output parameters to g-code terminal + { action_respond_info("TEST_SPEED: starting %d iterations at speed %d, accel %d" % (iterations, speed, accel)) } + + # Home and get position for comparison later: + G28 + # QGL if not already QGLd (only if QGL section exists in config) + {% if printer.configfile.settings.quad_gantry_level %} + {% if printer.quad_gantry_level.applied == False %} + QUAD_GANTRY_LEVEL + G28 Z + {% endif %} + {% endif %} + # Move 50mm away from max position and home again (to help with hall effect endstop accuracy - https://github.com/AndrewEllis93/Print-Tuning-Guide/issues/24) + G90 + G1 X{printer.toolhead.axis_maximum.x-50} Y{printer.toolhead.axis_maximum.y-50} F{30*60} + G28 X Y + G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} + G4 P1000 + GET_POSITION + + # Go to starting position + G0 X{x_min} Y{y_min} Z10 F{speed*60} + + # Set new limits + SET_VELOCITY_LIMIT VELOCITY={speed} ACCEL={accel} ACCEL_TO_DECEL={accel / 2} + + {% for i in range(iterations) %} + # Large pattern + # Diagonals + G0 X{x_min} Y{y_min} F{speed*60} + G0 X{x_max} Y{y_max} F{speed*60} + G0 X{x_min} Y{y_min} F{speed*60} + G0 X{x_max} Y{y_min} F{speed*60} + G0 X{x_min} Y{y_max} F{speed*60} + G0 X{x_max} Y{y_min} F{speed*60} + + # Box + G0 X{x_min} Y{y_min} F{speed*60} + G0 X{x_min} Y{y_max} F{speed*60} + G0 X{x_max} Y{y_max} F{speed*60} + G0 X{x_max} Y{y_min} F{speed*60} + + # Small pattern + # Small diagonals + G0 X{x_center_min} Y{y_center_min} F{speed*60} + G0 X{x_center_max} Y{y_center_max} F{speed*60} + G0 X{x_center_min} Y{y_center_min} F{speed*60} + G0 X{x_center_max} Y{y_center_min} F{speed*60} + G0 X{x_center_min} Y{y_center_max} F{speed*60} + G0 X{x_center_max} Y{y_center_min} F{speed*60} + + # Small box + G0 X{x_center_min} Y{y_center_min} F{speed*60} + G0 X{x_center_min} Y{y_center_max} F{speed*60} + G0 X{x_center_max} Y{y_center_max} F{speed*60} + G0 X{x_center_max} Y{y_center_min} F{speed*60} + {% endfor %} + + # Restore max speed/accel/accel_to_decel to their configured values + SET_VELOCITY_LIMIT VELOCITY={printer.configfile.settings.printer.max_velocity} ACCEL={printer.configfile.settings.printer.max_accel} ACCEL_TO_DECEL={printer.configfile.settings.printer.max_accel_to_decel} + + # Re-home and get position again for comparison: + G28 + # Go to XY home positions (in case your homing override leaves it elsewhere) + G90 + G0 X{printer.toolhead.axis_maximum.x-1} Y{printer.toolhead.axis_maximum.y-1} F{30*60} + G4 P1000 + GET_POSITION + + # Restore previous gcode state (absolute/relative, etc) + RESTORE_GCODE_STATE NAME=TEST_SPEED + +#*# <---------------------- SAVE_CONFIG ----------------------> +#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. +#*# +#*# [heater_bed] +#*# control = pid +#*# pid_kp = 68.865 +#*# pid_ki = 1.041 +#*# pid_kd = 1138.848 +#*# +#*# [extruder] +#*# control = pid +#*# pid_kp = 23.449 +#*# pid_ki = 2.299 +#*# pid_kd = 59.795 +#*# +#*# [input_shaper] +#*# shaper_type_x = mzv +#*# shaper_freq_x = 109.8 +#*# shaper_type_y = zv +#*# shaper_freq_y = 81.2 +#*# +#*# [stepper_z] +#*# position_endstop = 0.925 diff --git a/src/modules/vendor_overlay/start_chroot_script b/src/modules/vendor_overlay/start_chroot_script new file mode 100644 index 000000000..8dd957591 --- /dev/null +++ b/src/modules/vendor_overlay/start_chroot_script @@ -0,0 +1,32 @@ +#!/bin/bash +#### vendor_overlay module +#### +#### Written by Stephan Wendel aka KwadFan +#### Copyright 2021 - till today +#### https://github.com/mainsail-crew/crowsnest +#### +#### This File is other than usual licensed under the http://www.wtfpl.net/ +#### This means this is only an example on how to deliver your own configurations +#### Feel free to modify to your needs. +#### A short hint that it is based on my work would be nice but isnt crucial :) +#### +# shellcheck disable=all + +## Source error handling, leave this in place +set -Ee + +## Set LC_ALL to prevent errors +export LC_ALL=C + +## Source CustomPIOS common.sh +# shellcheck disable=SC1091 +source /common.sh +install_cleanup_trap + +echo_green "Trying to unpack vendor config files ..." + +## unpack overlay +unpack overlay/printer_data /home/"${BASE_USER}"/printer_data "${BASE_USER}" + +echo_green "DEBUG: Print 'printer_data' folder ..." +ls -T /home/"${BASE_USER}"/printer_data/ From b5087c11aac412270b67c3c227c3702d5eabe79e Mon Sep 17 00:00:00 2001 From: Stephan Wendel Date: Wed, 8 Nov 2023 20:59:41 +0100 Subject: [PATCH 03/10] chore: move Firmware-config Signed-off-by: Stephan Wendel --- .../printer_data/Firmware-config/config | 58 ------------------- .../config/Firmware-config}/config | 0 .../vendor_overlay/start_chroot_script | 2 +- 3 files changed, 1 insertion(+), 59 deletions(-) delete mode 100644 src/modules/vendor_overlay/overlay/printer_data/Firmware-config/config rename src/modules/vendor_overlay/{ => overlay/printer_data/config/Firmware-config}/config (100%) diff --git a/src/modules/vendor_overlay/overlay/printer_data/Firmware-config/config b/src/modules/vendor_overlay/overlay/printer_data/Firmware-config/config deleted file mode 100644 index 828abe344..000000000 --- a/src/modules/vendor_overlay/overlay/printer_data/Firmware-config/config +++ /dev/null @@ -1,58 +0,0 @@ -CONFIG_LOW_LEVEL_OPTIONS=y -# CONFIG_MACH_AVR is not set -# CONFIG_MACH_ATSAM is not set -# CONFIG_MACH_ATSAMD is not set -# CONFIG_MACH_LPC176X is not set -# CONFIG_MACH_STM32 is not set -# CONFIG_MACH_HC32F460 is not set -CONFIG_MACH_RP2040=y -# CONFIG_MACH_PRU is not set -# CONFIG_MACH_AR100 is not set -# CONFIG_MACH_LINUX is not set -# CONFIG_MACH_SIMU is not set -CONFIG_BOARD_DIRECTORY="rp2040" -CONFIG_MCU="rp2040" -CONFIG_CLOCK_FREQ=12000000 -CONFIG_SERIAL=y -CONFIG_FLASH_SIZE=0x200000 -CONFIG_FLASH_BOOT_ADDRESS=0x10000100 -CONFIG_RAM_START=0x20000000 -CONFIG_RAM_SIZE=0x42000 -CONFIG_STACK_SIZE=512 -CONFIG_FLASH_APPLICATION_ADDRESS=0x10000100 -CONFIG_RP2040_SELECT=y -CONFIG_RP2040_HAVE_STAGE2=y -CONFIG_RP2040_FLASH_START_0100=y -# CONFIG_RP2040_FLASH_START_4000 is not set -CONFIG_RP2040_FLASH_W25Q080=y -# CONFIG_RP2040_FLASH_GENERIC_03 is not set -CONFIG_RP2040_STAGE2_FILE="boot2_w25q080.S" -CONFIG_RP2040_STAGE2_CLKDIV=2 -# CONFIG_RP2040_USB is not set -CONFIG_RP2040_SERIAL_UART0=y -# CONFIG_RP2040_CANBUS is not set -# CONFIG_RP2040_USBCANBUS is not set -CONFIG_RP2040_CANBUS_GPIO_RX=4 -CONFIG_RP2040_CANBUS_GPIO_TX=5 -CONFIG_SERIAL_BAUD=250000 -CONFIG_USB_VENDOR_ID=0x1d50 -CONFIG_USB_DEVICE_ID=0x614e -CONFIG_USB_SERIAL_NUMBER="12345" -CONFIG_WANT_GPIO_BITBANGING=y -CONFIG_WANT_DISPLAYS=y -CONFIG_WANT_SENSORS=y -CONFIG_WANT_LIS2DW=y -CONFIG_WANT_SOFTWARE_I2C=y -CONFIG_WANT_SOFTWARE_SPI=y -CONFIG_CANBUS_FREQUENCY=1000000 -CONFIG_INITIAL_PINS="" -CONFIG_HAVE_GPIO=y -CONFIG_HAVE_GPIO_ADC=y -CONFIG_HAVE_GPIO_SPI=y -CONFIG_HAVE_GPIO_I2C=y -CONFIG_HAVE_GPIO_HARD_PWM=y -CONFIG_HAVE_STRICT_TIMING=y -CONFIG_HAVE_CHIPID=y -CONFIG_HAVE_STEPPER_BOTH_EDGE=y -CONFIG_HAVE_BOOTLOADER_REQUEST=y -CONFIG_INLINE_STEPPER_HACK=y diff --git a/src/modules/vendor_overlay/config b/src/modules/vendor_overlay/overlay/printer_data/config/Firmware-config/config similarity index 100% rename from src/modules/vendor_overlay/config rename to src/modules/vendor_overlay/overlay/printer_data/config/Firmware-config/config diff --git a/src/modules/vendor_overlay/start_chroot_script b/src/modules/vendor_overlay/start_chroot_script index 8dd957591..0a5561ed1 100644 --- a/src/modules/vendor_overlay/start_chroot_script +++ b/src/modules/vendor_overlay/start_chroot_script @@ -29,4 +29,4 @@ echo_green "Trying to unpack vendor config files ..." unpack overlay/printer_data /home/"${BASE_USER}"/printer_data "${BASE_USER}" echo_green "DEBUG: Print 'printer_data' folder ..." -ls -T /home/"${BASE_USER}"/printer_data/ +ls -T /home/"${BASE_USER}"/printer_data/config From 5bff9441ab08ee263f7c77483fe6b75b83c4fbc6 Mon Sep 17 00:00:00 2001 From: Stephan Wendel Date: Wed, 8 Nov 2023 21:02:42 +0100 Subject: [PATCH 04/10] chore: add vendor_overlay module Signed-off-by: Stephan Wendel --- config/armbian/default | 2 +- config/raspberry/default | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/armbian/default b/config/armbian/default index bd7d28436..60bbfd1a7 100644 --- a/config/armbian/default +++ b/config/armbian/default @@ -23,7 +23,7 @@ BASE_IMAGE_RESIZEROOT=600 # Compress not needed due compression done in workflow BASE_RELEASE_COMPRESS=no # Modules are valid for 32bit and 64bit images -MODULES="base,pkgupgrade,udev_fix,armbian(armbian_net,mainsailos,klipper,is_req_preinstall,moonraker,mainsail,timelapse,crowsnest,sonar)" +MODULES="base,pkgupgrade,udev_fix,armbian(armbian_net,mainsailos,klipper,is_req_preinstall,moonraker,mainsail,timelapse,crowsnest,sonar,vendor_overlay)" # export Variables export DOWNLOAD_BASE_URL diff --git a/config/raspberry/default b/config/raspberry/default index 7ec32ad79..9a6d6c814 100644 --- a/config/raspberry/default +++ b/config/raspberry/default @@ -9,7 +9,7 @@ BASE_IMAGE_RESIZEROOT=600 # Compress not needed due compression done in workflow BASE_RELEASE_COMPRESS=no # Modules are valid for 32bit and 64bit images -MODULES="base,pkgupgrade,udev_fix,mainsailos(net,piconfig,klipper,is_req_preinstall,moonraker,timelapse,mainsail,crowsnest,sonar,password-for-sudo),postrename" +MODULES="base,pkgupgrade,udev_fix,mainsailos(net,piconfig,klipper,is_req_preinstall,moonraker,timelapse,mainsail,crowsnest,sonar,vendor_overlay,password-for-sudo),postrename" # export Variables export BASE_IMAGE_ENLARGEROOT From 99b09e698b0fd4f1db03beed6d86edb11a66e0dd Mon Sep 17 00:00:00 2001 From: Stephan Wendel Date: Wed, 8 Nov 2023 21:04:32 +0100 Subject: [PATCH 05/10] fix: moved config error Signed-off-by: Stephan Wendel --- src/modules/vendor_overlay/config | 15 ++++ .../config/Firmware-config/config | 73 +++++++++++++++---- 2 files changed, 73 insertions(+), 15 deletions(-) create mode 100644 src/modules/vendor_overlay/config diff --git a/src/modules/vendor_overlay/config b/src/modules/vendor_overlay/config new file mode 100644 index 000000000..8f7d81b23 --- /dev/null +++ b/src/modules/vendor_overlay/config @@ -0,0 +1,15 @@ +#!/bin/bash +#### vendor_overlay module +#### +#### Written by Stephan Wendel aka KwadFan +#### Copyright 2021 - till today +#### https://github.com/mainsail-crew/crowsnest +#### +#### This File is other than usual licensed under the http://www.wtfpl.net/ +#### This means this is only an example on how to deliver your own configurations +#### Feel free to modify to your needs. +#### A short hint that it is based on my work would be nice but isnt crucial :) +#### +# shellcheck disable=all + +# Intentionally left blank for later use ... diff --git a/src/modules/vendor_overlay/overlay/printer_data/config/Firmware-config/config b/src/modules/vendor_overlay/overlay/printer_data/config/Firmware-config/config index 8f7d81b23..828abe344 100644 --- a/src/modules/vendor_overlay/overlay/printer_data/config/Firmware-config/config +++ b/src/modules/vendor_overlay/overlay/printer_data/config/Firmware-config/config @@ -1,15 +1,58 @@ -#!/bin/bash -#### vendor_overlay module -#### -#### Written by Stephan Wendel aka KwadFan -#### Copyright 2021 - till today -#### https://github.com/mainsail-crew/crowsnest -#### -#### This File is other than usual licensed under the http://www.wtfpl.net/ -#### This means this is only an example on how to deliver your own configurations -#### Feel free to modify to your needs. -#### A short hint that it is based on my work would be nice but isnt crucial :) -#### -# shellcheck disable=all - -# Intentionally left blank for later use ... +CONFIG_LOW_LEVEL_OPTIONS=y +# CONFIG_MACH_AVR is not set +# CONFIG_MACH_ATSAM is not set +# CONFIG_MACH_ATSAMD is not set +# CONFIG_MACH_LPC176X is not set +# CONFIG_MACH_STM32 is not set +# CONFIG_MACH_HC32F460 is not set +CONFIG_MACH_RP2040=y +# CONFIG_MACH_PRU is not set +# CONFIG_MACH_AR100 is not set +# CONFIG_MACH_LINUX is not set +# CONFIG_MACH_SIMU is not set +CONFIG_BOARD_DIRECTORY="rp2040" +CONFIG_MCU="rp2040" +CONFIG_CLOCK_FREQ=12000000 +CONFIG_SERIAL=y +CONFIG_FLASH_SIZE=0x200000 +CONFIG_FLASH_BOOT_ADDRESS=0x10000100 +CONFIG_RAM_START=0x20000000 +CONFIG_RAM_SIZE=0x42000 +CONFIG_STACK_SIZE=512 +CONFIG_FLASH_APPLICATION_ADDRESS=0x10000100 +CONFIG_RP2040_SELECT=y +CONFIG_RP2040_HAVE_STAGE2=y +CONFIG_RP2040_FLASH_START_0100=y +# CONFIG_RP2040_FLASH_START_4000 is not set +CONFIG_RP2040_FLASH_W25Q080=y +# CONFIG_RP2040_FLASH_GENERIC_03 is not set +CONFIG_RP2040_STAGE2_FILE="boot2_w25q080.S" +CONFIG_RP2040_STAGE2_CLKDIV=2 +# CONFIG_RP2040_USB is not set +CONFIG_RP2040_SERIAL_UART0=y +# CONFIG_RP2040_CANBUS is not set +# CONFIG_RP2040_USBCANBUS is not set +CONFIG_RP2040_CANBUS_GPIO_RX=4 +CONFIG_RP2040_CANBUS_GPIO_TX=5 +CONFIG_SERIAL_BAUD=250000 +CONFIG_USB_VENDOR_ID=0x1d50 +CONFIG_USB_DEVICE_ID=0x614e +CONFIG_USB_SERIAL_NUMBER="12345" +CONFIG_WANT_GPIO_BITBANGING=y +CONFIG_WANT_DISPLAYS=y +CONFIG_WANT_SENSORS=y +CONFIG_WANT_LIS2DW=y +CONFIG_WANT_SOFTWARE_I2C=y +CONFIG_WANT_SOFTWARE_SPI=y +CONFIG_CANBUS_FREQUENCY=1000000 +CONFIG_INITIAL_PINS="" +CONFIG_HAVE_GPIO=y +CONFIG_HAVE_GPIO_ADC=y +CONFIG_HAVE_GPIO_SPI=y +CONFIG_HAVE_GPIO_I2C=y +CONFIG_HAVE_GPIO_HARD_PWM=y +CONFIG_HAVE_STRICT_TIMING=y +CONFIG_HAVE_CHIPID=y +CONFIG_HAVE_STEPPER_BOTH_EDGE=y +CONFIG_HAVE_BOOTLOADER_REQUEST=y +CONFIG_INLINE_STEPPER_HACK=y From c57ad65facfb96a9c1b146c8d2fa7edad3ff3c4b Mon Sep 17 00:00:00 2001 From: Stephan Wendel Date: Wed, 8 Nov 2023 21:06:21 +0100 Subject: [PATCH 06/10] fix: shellcheck error Signed-off-by: Stephan Wendel --- .../config/Firmware-config/{config => klipper-config} | 0 .../vendor_overlay/overlay/printer_data/config/Readme.md | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename src/modules/vendor_overlay/overlay/printer_data/config/Firmware-config/{config => klipper-config} (100%) diff --git a/src/modules/vendor_overlay/overlay/printer_data/config/Firmware-config/config b/src/modules/vendor_overlay/overlay/printer_data/config/Firmware-config/klipper-config similarity index 100% rename from src/modules/vendor_overlay/overlay/printer_data/config/Firmware-config/config rename to src/modules/vendor_overlay/overlay/printer_data/config/Firmware-config/klipper-config diff --git a/src/modules/vendor_overlay/overlay/printer_data/config/Readme.md b/src/modules/vendor_overlay/overlay/printer_data/config/Readme.md index c1370131c..d058c7c57 100644 --- a/src/modules/vendor_overlay/overlay/printer_data/config/Readme.md +++ b/src/modules/vendor_overlay/overlay/printer_data/config/Readme.md @@ -9,7 +9,7 @@ - Copy over the `config` file from `Firmware-config` ```bash -cp -v ~/printer_data_config/Firmware-config/config ~/klipper/.config +cp -v ~/printer_data_config/Firmware-config/klipper-config ~/klipper/.config ``` - Run firmware build process by From a1a6480ec5415c47795f5f397a30932c3cc9cb60 Mon Sep 17 00:00:00 2001 From: Stephan Wendel Date: Wed, 8 Nov 2023 21:08:36 +0100 Subject: [PATCH 07/10] fix: shellcheck error Signed-off-by: Stephan Wendel --- .../config/Firmware-config/{klipper-config => btt-skrpico-v1.0} | 0 .../vendor_overlay/overlay/printer_data/config/Readme.md | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename src/modules/vendor_overlay/overlay/printer_data/config/Firmware-config/{klipper-config => btt-skrpico-v1.0} (100%) diff --git a/src/modules/vendor_overlay/overlay/printer_data/config/Firmware-config/klipper-config b/src/modules/vendor_overlay/overlay/printer_data/config/Firmware-config/btt-skrpico-v1.0 similarity index 100% rename from src/modules/vendor_overlay/overlay/printer_data/config/Firmware-config/klipper-config rename to src/modules/vendor_overlay/overlay/printer_data/config/Firmware-config/btt-skrpico-v1.0 diff --git a/src/modules/vendor_overlay/overlay/printer_data/config/Readme.md b/src/modules/vendor_overlay/overlay/printer_data/config/Readme.md index d058c7c57..207d307bf 100644 --- a/src/modules/vendor_overlay/overlay/printer_data/config/Readme.md +++ b/src/modules/vendor_overlay/overlay/printer_data/config/Readme.md @@ -9,7 +9,7 @@ - Copy over the `config` file from `Firmware-config` ```bash -cp -v ~/printer_data_config/Firmware-config/klipper-config ~/klipper/.config +cp -v ~/printer_data_config/Firmware-config/btt-skrpico-v1.0 ~/klipper/.config ``` - Run firmware build process by From 25120b5dacd80a30956a214d80fd9c4bc6fd7d3a Mon Sep 17 00:00:00 2001 From: Stephan Wendel Date: Thu, 9 Nov 2023 17:22:37 +0100 Subject: [PATCH 08/10] chore: wip Signed-off-by: Stephan Wendel --- src/modules/vendor_overlay/start_chroot_script | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/vendor_overlay/start_chroot_script b/src/modules/vendor_overlay/start_chroot_script index 0a5561ed1..33874f5be 100644 --- a/src/modules/vendor_overlay/start_chroot_script +++ b/src/modules/vendor_overlay/start_chroot_script @@ -26,7 +26,7 @@ install_cleanup_trap echo_green "Trying to unpack vendor config files ..." ## unpack overlay -unpack overlay/printer_data /home/"${BASE_USER}"/printer_data "${BASE_USER}" +unpack overlay/ /home/"${BASE_USER}" "${BASE_USER}" echo_green "DEBUG: Print 'printer_data' folder ..." ls -T /home/"${BASE_USER}"/printer_data/config From 986324ad55ceda9dcfd23efd0af04dea71561834 Mon Sep 17 00:00:00 2001 From: Stephan Wendel Date: Thu, 9 Nov 2023 17:56:46 +0100 Subject: [PATCH 09/10] chore: wip Signed-off-by: Stephan Wendel --- src/modules/vendor_overlay/start_chroot_script | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/vendor_overlay/start_chroot_script b/src/modules/vendor_overlay/start_chroot_script index 33874f5be..1f2be3f4f 100644 --- a/src/modules/vendor_overlay/start_chroot_script +++ b/src/modules/vendor_overlay/start_chroot_script @@ -26,7 +26,7 @@ install_cleanup_trap echo_green "Trying to unpack vendor config files ..." ## unpack overlay -unpack overlay/ /home/"${BASE_USER}" "${BASE_USER}" +unpack overlay /home/"${BASE_USER}" "${BASE_USER}" echo_green "DEBUG: Print 'printer_data' folder ..." ls -T /home/"${BASE_USER}"/printer_data/config From 74e414f155bcb6838d4551c05472ac4b6291cd74 Mon Sep 17 00:00:00 2001 From: Stephan Wendel Date: Thu, 9 Nov 2023 17:58:18 +0100 Subject: [PATCH 10/10] chore: wip Signed-off-by: Stephan Wendel --- config/raspberry/default | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/raspberry/default b/config/raspberry/default index 9a6d6c814..f1112b60e 100644 --- a/config/raspberry/default +++ b/config/raspberry/default @@ -9,8 +9,8 @@ BASE_IMAGE_RESIZEROOT=600 # Compress not needed due compression done in workflow BASE_RELEASE_COMPRESS=no # Modules are valid for 32bit and 64bit images -MODULES="base,pkgupgrade,udev_fix,mainsailos(net,piconfig,klipper,is_req_preinstall,moonraker,timelapse,mainsail,crowsnest,sonar,vendor_overlay,password-for-sudo),postrename" - +#MODULES="base,pkgupgrade,udev_fix,mainsailos(net,piconfig,klipper,is_req_preinstall,moonraker,timelapse,mainsail,crowsnest,sonar,vendor_overlay,password-for-sudo),postrename" +MODULES="base,pkgupgrade,udev_fix,mainsailos(net,piconfig,klipper,moonraker,mainsail,vendor_overlay,password-for-sudo),postrename" # export Variables export BASE_IMAGE_ENLARGEROOT export BASE_IMAGE_RESIZEROOT