Skip to content

Add support for repuposing mainboard fan RPM pin #243

Description

@bniggemyer

The user may wish to use the mainboard fan RPM pin for another purpose. The primary use case is the installation of a BTT SFS sensor. PC0 remains as the runout sensor, and PG6 becomes the movement sensor. As the pin is currently defined in machine.cfg, defining it in printer.cfg will result in a duplicate entry error and klipper will fail to start. My current solution for this is to simply have an init.d script which removes the line from machine.cfg. Another user has created a personal fork with the line removed and is deploying their own builds. Neither solution is portable or configurable.

Proposed solution:
1. Add a line to cosmos.config

# remove motherboard fan RPM pin sensor from machine.cfg (e.g, the user has repurposed the pin in printer.cfg for a filament sensor)
disable_mainboard_rpm_pin = False

2. Add a new script to config-manager recipes (it does not seem appropriate to use build-klipper-var-config for this purpose, and in the future there may be other desired manipulations of machine.cfg based on user defined settings.)

#update_machine.config.sh
#!/bin/sh

set -eu

CONFIG_MANAGER="/usr/bin/config-manager"
OUTPUT_DIR="/etc/klipper/config/klipper-readonly"
OUTPUT_FILE="${OUTPUT_DIR}/machine.cfg"

get_config_value() {
	"${CONFIG_MANAGER}" klipper "$1"
}
disable_mainboard_rpm_pin=$(get_config_value disable_mainboard_rpm_pin)
if $(echo "$disable_mainboard_rpm_pin" | tr '[:upper:]' '[:lower:]'); then
	sed -i '/PG6/d' "${OUTPUT_FILE}"
else
        #placeholder - there needs to be a mechanism to restore/re-enable PG6
fi
  1. Add update_machine.config to klipper-init-d

ref https://elvinhome.io/blog/articles-3/making-my-3d-printer-work-with-big-filament-spools-15

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions