senior-sigan / lenovo-yoga-fan-control

Program for Linux to control Fan Speed on Lenovo Yoga 13.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lenovo-yoga-fan-control

Program for Linux-based OS to control Fan Speed on Lenovo Yoga 13.

Inside the Lenovo Yoga is an embedded controller (EC), which is responsible for some of the Yoga's low-level tasks. One of them is Fan controling.

There is 'notebook fan control' programm for controlling Fan on windows in internet.

Temperature Monitoring and Fan Control

There is a CPU temperature sensor connected to the EC via SMBus; note that this SMBus is not accessible by the CPU, and so the Linux i2c drivers cannot see any devices on this bus.

The fan is connected to a fan controller in the EC, which allows the fan speed to be varied (using PWM) between 0% and 100% duty cycle. By default, the EC sets the fan speed very strange. All time works on 60% of maximum fan speed.

This program works in automatic mode. It's controling Fan with my custom temp table. You should run it as root in background. I plane to make linux kernel with this functioanlity.

HowTo use

You can compile program from source.

Compiling from sourse:

sudo apt-get install gcc-4.9-base cmake git g++
git clone https://github.com/blan4/lenovo-yoga-fan-control.git
cd lenovo-yoga-fan-control
cmake CMakeLists.txt
make
sudo ./yoga_fan

For running script at runtime do this as ROOT:

sudo -s
make install
update-rc.d yoga_fan_daemon defaults

If you use system.d you should copy service file yoga_fan.service to /etc/systemd/system/ directory. After that enable service by sudo systemctl enable yoga_fan.service

Useful links

Ec specification

Yoga TempTable Bios patch for old versions

Linux IO programming

Kernel module for Asus eeePc

NBFC

###TODO:

  • add daemon for ubuntu
  • add daemon for systemd based
  • add config file
  • widget with fan speed and temperature
  • add fan device output and input to /sys/class/hwmon

About

Program for Linux to control Fan Speed on Lenovo Yoga 13.

License:GNU General Public License v2.0


Languages

Language:C++ 45.5%Language:Shell 45.0%Language:CMake 9.5%