ASUS M6N Notebook

Foreword

System sensor configuration is extremely important especially on mobile computers. One of most common cause of computers failure is overheating. Thanks to Linux lm_sensors tools we can effectively monitor state of our machine, and if necessary thanks to additional tools like cpufrequtils we can prevent overheating by automatically lowering CPU voltage and performance. This way we can use our computer effectively for a very long time.

Configuration of system sensors in Linux is not difficult, but configuration may vary from one piece of hardware to another. What I found out is the fact that most likely sensors configuration provided by core lm_sensors packet will always require a little tune up to make them work perfectly. I will try to share here configuration that is coming from my ASUS M6N notebook, quite old but still working piece of hardware. Described below configuration is applicable to Gentoo Linux distribution but most important thing the lm_sensors configuration file should work on any Linux distribution. I will start with kernel configuration.

Kernel Configuration

My ASUS M6N has sensor chip adm1021. I had to mark more then just this chip options in kernel to make lm_sensors work properly. To configure my kernel I had to enter kernel catalog and start menuconfig by running following commands in terminal:

cd /usr/src/linux
make menuconfig

Next I had to mark all modules needed to make my sensors work. Many distributions will mark all possible hardware sensor modules but this is not the Gentoo way. I want to show directly which modules are needed. Take a look at belows list of modules.

Linux Kernel Configuration: Sensor Kernel modules
Device Drivers  --->
    [*] Misc devices  --->
        EEPROM support  --->
             <M> Old I2C EEPROM reader
    <M> I2C support  --->
        <M> I2C device interface
            I2C Hardware Bus support --->  
                <M> Intel 82801 (ICH/PCH)
    <M> Hardware Monitoring Support --->
        <M> Analog Devices ADM1021 and compatibles

As you can see most of the sensors support will be build as modules. This is highly important because this modules will be loaded by lm_sensors system service. Now we are ready to recompile, install and use new kernel. I usually do it by running this commands in terminal:

cd /usr/src/linux
make && make modules_install install

Now it's good time to reboot the machine with new kernel and install lm_sensors.

Lm Sensors Configuration

I use lm_sensors 3.x and I would not recommend using older version. To install lm_sensors in Gentoo system you need to run this commands in terminal:

emerge -av sys-apps/lm_sensors

Next thing we should do is to make sure that programs able to use system sensors will be compiled with this support. To do it we need to add lm_sensors use flag to our /etc/make.conf file. After doing this it is good idea to check which of installed programs should be recompiled. You can do it by using gentoolkit equery utility like this:

equery hasuse lm_sensors
 * Searching for USE flag lm_sensors ... 
[IP-] [  ] kde-base/ksysguard-4.4.4:4.4
[IP-] [  ] net-analyzer/net-snmp-5.4.2.1-r4:0
[IP-] [  ] sys-power/cpufreqd-2.4.2:0

After rebuilding all packages we may go to lm_sensors configuration. First thing we need to provide is sensors module configuration. There is sensors-detect utility provided with lm_sensors unfortunately it wasn't able to probe sensors for my notebook. I did my configuration manually by editing /etc/conf.d/lm_sensors configuration file. You can see the file below.

View the full /etc/conf.d/lm_sensors configuration file
  1. # The format of this file is a shell script that simply defines variables:
  2. # HWMON_MODULES for hardware monitoring driver modules, and optionally
  3. # BUS_MODULES for any required bus driver module (for example for I2C or SPI).
  4.  
  5. # Load modules at startup
  6. LOADMODULES=yes
  7.  
  8. # Initialize sensors at startup
  9. INITSENSORS=yes
  10.  
  11. #HWMON_MODULES="adm1021"
  12.  
  13. # For compatibility reasons, modules are also listed individually as variables
  14. # MODULE_0, MODULE_1, MODULE_2, etc.
  15. # Please note that the numbers in MODULE_X must start at 0 and increase in
  16. # steps of 1. Any number that is missing will make the init script skip the
  17. # rest of the modules. Use MODULE_X_ARGS for arguments.
  18. #
  19. # You should use BUS_MODULES and HWMON_MODULES instead if possible.
  20. MODULE_0=i2c-i801
  21. MODULE_1=i2c-dev
  22. MODULE_2=eeprom
  23. MODULE_3=adm1021
  24. MODULE_3_ARGS=force_max1617a=0,0x4c

As you can see the most important things in this file are lines on the bottom part which are responsible for loading modules. You can see here the names of modules I mark in the kernel above. Highly important thing for ASUS M6N sensor configuration is passing additional arguments to main sensors adm1021 module. Without argument force_max1617a=0,0x4c the sensor chip for ASUS M6N will not be initialized.

Last thing we need to do is to provide our sensor configuration. The generic configuration for lm_sensors is kept in /etc/sensors3.conf file. I found out that kept there configuration are far from being perfect for my notebook. Thats why I created my own configuration. The important thing is to remember not to change default file, because you will loose your configuration with every lm_sensors update. You should create your personal configuration in /etc/sensors.d/ catalog. Below you can see file created for my notebook sensors.

View the full /etc/sensors.d/asus_notebook configuration file
  1. chip "max1617a-*"
  2.  
  3. label temp1 "Board Temp"
  4. label temp2 "CPU Temp"
  5. set temp1_max 66
  6. set temp1_min 40
  7. set temp2_max 90
  8. set temp2_min 50

As you can see the configuration file is vary basic. My chip has two sensors one for CPU and second one for Motherboard. In configuration file I'm providing sensor chip name, labels for my sensors and minimum and maximum possible temperatures.

Now I'm ready to use my sensors. I can start them by running following command in terminal:

/etc/init.d/lm_sensors start

To make my lm_sensors start as system service I have to run following command in terminal:

rc-update add lm_sensors default

To check my machine temperature state I have to run this simple command in terminal:

sensors
max1617a-i2c-0-4c
Adapter: SMBus I801 adapter at 0540
Board Temp:  +49.0°C  (low  = +40.0°C, high = +66.0°C)
CPU Temp:    +84.0°C  (low  = +75.0°C, high = +105.0°C)

Prove that it's working

Sources


Comments

If you have found something wrong with the information provided above or maybe you just want to speak your mind about it, feel free to leave a comment.
All comments will show up on page after being approved. Sorry for such policy but I want to make sure that my site will be free of abusive or vulgar content. I don't mind being criticized just do it using right words.

Leave a comment