Code Monkey home page Code Monkey logo

pi_fan_ctrl's Introduction

pi_fan_ctrl

Yet another variable fan controller for the RaspberryPi.

This script is based on the instructable tutorial of Aerandir14 available at this link.

The main differences are:

  • set/get-able parameters
  • the fan speed value ([0-100] %) is written to a file (optional)
  • packaged as a snap for easier distribution

Installation

$ sudo snap install pi-fan-ctrl

You should then connect the snap interface,

$ snap connect pi-fan-ctrl:hardware-observe
$ snap connect pi-fan-ctrl:gpio pi4-devel:bcm-gpio-21

Parameters

The parameters are all set/get-able through the commands:

snap get/set pi-fan-ctrl <parameters>

The available parameters and their default values are as follows,

# Fan control configuration

gpio:     21  # BCM used to drive transistor's base
fan_min:  20  # [%] Fan minimum speed.
sleep:     1  # [s] Time to wait between each refresh
pwm_freq: 25  # [Hz] Change this value if fan has strange behavior

hyst: 1 # Fan speed will change only of the difference of temperature is higher than hysteresis

fan_speed_out: True # Whether to write the fan speed to a file or not

# !!! Not yet configurable !!!
#
# Configurable temperature and fan speed steps
# temp_steps:  [50, 55,   60, 65,   70]   # [C]
# speed_steps: [30, 47.5, 65, 82.5, 100]  # [%]

Finally, if fan_speed_out: True the fan speed will be written to a file in the snap. To retrieve the current fan speed simply issue,

$ cat /var/snap/pi-fan-ctrl/common/fan_speed
45

pi_fan_ctrl's People

Contributors

artivis avatar

Watchers

 avatar  avatar  avatar

Forkers

kpwebb

pi_fan_ctrl's Issues

pi4-devel not available

Thanks for all the work here!
I'm trying to get your script running on a RPi4 with Ubuntu 21.04 (ARM64). Unfortunatly I'm stuck here:

snap connect pi-fan-ctrl:gpio pi4-devel:bcm-gpio-21
error: snap "pi4-devel" is not installed
snap install pi4-devel
error: snap "pi4-devel" not found

Any idea how to get this connection working?

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.