Skip to content

Instantly share code, notes, and snippets.

@johndavisnz
Last active October 23, 2023 23:46
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johndavisnz/b5aae0236141666a77aac094701d7839 to your computer and use it in GitHub Desktop.
Save johndavisnz/b5aae0236141666a77aac094701d7839 to your computer and use it in GitHub Desktop.
installing debian 11 on nimbustor 2/4 - step 3 : setup sensors and get the it8625e fan controller working

login on the console or via ssh as root and make sure the install OS is fully updated

apt update 

( if not fully up to date then type apt upgrade and then reboot and log back in )

install sensors

apt install lm-sensors --install-suggests --install-recommends
apt install libsensors-dev --install-suggests --install-recommends
apt install gpiod --install-suggests --install-recommends

fetch the it87 kernel module source from github and build it

apt install linux-headers-amd64 binutils-doc gcc-10-locales gcc-10-multilib gcc-10-doc glibc-doc libgd-tools cpp-doc make autoconf automake libtool flex bison gdb gcc-doc doc-base glibc-doc-reference autoconf-archive gnu-standards autoconf-doc gettext bison-doc dhelp dwww dochelp doc-central yelp khelpcenter build-essential flex-doc gdb-doc gdbserver libgd-dev libtool-doc m4-doc make-doc libgd-dev
apt install git
cd
git clone https://github.com/a1wong/it87
cd it87
make modules

install the newly compiled it87 module into /lib/modules/<kernel-version>/kernel/drivers/hwmon

make install

manually load module to test

depmod -a
modprobe it87 fix_pwm_polarity=1

you should hear the fans ramp up to full speed - proving the pwm control is working

setup sensors

sensors-detect

at the prompt 'scan the ISA I/O' ports over-ride the default (NO) and type 'yes'

at the prompt 'SMBus I801 adapter at 3040 (i2c-8)' over-ride the default (NO) and type 'yes'

at the prompts for 'i915 gmbus' over-ride the default (NO) and type 'yes'

at the end type 'yes' to allow it to add the relevant lines to /etc/modules to load the coretemp kmod on boot

Manually edit the /etc/modules file to tell it to also load the new it87 module ( nano /etc/modules ) and at the end of the file add

# load custom it87 kmod
it87

now create a file /etc/modprobe.d/it87.conf and add the following lines to it

# tell the it87 module to fix pwm polarity ( otherwise can't see pwm sensors )
options it87 fix_pwm_polarity=1

this is needed to make sure the it87 kernel module supports the pwm side of the it8625e ( without it you'll get a warning during boot and /sys/class/hwmon/hwmon2 will be missing all the pwm related files needed to read/set fan speed )

note we don't use the drivetemp module as there's no way to control it's polling frequency ( suspect it's every 30mins which is too slow )

reboot and log back in - you'll hear the fan ramp up to full speed during boot

check the modules are loaded via

lsmod | grep it87
lsmod | grep coretemp

and check that sensors is seeing all the required sensors

sensors 

it should list the acpi sensors ( which give the 'system board temp', the intel on chip sensors (which give the cpu internal temperatures) and the it8625 (which primarily controls the fan)

NOTE - you will need to rebuild and reinstall the kmod after ANY kernel update!!!! This is just a case of repeating the make modules ; make install steps in the it87 directory - I use the following script to do this

#!/bin/bash
sudo make modules
sudo make install
sudo modprobe it87 fix_pwm_polarity=1
echo "if fans just went to full speed the module is working - reboot"

now proceed to step 4 to install a custom fan control script

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment