https://github.com/artivis/pi_fan_ctrl
Fan control for the Raspberry Pi
https://github.com/artivis/pi_fan_ctrl
fancontrol-script python raspberry-pi snap snapcraft
Last synced: about 2 months ago
JSON representation
Fan control for the Raspberry Pi
- Host: GitHub
- URL: https://github.com/artivis/pi_fan_ctrl
- Owner: artivis
- Created: 2020-06-05T23:14:48.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-07T21:11:10.000Z (about 6 years ago)
- Last Synced: 2025-02-01T09:42:44.347Z (over 1 year ago)
- Topics: fancontrol-script, python, raspberry-pi, snap, snapcraft
- Language: Python
- Size: 3.91 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pi_fan_ctrl
Yet another variable fan controller for the RaspberryPi.
This script is based on the [instructable][instructable] tutorial of
[Aerandir14][Aerandir14] available [at this link][tutorial].
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
```bash
$ sudo snap install pi-fan-ctrl
```
You should then connect the snap interface,
```bash
$ 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:
```bash
snap get/set pi-fan-ctrl
```
The available parameters and their default values are as follows,
```yaml
# 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,
```bash
$ cat /var/snap/pi-fan-ctrl/common/fan_speed
45
```
[//]: # (URLs)
[instructable]: https://www.instructables.com/
[Aerandir14]: https://www.instructables.com/member/Aerandir14/
[tutorial]: https://www.instructables.com/id/PWM-Regulated-Fan-Based-on-CPU-Temperature-for-Ras/