Home > linux > Enabling temperature sensor in CentOS on ALIX.2D2

Enabling temperature sensor in CentOS on ALIX.2D2

Now let’s make use of this temperature sensor on ALIX board. First we need lm_sensors package, so let’s install it:
# yum install lm_sensors

Now if you’ll run sensors-detect it won’t detect anything. We need the module called scx200_acb:
# grep -i scx200_acb /boot/config-`uname -r`
# CONFIG_SCx200_ACB is not set

Ok, it exists in kernel sources, but just not compiled in CentOS/RHEL kernel. Let’s compile it ourselves. It can be done on ALIX ifself (but will be slow and take time and space) or on any other CentOS machine.

Install  devepment packages:
# yum install rpm-build 
(will also install patch elfutils elfutils-libs)

# yum install gnupg redhat-rpm-config gcc
(will also install cpp glibc-devel glibc-headers kernel-headers libgomp libusb)

# yum install kernel-devel

Now we are ready to install kernel sources:
# rpm -ivh http://mirror.centos.org/centos/5/updates/SRPMS/kernel-`uname -r`.src.rpm

Prepare kernel tree:
# rpmbuild -bp –target i686 /usr/src/redhat/SPECS/kernel-2.6.spec

And then:
# cd /usr/src/redhat/BUILD/kernel-2.6.18/linux-2.6.18.i686/drivers/i2c/busses
# make CONFIG_SCx200_ACB=m -C /lib/modules/`uname -r`/build M=`pwd` modules

It will also compile few other modules, but we need only scx200_acb.ko:
# cp scx200_acb.ko /lib/modules/`uname -r`/extra/
# depmod -A

And now:
# modprobe scx200_acb
# sensor-detect
# echo MODULE_1=scx200_acb >> /etc/sysconfig/lm_sensors
# /etc/init.d/lm_sensors start

Now run it:
# sensors

lm86-i2c-0-4c
Adapter: CS5536 ACB0
M/B Temp: +43 C (low = +0 C, high = +70 C)
CPU Temp: +49.5 C (low = +0.0 C, high = +70.0 C)
M/B Crit: +85 C (hyst = +75 C)
CPU Crit: +85 C (hyst = +75 C)

Voila! It works.
(Don’t mind the temperature, summers are hot here, about 30 C in the room).

And when you’ll update the kernel you won’t need to recompile the module again, it will be linked via weak-updates directory.

Categories: linux Tags: , , , ,
  1. nnoel
    December 24th, 2009 at 11:18 | #1

    Hi,

    I got also a ST625211CF form ebay but the microdrive is not recognized with my cf card reader (EMTEC multi card reader).
    Could you tell me the details of your card reader?

    thanks and regards

  2. bk
    December 25th, 2009 at 20:29 | #2

    Hi,

    I have a cheap one, Muller something. It did recognize microdrive, but gave errors when writing, maybe it was USB controller/driver problem though. So eventually I used IDE to CF adapder, I mention it in previous post.

  3. Drew
    June 11th, 2012 at 15:24 | #3

    Gday,

    Curiosity, would you be able to assist in getting the LEDs to work on an Alix 2d2 using mpdpup from here- http://murga-linux.com/puppy/viewtopic.php?t=70052
    I have been reading everywhere but it is all a mush when the kernel becomes involved.
    Also, as an aside, since there are no HDD’s in the Alix, how is it used as a server?
    Can you email me please? Not sure if I get an automatic notification of your response.

    Many Thanks!

    Drew.

  1. No trackbacks yet.