Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test/the100 #255

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions .github/workflow_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion config/armbian/default
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions config/raspberry/default
Original file line number Diff line number Diff line change
Expand Up @@ -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,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions src/modules/vendor_overlay/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
#### vendor_overlay module
####
#### Written by Stephan Wendel aka KwadFan <[email protected]>
#### 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 ...
Original file line number Diff line number Diff line change
@@ -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
27 changes: 27 additions & 0 deletions src/modules/vendor_overlay/overlay/printer_data/config/Readme.md
Original file line number Diff line number Diff line change
@@ -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/btt-skrpico-v1.0 ~/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!**
229 changes: 229 additions & 0 deletions src/modules/vendor_overlay/overlay/printer_data/config/fluidd.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
## Client klipper macro definitions
##
## Copyright (C) 2022 Alex Zellner <[email protected]>
##
## 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=<name>]
[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=<number>] [MACRO=<name>]
[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=<total_layer_count>] [CURRENT_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}
Loading
Loading