# # # # lm_sensors/i2c micro-HowTo # Ray Olszewski # # 06-May-00 rxo Created lm_sensor uhow2 # Tested on Debian potato ( debian-2.2 ) - linux-2.2.15 # # 06-May-00 amo Tested on redhat-6.2 linux-2.2.14 # # NOTE: The i2c package contains the older isa-bus kernel modules needed for sensor use. The lm_sensors package contains the newer isa-bus modules, some SMBus modules, and userspace utilities needed to probe for sensors and, if our custom perl program is not used, to access and interpret the data put by the sensors modules in /proc . 1. Get and install the source for your preferred (2.2.x) kernel. Symlink it to /usr/src/linux 2. Set your kernel options and compile a kernel. Install it. 3. Download the lm_sensors and i2c tarballs from http://www2.lm-sensors.nu/~lm78/download.html For 2.2.x kernels: lm_sensors-2.5.0.tar.gz i2c-2.5.0.tar.gz 4. Un'tar the compressed (bz2) files into directories. root# cd /usr/local/src root# tar zxvfp lm_sensors-2.5.0.tar.gz root# tar zxvfp i2c-2.5.0.tar.gz 5. Install the i2c package. There is an accompanying INSTALL that describes compilation options; I did it by compiling separately from the kernel. The Makefile needs only minor (if any; depends on distribution, I suppose) edits. Then run "make clean", "make dep", "make all", and "make install". # # # # if you get missing *.d errors, you need to run "make dep" # # Install i2c # ----------- root# cd /usr/local/src/i2c-2.5.0 root# make clean root# make dep - might want to run it twice - verify it has no errors root# make root# make install # # fix kernel/modules sillyness root# mv /lib/modules/2.2.14/misc/* /lib/modules/2.2.14-5.0/misc/ 6. Install the lm_sensors package. There is an accompanying INSTALL that describes compilation options; I did it by compiling separately from the kernel. The Makefile needed only minor (if anydepends on distribution, I suppose) edits. It does require bison and flex to make. Then run "make clean", "make dep", "make all", and "make install". On one system, libsensors was installed into /usr/local/lib, where it was not detected. Adding a symlink to /usr/lib solved this problem. # # install lm_sensors # ------------------ root# cd /usr/local/src/lm_sensors-2.5.0 root# make clean root# make dep - might want to run it twice - verify it has no errors root# make root# make install # # fix kernel/modules sillyness root# mv /lib/modules/2.2.14/misc/* /lib/modules/2.2.14-5.0/misc/ root# cd /lib/modules ; ln -s 2.2.14-5 2.2.14 7. Run "depmod" to update module dependencies. # # root# /sbin/depmod -a # # you'll get some unresolved symbols isses....oh well... # 8. Run ./lm-sensors-2.5.0/prog/mkdev/mkdev.sh to create the /dev entries needed to access the SMBus devices. root# cd /usr/local/src/lm_sensors-2.5.0 root# ./prog/mkdev/mkdev.sh 9. Run ./lm-sensors-2.5.0/prog/detect/sensors-detect to probe for the sensors on the system. # root# vi /etc/conf.modules path=[misc]=/lib/modudules/`uname -r`/misc root# /sbin/modprobe -a # root# /sbin/modprobe lm78 root# /sbin/modprobe lm-core # root# cd /usr/local/src/lm_sensors-2.5.0 root# ./prog/detect/sensors-detect 10. Add the needed module entries to /etc/modules, then reboot to make sure it all worked. root# /etc/conf.modules for redhat boxes 11. At this point, you should have a pseudo-file /proc/bus/i2c that lists the i2c devices found, and a directory in /proc/sys/dev/sensors named after the CHIP type listed in /proc/bus/i2c . This last directory will contain a pseudo-file entry for each sensor line supported by the chip (whether or not that line reports valid data). 12. Access the data using the tools provided by the lm-sensors package or my perl program (currently supporting only a few motherboards). For additional information, consult the various README and doc/ files includes with the i2c and lm-sensors packages, or connect to URL http://www2.lm-sensors.nu/~lm78/identify.html . ---------------------------- You connect them using the 5-pin header on the back. You only need to use 4 of the pins, and the header is conveniently symmetric, as follows: 1 +5V 2 GND 3 RS232 TX (pin 3 on a DE-9) 4 GND 5 +5V End of Sensors microHowTo------------------------- ------------------------------------"Never tell me the odds!"--- Ray Olszewski -- Han Solo Palo Alto, CA ray@comarre.com ----------------------------------------------------------------