GithubHelp home page GithubHelp logo

link-am / omv-x735-fan Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 11 KB

Raspberry Pi Fan Controller: A Python script and accompanying service to control the speed of a fan connected to a Raspberry Pi based on the core temperature. Designed for use with the x735 board and OpenMediaVault, but adaptable for other setups.

License: MIT License

Python 73.23% Shell 26.77%
openmediavault raspberry-pi fan-control gpio pwm-fan python temperature-monitoring x735-board

omv-x735-fan's Introduction

omv-x735-fan Control Script

This project contains a few small scripts intended to control a PWM fan connected to a Raspberry Pi based on the core temperature of the Pi. I originally made it as a better solution to control my x735 board PWM fan on a raspberry pi 4 with OpenMediaVault installed, because the software provided by the x735 manufacturer was deprecated and I was not happy with the fan speed settings.

๐Ÿ“ Files

install.sh

This shell script installs omv-x735-fan files. It installs the python script to /usr/local/bin/, makes it executable, and sets it up to run as a service via the other shell script.

omv-x735-fan.py

This is the main Python script that controls the fan. It continuously checks the core temperature and adjusts the speed of the fan accordingly.

omv-x735-fan.sh

This shell script is used to start and stop the omv-x735-fan.py script as a service. It provides the following commands:

  • start: Starts the omv-x735-fan.py script in the background.
  • stop: Stops the omv-x735-fan.py script by killing the process.

This script is designed to be placed in /etc/init.d/ and run at startup.

๐Ÿ“‹ Requirements

  1. Python
  2. RPi.GPIO and gpiozero Python libraries
  3. Raspberry Pi with a fan connected to a GPIO pin

๐Ÿ› ๏ธ Installation

To install the service, navigate to the project directory and then run the install.sh script with superuser privileges:

sudo ./install.sh

This will copy the necessary files to their appropriate locations and tell the service to start on boot. It will also start the service immediately without needing to reboot.

To stop the service, use the following command:

sudo /etc/init.d/omv-x735-fan.sh stop

If you want to manually start the service after it has been stopped, you can do so with the following command:

sudo /etc/init.d/omv-x735-fan.sh start

๐Ÿž Debugging

The Python script includes a DEBUG_LOGGING constant that can be set to True to enable debug logging. When debug logging is enabled, the script prints the core temperature and the fan speed each time they are checked or changed.

omv-x735-fan's People

Contributors

link-am avatar

Watchers

 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.