Skip to content

Commit

Permalink
Merge branch 'main' into Benoit_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Benoitone committed Jan 6, 2025
2 parents 99b5f6b + 621e0ea commit 384af24
Show file tree
Hide file tree
Showing 19 changed files with 300 additions and 79 deletions.
66 changes: 33 additions & 33 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
name: Mark and Manage Stale Issues and Pull Requests
# name: Mark and Manage Stale Issues and Pull Requests

on:
schedule:
- cron: '30 7 * * *'
# on:
# schedule:
# - cron: '30 7 * * *'

jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
# jobs:
# stale:
# runs-on: ubuntu-latest
# permissions:
# issues: write
# pull-requests: write

steps:
- uses: actions/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 30
days-before-close: 14
stale-issue-message: >
📌 **This issue has been marked as stale because it has not had activity in the past 30 days.**
# steps:
# - uses: actions/[email protected]
# with:
# repo-token: ${{ secrets.GITHUB_TOKEN }}
# days-before-stale: 30
# days-before-close: 14
# stale-issue-message: >
# 📌 **This issue has been marked as stale because it has not had activity in the past 30 days.**

To keep it open, please respond to this message or add new information. Otherwise, this will be closed in 14 days.
# To keep it open, please respond to this message or add new information. Otherwise, this will be closed in 14 days.

Thank you for your contributions!
stale-pr-message: >
📌 **This pull request has been marked as stale because it has not had activity in the past 30 days.**
# Thank you for your contributions!
# stale-pr-message: >
# 📌 **This pull request has been marked as stale because it has not had activity in the past 30 days.**

Please update the PR or comment to keep it active. Otherwise, this will be closed in 14 days.
# Please update the PR or comment to keep it active. Otherwise, this will be closed in 14 days.

We appreciate your contribution!
stale-issue-label: 'stale'
stale-pr-label: 'stale, reviewer-needed'
exempt-issue-labels: 'tracking'
exempt-pr-labels: 'tracking'
close-issue-message: 'This issue was closed due to inactivity for 14 days. Feel free to reopen it if you think it was an error or if you have new information or progress to share'
close-pr-message: 'This pull request was closed due to inactivity for 14 days. Please reopen it if you think it was an error or if you wish to continue the contribution.'
exempt-all-milestones: true
exempt-all-assignees: true
exempt-draft-prs: true
# We appreciate your contribution!
# stale-issue-label: 'stale'
# stale-pr-label: 'stale, reviewer-needed'
# exempt-issue-labels: 'tracking'
# exempt-pr-labels: 'tracking'
# close-issue-message: 'This issue was closed due to inactivity for 14 days. Feel free to reopen it if you think it was an error or if you have new information or progress to share'
# close-pr-message: 'This pull request was closed due to inactivity for 14 days. Please reopen it if you think it was an error or if you wish to continue the contribution.'
# exempt-all-milestones: true
# exempt-all-assignees: true
# exempt-draft-prs: true
23 changes: 23 additions & 0 deletions config/hardware/accelerometers/generics/lis2dw_software_spi.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This LIS2DW file is dedicated to be used with LIS2DW boards
# connected over the software SPI bus of the MCU boards

# This include toolhead boards such as Mellow SHTv3 boards
# If using a toolhead board, be sure to have the pin override in your mcu.cfg (toolhead:LIS2DW_CS)

[lis2dw]
cs_pin: LIS2DW_CS
spi_software_sclk_pin: LIS2DW_SCLK
spi_software_mosi_pin: LIS2DW_MOSI
spi_software_miso_pin: LIS2DW_MISO
axes_map: x,y,z

[resonance_tester]
accel_chip: lis2dw
probe_points:
-1,-1,-1


# Include the IS calibration macros to unlock them when
# an accelerometer is installed on the machine
[include ../../../../macros/helpers/resonance_override.cfg]
[include ../../../../scripts/K-ShakeTune/K-SnT_*.cfg]
7 changes: 7 additions & 0 deletions config/hardware/accelerometers/lis2dw_sht_v3.x.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[include generics/lis2dw_software_spi.cfg]

[lis2dw]
cs_pin: toolhead:LIS2DW
spi_software_sclk_pin: toolhead:SCK
spi_software_mosi_pin: toolhead:MOSI
spi_software_miso_pin: toolhead:MISO
37 changes: 37 additions & 0 deletions config/mcu_definitions/main/BTT_Manta_E3EZ_v1.0.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[board_pins mcu_manufacturer]
aliases:
MCU_M1_STEP=PA14, MCU_M1_DIR=PA10, MCU_M1_EN=PA13, MCU_M1_CS=PB8,
MCU_M2_STEP=PC8, MCU_M2_DIR=PA15, MCU_M2_EN=PC14, MCU_M2_CS=PC9,
MCU_M3_STEP=PD2, MCU_M3_DIR=PD4, MCU_M3_EN=PD3, MCU_M3_CS=PD0,
MCU_M4_STEP=PD5, MCU_M4_DIR=PD6, MCU_M4_EN=PB3, MCU_M4_CS=PD1,
MCU_M5_STEP=PB7, MCU_M5_DIR=PB6, MCU_M5_EN=PB4, MCU_M5_CS=PB5,

MCU_M1_STOP=PC4, MCU_M2_STOP=PB0, MCU_M3_STOP=PC6, MCU_M4_STOP=PC5, MCU_M5_STOP=PB1,

MCU_HE0=PB11 , MCU_HE1=PB10 ,

MCU_BED_OUT=PB2 ,

MCU_THB=PA3 , MCU_TH0=PA4 , MCU_TH1=PA5 ,

MCU_FAN0=PA8 , MCU_FAN1=PB15 , MCU_FAN2=PB14 ,

MCU_RGB1=PC7 ,

MCU_PROBE1=PA6 , MCU_PROBE2=PA7 ,

MCU_PS_ON=PA9 ,
MCU_POWER_DET=PB9 ,


MCU_SPI3_MOSI=PC12 , MCU_SPI3_MISO=PC11 , MCU_SPI3_SCK=PC10 , MCU_SPI3_CS=PC15 ,


# EXP1 header
EXP1_1=PC1 , EXP1_2=PC2 ,
EXP1_3=PC3 , EXP1_4=RST ,
EXP1_5=PC0 , EXP1_6=PA0 , # Slot in the socket on this side
EXP1_7=PA2 , EXP1_8=PA1 ,
EXP1_9=<GND> , EXP1_10=<5V> ,


2 changes: 1 addition & 1 deletion config/mcu_definitions/main/BTT_Manta_M8P_v2.0.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ aliases:

MCU_THB=PB1 , MCU_TH0=PB0 , MCU_TH1=PC5 , MCU_TH2=PC4 , MCU_TH3=PA7 ,

MCU_FAN0=PF7 , MCU_FAN1=PF9 , MCU_FAN2=PF6 , MCU_FAN3=PA8 , MCU_FAN4=PA4 ,
MCU_FAN0=PF7 , MCU_FAN1=PF9 , MCU_FAN2=PF6 , MCU_FAN3=PF8 , MCU_FAN4=PA4 ,
MCU_FAN5=PA6 , MCU_FAN5_TACH=PC2 ,
MCU_FAN6=PA2 , MCU_FAN6_TACH=PC1 ,

Expand Down
20 changes: 20 additions & 0 deletions config/mcu_definitions/toolhead/Mellow_SHT36_v3.x.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[board_pins toolhead_manufacturer]
mcu: toolhead
aliases:
MCU_EXT_EN=gpio14 , MCU_EXT_STEP=gpio7 , MCU_EXT_DIR=gpio6 , MCU_EXT_UART=gpio15 , MCU_EXT_DIAG= ,

MCU_LIMIT_0=gpio20 , MCU_LIMIT_1=gpio16 ,

MCU_PROBE_1=gpio22 , MCU_PROBE_2=gpio24 ,

MCU_FAN0=gpio13 , MCU_FAN1=gpio21 ,

MCU_TH0=gpio27 , MCU_PT100=gpio17 , MCU_TC0= ,

MCU_HE0=gpio23 ,

MCU_RGBLED=gpio26 ,

MCU_SW_SCK=gpio2 , MCU_SW_MISO=gpio4 , MCU_SW_MOSI=gpio3 ,
MCU_LIS2DW_CS=gpio12 ,
MCU_MAX31865_CS=gpio17 ,
2 changes: 1 addition & 1 deletion docs/mmu.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ If you want to print without using the MMU features, you can use the MMU bypass
1. Select the bypass mode with `MMU_SELECT_BYPASS`.
1. Finally, manually insert the filament into the bowden tube up to the extruder gears and load the filament with the `MMU_LOAD` command or start the print (the `START_PRINT` sequence will automatically try to load the filament into the toolhead).

At the end of the print, you can use the `MMU_EJECT` command (if `variable_mmu_unload_on_end_print` is set to False in Klippain `variables.cfg`, otherwise it is ejected automatically) to unload the filament from the extruder and then manually pull it out of the bowden tube.
At the end of the print, you can use the `MMU_UNLOAD` command (if `variable_mmu_unload_on_end_print` is set to False in Klippain `variables.cfg`, otherwise it is unloaded automatically) to unload the filament from the extruder and then manually pull it out of the bowden tube.

### Spoolman support with MMU

Expand Down
6 changes: 1 addition & 5 deletions macros/base/cancel_print.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ gcode:
_MMU_CLEAR_POSITION
{% elif printer.mmu.enabled and mmu_unload_on_cancel_print and printer.mmu.tool|int != -2 %}
# Unload filament and park the MMU
MMU_EJECT
{% elif printer.extruder.can_extrude %}
# Pull back the filament a little bit
G92 E0
G1 E-10 F2100
MMU_UNLOAD
{% endif %}
{% elif printer.extruder.can_extrude %}
# Pull back the filament a little bit
Expand Down
2 changes: 1 addition & 1 deletion macros/base/end_print.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ gcode:
_MMU_RUN_MARKERS
{% elif printer.mmu.enabled and mmu_unload %}
# unload filament and park into MMU. Or just unload filament out of extruder if using bypass.
MMU_EJECT
MMU_UNLOAD
{% endif %}
{% elif printer.extruder.can_extrude %}
# pull back the filament a little bit
Expand Down
1 change: 1 addition & 0 deletions macros/base/homing/homing_override.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ gcode:
{% endif %}
G91
G0 Z{homing_zhop} F{z_drop_speed}
M400
G90
{% else %}
{% if verbose %}
Expand Down
8 changes: 8 additions & 0 deletions macros/base/pause_resume.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ description: Pause the print and park
gcode:
{% set light_enabled = printer["gcode_macro _USER_VARIABLES"].light_enabled %}
{% set light_intensity_start_print = printer["gcode_macro _USER_VARIABLES"].light_intensity_start_print %}
{% set idle_timeout_on_pause = printer["gcode_macro _USER_VARIABLES"].idle_timeout_on_pause|default(0)|int %}
{% set klippain_mmu_enabled = printer["gcode_macro _USER_VARIABLES"].klippain_mmu_enabled %}

{% if printer.pause_resume.is_paused %}
Expand Down Expand Up @@ -41,6 +42,7 @@ gcode:
{% set light_enabled = printer["gcode_macro _USER_VARIABLES"].light_enabled %}
{% set light_intensity_printing = printer["gcode_macro _USER_VARIABLES"].light_intensity_printing %}
{% set klippain_mmu_enabled = printer["gcode_macro _USER_VARIABLES"].klippain_mmu_enabled %}
{% set idle_timeout_on_pause = printer["gcode_macro _USER_VARIABLES"].idle_timeout_on_pause|default(0)|int %}

{% if not printer.pause_resume.is_paused %}
RESPOND MSG="Print is not paused. Resume ignored"
Expand All @@ -59,9 +61,15 @@ gcode:
{% else %}
RESTORE_GCODE_STATE NAME=PAUSE_state MOVE=1 MOVE_SPEED={St}
{% endif %}

{% if light_enabled %}
LIGHT_ON S={light_intensity_printing}
{% endif %}

{% if idle_timeout_on_pause > 0%}
SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout}
{% endif %}

BASE_RESUME
{% endif %}

Expand Down
54 changes: 27 additions & 27 deletions macros/hardware_functions/mmu.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ gcode:
RESPOND PREFIX='MMU info:' MSG="<span class="success"--text> You are planning a multi-filament print. The tool(s): {TOOLS_USED} will be checked to limit the risk of errors.</span>"
{% endif %}

# First eject in case a bad tool is already loaded, then check the gates and select the initial tool
MMU_EJECT
MMU_CHECK_GATE TOOLS={TOOLS_USED}
MMU_SELECT TOOL={INITIAL_TOOL}
# First unload in case a bad tool is already loaded, then check the gates and select the initial tool
MMU_UNLOAD
MMU_CHECK_GATE TOOLS={TOOLS_USED}
MMU_SELECT TOOL={INITIAL_TOOL}

# Else if the TOOL_USED parameter is not valid... We can still start the print but only check the initial tool
{% elif printer.mmu.tool|int != INITIAL_TOOL or (printer.mmu.tool|int == INITIAL_TOOL and printer.mmu.filament != "Loaded") %}
Expand All @@ -89,16 +89,16 @@ gcode:
{% endif %}
{% endif %}

# First eject in case a bad tool is already loaded, then check the initial tool gate
MMU_EJECT
MMU_CHECK_GATE TOOLS={INITIAL_TOOL}
{% endif %}

# Else if there was an error in the Moonraker gcode preprocessor (TOOL_USED is still equal to "!referenced_tools!")
{% else %}
{% if verbose %}
RESPOND PREFIX='MMU info:' MSG="<span class="error"--text> TOOLS_USED={TOOLS_USED} is likely not valid. Please check your slicer custom start gcode and verify that the HappyHare Moonraker gcode preprocessor is working! There will be no check on the gates and they will all be marked as available to avoid an error</span>"
{% endif %}
# First unload in case a bad tool is already loaded, then check the initial tool gate
MMU_UNLOAD
MMU_CHECK_GATE TOOLS={INITIAL_TOOL}
{% endif %}
# Else if there was an error in the Moonraker gcode preprocessor (TOOL_USED is still equal to "!referenced_tools!")
{% else %}
{% if verbose %}
RESPOND PREFIX='MMU info:' MSG="<span class="error"--text> TOOLS_USED={TOOLS_USED} is likely not valid. Please check your slicer custom start gcode and verify that the HappyHare Moonraker gcode preprocessor is working! There will be no check on the gates and they will all be marked as available to avoid an error</span>"
{% endif %}

# Reset the state status (Available or Empty) for all the MMU gates to avoid an error
{% set gate_str = printer.mmu.ttg_map|join(',') %}
Expand Down Expand Up @@ -145,21 +145,21 @@ gcode:
MMU_TEST_CONFIG sync_to_extruder=0
{% endif %}

# Preload the MMU gates if the filament is not already loaded and the MMU is set in normal mode
{% if printer.mmu.tool|int != -2 %}
{% if printer.mmu.filament != "Loaded" %}
{% if printer.mmu.tool|int != INITIAL_TOOL %}
MMU_SELECT TOOL={INITIAL_TOOL}
MMU_PRELOAD
{% endif %}
{% else %}
{% if printer.mmu.tool|int != INITIAL_TOOL %}
MMU_EJECT
MMU_SELECT TOOL={INITIAL_TOOL}
MMU_PRELOAD
{% endif %}
# Preload the MMU gates if the filament is not already loaded and the MMU is set in normal mode
{% if printer.mmu.tool|int != -2 %}
{% if printer.mmu.filament != "Loaded" %}
{% if printer.mmu.tool|int != INITIAL_TOOL %}
MMU_SELECT TOOL={INITIAL_TOOL}
MMU_PRELOAD
{% endif %}
{% else %}
{% if printer.mmu.tool|int != INITIAL_TOOL %}
MMU_UNLOAD
MMU_SELECT TOOL={INITIAL_TOOL}
MMU_PRELOAD
{% endif %}
{% endif %}
{% endif %}

# Manually reset the MMU state to the initial state (see https://github.com/Frix-x/klippain/blob/main/docs/mmu.md#early-check-errors-during-start_print)
{% if printer.mmu.print_start_detection|int == 0 %}
Expand Down
10 changes: 9 additions & 1 deletion macros/helpers/prime_line.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ gcode:
{% set prime_line_height = params.LINE_HEIGHT|default(printer["gcode_macro _USER_VARIABLES"].prime_line_height)|default(0.6)|float %}
{% set prime_line_adaptive = params.ADAPTIVE_MODE|default(1)|int %}
{% set prime_line_margin = params.LINE_MARGIN|default(printer["gcode_macro _USER_VARIABLES"].prime_line_margin)|default(5.0)|float %} # Used only in adaptive mode

{% set prime_line_wipe = printer["gcode_macro _USER_VARIABLES"].prime_line_wipe|default(False) %}
{% set prime_line_wipe_length = prime_line_length * 0.8 %}

# If the SIZE parameter is defined and not a dummy placeholder, we use it to do the adaptive bed mesh logic
{% set coordinatesFound = false %}
{% if params.SIZE is defined and params.SIZE != "0_0_0_0" %}
Expand Down Expand Up @@ -116,8 +118,14 @@ gcode:
G92 E0
{% if prime_line_direction == "X" %}
G1 X{prime_line_x + prime_line_way*prime_line_length} E{prime_line_purge_distance} F{speed}
{% if prime_line_wipe %}
G0 X{prime_line_x + prime_line_way*prime_line_wipe_length} F{St}
{% endif %}
{% elif prime_line_direction == "Y" %}
G1 Y{prime_line_y + prime_line_way*prime_line_length} E{prime_line_purge_distance} F{speed}
{% if prime_line_wipe %}
G0 Y{prime_line_y + prime_line_way*prime_line_wipe_length} F{St}
{% endif %}
{% else %}
{ action_respond_error("Prime line direction is not valid. Choose either X or Y in the variables.cfg file!") }
{% endif %}
Expand Down
14 changes: 8 additions & 6 deletions scripts/system_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
###### BASIC SYSTEM INFO SCRIPT ######
######################################
# Written by Frix_x#0161 #
# @version: 1.0
# @version: 1.1

# CHANGELOG:
# v1.0: first version of the script to get some system info printed in the klippy.log
# v1.1: fix get_ram_info, Fixed an issue where Available RAM was displayed in "Used RAM".


# Be sure to make this script executable using SSH: type 'chmod +x ./system_info.py' when in the folder !
Expand Down Expand Up @@ -72,8 +73,8 @@ def get_os_kernel_info():
def get_ram_info():
try:
total_ram = subprocess.check_output(['free', '-m'], universal_newlines=True).split('\n')[1].split()[1]
available_ram = subprocess.check_output(['free', '-m'], universal_newlines=True).split('\n')[1].split()[6]
return total_ram, available_ram
used_ram = subprocess.check_output(['free', '-m'], universal_newlines=True).split('\n')[1].split()[2]
return total_ram, used_ram
except subprocess.CalledProcessError:
return None, None

Expand Down Expand Up @@ -112,12 +113,13 @@ def print_system_info():
print(f"System information: {get_unknown_board_info()}")


total_ram, available_ram = future_ram_info.result()
if total_ram is None or available_ram is None:
total_ram, used_ram = future_ram_info.result()
if total_ram is None or used_ram is None:
print("RAM information not found...")
else:
print(f"Available RAM: {available_ram}/{total_ram} MB")
print(f"Used RAM: {used_ram}/{total_ram} MB")


if __name__ == "__main__":
print_system_info()

Loading

0 comments on commit 384af24

Please sign in to comment.