Giter VIP home page Giter VIP logo

fanctrl's Introduction

Raspberry PI Fan control

This script keeps your SBC healthy by regularly checking CPU temperature and running an externally attached fan when necessary.

Installation

$ apt install python3 python3-pip

Run ./install.sh. This installs Python requirements and copies fanctrl to /usr/bin/.

$ ./install.sh

Optional

By running ./install_systemd.sh, fanctrl is installed as systemd service fanctrl.service under lib/systemd/system/ to run after each system start. Log is written to /var/log/fanctrl.txt.

$ ./install_systemd.sh

Usage

When installed for running after system start, there is no need to run fanctrl manually as temperature checks and fan spinning is performed automatically.

To manually run the fan, call fanctrl -f:

# Run the fan, no matter the actual cpu temperature
$ fanctrl -f

Get more information with fanctrl -h:

usage: fanctrl.py [-h] [-f [FORCE]] [-i [INTERVAL]] [-t [TEMPERATURE]]
                  [-p [PIN]] [-l [LOG]]

optional arguments:
  -h, --help            show this help message and exit
  -f [FORCE], --force [FORCE]
                        Force fan on for FORCE time (default: 15s), no matter
                        the temperature, and quit. Program does not enter
                        scheduling mode.
  -i [INTERVAL], --interval [INTERVAL]
                        Interval in which cpu temperature is checked. Min:
                        10s, Default: 30s
  -t [TEMPERATURE], --temperature [TEMPERATURE]
                        Temperature (in °C) at which the cooling function is
                        triggered. Default: 48°C
  -p [PIN], --pin [PIN]
                        Physical pin which triggers the fan (BCM mode).
                        Default: 17
  -l [LOG], --log [LOG]
                        The log file temperature changes are written to.
                        Called once per interval.

Default values

  • Default fan pin: 17 (BCM mode)
  • Default temperature trigger: 48°C
  • Default interval: 30 seconds
  • Default fan timer in force mode: 15 seconds

fanctrl's People

Contributors

abzicht avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.