### Manual Installation (amd64) Source: https://github.com/markusressel/fan2go/blob/master/README.md Download and install the fan2go binary for amd64 architecture. ```shell # Install dependencies sudo pacman -S libnotify curl -L -o fan2go https://github.com/markusressel/fan2go/releases/latest/download/fan2go-linux-amd64 chmod +x fan2go sudo cp ./fan2go /usr/bin/fan2go fan2go -h ``` -------------------------------- ### Compile from Source Source: https://github.com/markusressel/fan2go/blob/master/README.md Clone the repository, build, and install fan2go from source. ```shell git clone https://github.com/markusressel/fan2go.git cd fan2go make build sudo cp ./bin/fan2go /usr/bin/fan2go sudo chmod ug+x /usr/bin/fan2go ``` -------------------------------- ### CMD fan configuration example Source: https://github.com/markusressel/fan2go/blob/master/README.md YAML configuration for defining a 'cmd' type fan in fan2go, specifying commands to set and get PWM and RPM values. ```yaml fans: - id: cmd_fan cmd: # Command to apply a new PWM value (0..255) # Use "%pwm%" to specify where the target pwm value should be used within the arguments setPwm: exec: /usr/bin/some-program args: [ "--set", "%pwm%" ] # Command to retrieve the current PWM value (0..255) getPwm: exec: /usr/bin/nvidia-settings args: [ "-a", "someargument" ] # (optional) Command to retrieve the current RPM value getRpm: exec: /usr/bin/nvidia-settings args: [ "-a", "someargument" ] ``` -------------------------------- ### Nix OS Installation (stable) Source: https://github.com/markusressel/fan2go/blob/master/README.md Install fan2go on Nix OS using the stable channel. ```shell nix-env -f '' -iA fan2go ``` -------------------------------- ### File Sensor Content Example Source: https://github.com/markusressel/fan2go/blob/master/README.md Example content of a file used for the file sensor, showing milli-units. ```bash > cat /tmp/file_sensor 10000 ``` -------------------------------- ### Nix OS Installation with Flakes Source: https://github.com/markusressel/fan2go/blob/master/README.md Install fan2go on Nix OS using flakes. ```shell nix profile install nixpkgs#fan2go ``` -------------------------------- ### Direct Control Algorithm Configuration Source: https://github.com/markusressel/fan2go/blob/master/README.md Configuration example for the direct control algorithm in YAML format. ```yaml fans: - id: some_fan ... controlAlgorithm: direct ``` -------------------------------- ### File Sensor Configuration Source: https://github.com/markusressel/fan2go/blob/master/README.md Example YAML configuration for monitoring temperature from a file. ```yaml sensors: - id: file_sensor file: path: /tmp/file_sensor ``` -------------------------------- ### Arch Linux Installation Source: https://github.com/markusressel/fan2go/blob/master/README.md Install fan2go on Arch Linux using yay. ```shell yay -S fan2go-git ``` -------------------------------- ### Disk Temperature Configuration Source: https://github.com/markusressel/fan2go/blob/master/README.md Example YAML configuration for monitoring disk temperatures. ```yaml sensors: - id: ssd_temp disk: # Full path (recommended for clarity) device: /dev/disk/by-id/ata-Samsung_SSD_870_EVO_1TB_S1234567890 # Short form also accepted (prefix /dev/disk/by-id/ is auto-applied): # device: ata-Samsung_SSD_870_EVO_1TB_S1234567890 # The /dev/ prefix is also optional (e.g. just "sda"): # device: sda - id: nvme_temp disk: device: /dev/disk/by-id/nvme-Samsung_SSD_980_1TB_S1234567890 # Short form: device: nvme-Samsung_SSD_980_1TB_S1234567890 ``` -------------------------------- ### PID Control Algorithm Configuration Source: https://github.com/markusressel/fan2go/blob/master/README.md Configuration example for the PID control algorithm in YAML format, including P, I, and D values. ```yaml fans: - id: some_fan ... controlAlgorithm: pid: p: 0.3 i: 0.02 d: 0.005 ``` -------------------------------- ### Direct Control Algorithm with Max PWM Change Source: https://github.com/markusressel/fan2go/blob/master/README.md Configuration example for the direct control algorithm with a limit on PWM change per cycle. ```yaml fans: - id: some_fan ... controlAlgorithm: direct: maxPwmChangePerCycle: 10 ``` -------------------------------- ### CMD Sensor Configuration Source: https://github.com/markusressel/fan2go/blob/master/README.md Example YAML configuration for monitoring temperature using a command execution. ```yaml sensors: - id: cmd_fan cmd: exec: /usr/bin/bash args: [ '/home/markus/myscript.sh' ] ``` -------------------------------- ### HwMon Sensor Configuration Source: https://github.com/markusressel/fan2go/blob/master/README.md Example YAML configuration for monitoring temperature using HwMon sensors. ```yaml sensors: - id: cpu_package hwmon: platform: coretemp index: 1 ``` -------------------------------- ### NVIDIA Sensor Configuration Source: https://github.com/markusressel/fan2go/blob/master/README.md Example YAML configuration for monitoring temperature using NVIDIA sensors. ```yaml sensors: - id: gpu_temp nvidia: device: nvidia-10DE2489-0800 index: 1 ``` -------------------------------- ### File based fan configuration example Source: https://github.com/markusressel/fan2go/blob/master/README.md YAML configuration for defining a 'file' type fan in fan2go, using specified file paths for PWM and RPM. ```yaml fans: - id: file_fan file: # Path to a file to get/set the PWM target for this fan path: /tmp/file_fan # Path to a file to read the current RPM value of this fan rpmPath: /tmp/file_fan_rpm ``` -------------------------------- ### HwMon fan configuration example Source: https://github.com/markusressel/fan2go/blob/master/README.md YAML configuration for defining an 'hwmon' type fan in fan2go. ```yaml # A list of fans to control fans: # A user defined ID. # Used for logging only - id: cpu # The type of fan configuration, one of: hwmon | file hwmon: # A regex matching a controller platform displayed by `fan2go detect`, f.ex.: # "nouveau", "coretemp", "it8620", "corsaircpro-.*" etc. platform: nct6798 # The channel of this fan's RPM sensor as displayed by `fan2go detect` rpmChannel: 1 # The pwm channel that controls this fan; fan2go defaults to same channel number as fan RPM pwmChannel: 1 # Indicates whether this fan should never stop rotating, regardless of # how low the curve value is neverStop: true # The curve ID that should be used to determine the # speed of this fan curve: cpu_curve ``` -------------------------------- ### NVIDIA GPU fan configuration example Source: https://github.com/markusressel/fan2go/blob/master/README.md YAML configuration for defining an 'nvidia' type fan in fan2go. ```yaml fans: - id: gpufan1 nvidia: # A regex matching a nvidia device as displayed by `fan2go detect` # the following matches all nvidia devices in your system # (good enough if you only have one), otherwise you could # also use nvidia-10DE2489-0800 or similar device: nvidia # The fan's index as shown by `fan2go detect` index: 1 curve: gpu_curve # same for the second fan - id: gpufan2 nvidia: device: nvidia index: 2 curve: gpu_curve ``` -------------------------------- ### Get sensor reading Source: https://github.com/markusressel/fan2go/blob/master/README.md Retrieves the current reading for a specific sensor (e.g., 'cpu_package'). ```shell > fan2go sensor --id cpu_package ``` -------------------------------- ### Detecting fans using fan2go Source: https://github.com/markusressel/fan2go/blob/master/README.md Example output of the `fan2go detect` command, showing fans and sensors detected on the system via hwmon and NVIDIA backends. ```shell $ fan2go detect =========== hwmon: ============ > Platform: nct6798-isa-0290 Fans Index Channel Label RPM PWM Mode 1 1 hwmon4/fan1 0 153 Manual 2 2 hwmon4/fan2 1223 104 Manual 3 3 hwmon4/fan3 677 107 Manual Sensors Index Label Value 1 SYSTIN 41000 2 CPUTIN 64000 > Platform: amdgpu-pci-0031 Fans Index Channel Label RPM PWM Mode 1 1 hwmon8/fan1 561 43 Manual Sensors Index Label Value 1 edge 58000 2 junction 61000 3 mem 56000 =========== nvidia: =========== > Device: nvidia-10DE2489-0800 Fans Index Label PWM RPM Mode 1 Fan 1 36 1300 Auto 2 Fan 2 36 1298 Auto Sensors Index Label Value 1 Temperature 59000 ``` -------------------------------- ### Reading file fan values Source: https://github.com/markusressel/fan2go/blob/master/README.md Example commands to read the current PWM and RPM values from files used for file-based fan control. ```shell > cat /tmp/file_fan 255 > cat /tmp/file_fan_rpm 3421 ``` -------------------------------- ### Systemd service management for fan2go Source: https://github.com/markusressel/fan2go/blob/master/README.md Commands to reload the systemd daemon, enable and start the fan2go service, and follow its logs. ```shell sudo systemctl daemon-reload sudo systemctl enable --now fan2go # follow logs journalctl -u fan2go -f ``` -------------------------------- ### Get current fan RPM Source: https://github.com/markusressel/fan2go/blob/master/README.md Retrieves the current RPM of a specific fan (e.g., 'cpu'). ```shell > fan2go fan --id cpu rpm ``` -------------------------------- ### Get current fan speed Source: https://github.com/markusressel/fan2go/blob/master/README.md Retrieves the current speed of a specific fan (e.g., 'cpu'). ```shell > fan2go fan --id cpu speed ``` -------------------------------- ### Get current fan mode Source: https://github.com/markusressel/fan2go/blob/master/README.md Retrieves the current operating mode of a specific fan (e.g., 'cpu'). ```shell > fan2go fan --id cpu mode ``` -------------------------------- ### Create Configuration Directory and File Source: https://github.com/markusressel/fan2go/blob/master/README.md Create the recommended directory and a sample YAML configuration file for fan2go. ```shell sudo mkdir /etc/fan2go sudo nano /etc/fan2go/fan2go.yaml ``` -------------------------------- ### Run fan2go with default configuration Source: https://github.com/markusressel/fan2go/blob/master/README.md This command launches the fan2go daemon with its default configuration file located at /etc/fan2go/fan2go.yaml. ```shell > sudo fan2go ``` -------------------------------- ### Run fan2go with a custom configuration file Source: https://github.com/markusressel/fan2go/blob/master/README.md This command launches the fan2go daemon and specifies a custom configuration file path. ```shell > sudo fan2go -c /home/markus/my_fan2go_config.yaml ``` -------------------------------- ### Advanced Fan Configuration Options Source: https://github.com/markusressel/fan2go/blob/master/README.md YAML configuration snippet demonstrating advanced options for fine-tuning fan behavior, including PWM limits, mapping, and control modes. ```yaml fans: - id: ... ... # (Optional) Override for the lowest PWM value at which the # fan is able to maintain rotation if it was spinning previously. minPwm: 30 # (Optional) Override for the lowest PWM value at which the # fan will still be able to start rotating. # Note: Settings this to a value that is too small # may damage your fans. Use at your own risk! startPwm: 30 # (Optional) Override for the highest PWM value which still yields # an increased rotational speed compared to lower values. # Note: you can also use this to limit the max speed of a fan. maxPwm: 255 # (Optional) Override the global fanController.pwmSetDelay for this specific fan. # Useful when a fan requires more or less time to respond to PWM changes than the global default. # pwmSetDelay: 10ms # (Optional) Configure how fan2go maps the internal [0..255] PWM range to # hardware-specific PWM values. If omitted, fan2go auto-detects the mapping # during fan initialization. # # Modes: # # autodetect (default): auto-detect the PWM map during fan initialization. pwmMap: autodetect # # identity: assume a 1:1 mapping (0→0, 1→1, ..., 255→255). # Use this if your fan supports the full PWM range and you want to skip # the initialization measurement. # pwmMap: identity # # linear: linearly interpolate between user-specified control points. # Useful when you know the endpoints (or intermediate points) but want # smooth values in between. # Note: values must be strictly monotonically increasing. # pwmMap: # linear: # 0: 0 # 255: 255 # # values: step-interpolate user-specified control points. # Use for fans that only support a limited set of discrete PWM values # (e.g. off / low / medium / high). # Note: values must be strictly monotonically increasing. # pwmMap: # values: # 0: 0 # 64: 128 # 192: 255 # (Optional) Configure how fan2go determines the mapping from a PWM value it sets # to the value the fan hardware reports back. Some fans do not echo the exact value # written due to hardware or driver quirks. If omitted, fan2go auto-detects this # during fan initialization. # # Modes: # # autodetect (default): sweep all PWM values and record what the fan reports back. setPwmToGetPwmMap: autodetect # # identity: assume the fan reports back exactly what was set (1:1 mapping). # Equivalent to the --assume-pwm-map-identity flag on `fan2go fan init`. # setPwmToGetPwmMap: identity # # linear: linearly interpolate between user-specified control points. # setPwmToGetPwmMap: # linear: # 0: 0 # 255: 255 # # values: step-interpolate user-specified control points. # setPwmToGetPwmMap: # values: # 0: 0 # 128: 128 # 255: 255 # (Optional) Configure the control mode fan2go uses while running and on exit. # Both fields are optional; omitting controlMode entirely preserves existing behavior. # # active: the control mode to set when fan2go takes control of this fan. # Accepts: "pwm" (default, with "disabled" fallback), "disabled", "auto", or an integer. # onExit: what to do when fan2go exits. # String shorthand: # onExit: restore # restore original control mode (default) # onExit: none # leave fan at last speed set by fan2go (useful for hardware controllers # # that remember PWM settings — see issue #416) # Map form (set explicit values on exit): # onExit: # mode: auto # set a specific control mode on exit # speed: 128 # set a fixed PWM speed on exit (0..255) # # controlMode and speed can be combined or used independently. controlMode: active: pwm onExit: restore # By default (useUnscaledCurveValues: false) speed values from the curve are scaled # from 1..255 (or 1%..100%) to MinPwm..MaxPwm and speed values < 1(%) are set to 0, # before they're mapped with pwmMap (the value looked up in pwmMap is then used to # actually set the speed in the fan's controlling device). # If useUnscaledCurveValues is set to true, the values from the curve for a specific temperature # are directly mapped with PwmMap, *without* scaling them first. # Note: If neverStop is also set to true, values smaller than MinPwm (including 0) are replaced with # MinPwm, otherwise values smaller than MinPwm are replaced with 0 (the fan wouldn't turn anyway). # But all values >= MinPwm are used as is if this option is set to true. useUnscaledCurveValues: true ``` -------------------------------- ### API Configuration Source: https://github.com/markusressel/fan2go/blob/master/README.md Configuration options for enabling and setting up the REST API. ```yaml api: # Whether to enable the API or not enabled: false # The host to listen for connections host: localhost # The port to listen for connections port: 9001 ``` -------------------------------- ### fan2go configuration for Prometheus exporter Source: https://github.com/markusressel/fan2go/blob/master/README.md YAML configuration snippet to enable and configure the Prometheus exporter for statistics. ```yaml statistics: # Whether to enable the prometheus exporter or not enabled: true # The port to expose the exporter on port: 9000 ``` -------------------------------- ### GNU Affero General Public License Source: https://github.com/markusressel/fan2go/blob/master/README.md The license text for the fan2go project. ```text fan2go Copyright (C) 2021 Markus Ressel This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . ``` -------------------------------- ### Fan Controller Configuration Source: https://github.com/markusressel/fan2go/blob/master/README.md Configuration option for the rate at which fan speed targets are updated. ```yaml fanController: # The rate at which fan speed targets are updated adjustmentTickRate: 200ms ``` -------------------------------- ### Advanced Sanity Check Configuration Source: https://github.com/markusressel/fan2go/blob/master/README.md This snippet shows optional configuration settings for sanity checks within fan2go, specifically for detecting third-party modifications to PWM values and fan modes. ```yaml # (Optional) Configuration options for sanity checks sanityCheck: # (Optional) Control the behavior of the "pwmValueChangedByThirdParty" sanity check # This check is used to detect if the PWM value of a fan has changed between two consecutive # control loop cycles, which is usually an indication that an external program is trying to control the fan # at the same time as fan2go. This can lead to unexpected behavior and is usually not desired, so # fan2go will log a warning if this happens. pwmValueChangedByThirdParty: # (Optional) Whether to enable this check or not enabled: true # (Optional) Control the behavior of the "fanModeChangedByThirdParty" sanity check # This check is used to detect if the fan mode (automatic/manual) has changed between two consecutive # control loop cycles, which is usually an indication that an external program is trying to control the fan # at the same time as fan2go. This can lead to unexpected behavior and is usually not desired, so # fan2go will reset the desired fan mode and log a warning if this happens. fanModeChangedByThirdParty: # (Optional) Whether to enable this check or not enabled: true # (Optional) Throttle duration for the execution of this check. throttleDuration: 10s ``` -------------------------------- ### Set fan speed Source: https://github.com/markusressel/fan2go/blob/master/README.md Sets the speed of a specific fan (e.g., 'cpu') to 100%. ```shell > fan2go fan --id cpu speed 100 ``` -------------------------------- ### Validate Configuration Command Source: https://github.com/markusressel/fan2go/blob/master/README.md Command to validate the fan2go configuration file. ```shell > sudo fan2go config validate INFO Using configuration file at: /etc/fan2go/fan2go.yaml SUCCESS Config looks good! :) ``` -------------------------------- ### Print fan curve data Source: https://github.com/markusressel/fan2go/blob/master/README.md Displays the measured fan curve data for a specific fan (e.g., 'cpu'). ```shell > sudo fan2go fan --id cpu curve ``` -------------------------------- ### Validate Specific Configuration File Command Source: https://github.com/markusressel/fan2go/blob/master/README.md Command to validate a specific fan2go configuration file. ```shell > fan2go -c "./my_config.yaml" config validate INFO Using configuration file at: ./my_config.yaml WARNING Unused curve configuration: m2_first_ssd_curve ERROR Validation failed: Curve m2_ssd_curve: no curve definition with id 'm2_first_ssd_curve123' found ``` -------------------------------- ### Linear Speed Curve with Min/Max Source: https://github.com/markusressel/fan2go/blob/master/README.md Defines a simple linear speed curve based on minimum and maximum sensor temperature values. ```yaml curves: - id: cpu_curve # The type of the curve, one of: linear | function linear: # The sensor ID to use as a temperature input sensor: cpu_package # Sensor input value (in degrees Celsius) # at which the curve is at minimum speed min: 40 # Sensor input value at which the curve is at maximum speed max: 80 ``` -------------------------------- ### Linear Speed Curve with Steps (0-255 Range) Source: https://github.com/markusressel/fan2go/blob/master/README.md Defines a linear speed curve using steps, with speed values specified in the 0-255 range. ```yaml curves: - id: cpu_curve # The type of the curve linear: # The sensor ID to use as a temperature input sensor: cpu_package # Steps to define a section-wise defined speed curve function. steps: # Sensor value (in degrees Celsius) -> Speed (0-255) - 40: 0 - 41: 1 - 50: 50 - 80: 255 ``` -------------------------------- ### PID Based Speed Curve Source: https://github.com/markusressel/fan2go/blob/master/README.md Configures a speed curve using a PID controller, allowing for custom behavior based on a setpoint and PID parameters. ```yaml curves: - id: pid_curve pid: sensor: cpu_package setPoint: 60 p: -0.05 i: -0.005 d: -0.005 ``` -------------------------------- ### Set fan mode to automatic Source: https://github.com/markusressel/fan2go/blob/master/README.md Sets the operating mode of a specific fan (e.g., 'cpu') to automatic control by integrated hardware. ```shell > fan2go fan --id cpu mode auto ``` -------------------------------- ### Function Based Curve Aggregation Source: https://github.com/markusressel/fan2go/blob/master/README.md Combines existing curves using an aggregation function (e.g., average) to create more complex curves. ```yaml curves: - id: case_avg_curve function: # Type of aggregation function to use, one of: minimum | maximum | average | delta | sum | difference type: average # A list of curve IDs to use curves: - cpu_curve - mainboard_curve - ssd_curve ``` -------------------------------- ### Linear Speed Curve with Steps Source: https://github.com/markusressel/fan2go/blob/master/README.md Defines a linear speed curve using discrete steps, interpolating between defined sensor values and corresponding speeds. ```yaml curves: - id: cpu_curve # The type of the curve linear: # The sensor ID to use as a temperature input sensor: cpu_package # Steps to define a section-wise defined speed curve function. steps: # Sensor value (in degrees Celsius) -> Speed - 40: 0% # 0% and speed value 0 are the same - 41: 1% # 1% and speed value 1 are the same and mean "run at minimum speed" (MinPwm) # Note: between 41 and 50°C the fan speed will be interpolated between 1% and 20% - 50: 20% # 20% is equivalent to speed value ≈ 50 # Note: between 50 and 80°C the fan speed will be interpolated between 20% and 100% # for example, at 65°C it'll run at 60% speed - 80: 100% # 100% is equivalent to speed value 255 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.