Skip to content

Shell script for enabling PWM fan control on FriendlyElec (NanoPi) SBCs.

License

Notifications You must be signed in to change notification settings

ckwun/nanopi-pwm-fan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

Shell script for enabling PWM fan control on FriendlyElec (NanoPi) SBCs.

Only tested on NanoPi NEO3 with Armbian. But should work for most SBC with the 2pin fan connector.

Quick Start

git clone https://github.com/ckwun/nanopi-pwm-fan
cd nanopi-pwm-fan
chmod +x start-pwm-fan install.sh  uninstall.sh

Run

Run the script with default configuration:

./start-pwm-fan

Config

Custom configuration can be made by modifying the pwm-fan.conf file.

Run the script with config file:

./start-pwm-fan pwm-fan.conf
Name Description Default
PWM PWM API path "/sys/class/pwm/pwmchip0"
TEMP Thermal API path "/sys/class/thermal/thermal_zone0/temp"
PERIOD Total period of the PWM signal 8000000
POLARITY Polarity of the PWM signal "normal"
TARGET_TEMPS If current temperature is greater than TARGET_TEMPS[i], duty cycle will be set to DUTY_CYCLES[i] (65000 60000 55000 50000)
DUTY_CYCLES The active time of the PWM signal (8000000 6000000 4000000 2000000)
DEFAULT_DUTY_CYCLE Duty cycle will be set to this value if current temperature is lower than all TARGET_TEMPS 0

For more info, see: kernel.org - Pulse Width Modulation (PWM) interface

Install

Install it as systemd service, and enable it to auto start at boot:

./install.sh

Uninstall

Stop and disable the service, remove all files added by install.sh:

./uninstall.sh

About

Shell script for enabling PWM fan control on FriendlyElec (NanoPi) SBCs.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages