1

I'm trying to utilize a script (acerfand I believe) to my version of Acer Aspire One laptop to control fan on/off at certain temperatures. To work properly it needs values from temperature sensor. How can I find the hexadecimal address of temperature sensor? I've tried dmidecode, but I don't even know if it is correct place to search for it.

sub get_temp
{
    initialize_ioports();
    my $r = hex("xxx"); # Temperature
    my $temp = read_ec($r);
    close_ioports();
    return $temp;
}

Edit: somehow I found it! just in case if someone will be searching for this number, for acer aspire one 722 its: hex("0xB0").

  • 1
  • I think you should get away from the idea of accessing ioports via hex addresses in Linux, as this is DOS-style. Take a look at the /dev directory to get an impression on how Linux drivers work. – rexkogitans Sep 3 '18 at 6:17
  • Note that there may not be "the hexadecimal address" of your temperature sensor, it may behind a wide variety of busses. Use lm-sensors to identify what sensors you have. There's also fancontrol which works with the lm-sensors infrastructure. – dirkt Sep 3 '18 at 6:26
  • Thank you, I've tried fancontrol (from arch wiki guide), but can't get lm-sersors to detect fan speed and pwmconfig gives me errors. Uh well, gues aao722 is not supported. – kshanowski Sep 3 '18 at 11:24
  • tried acpi -V ? – steve Sep 9 '18 at 19:30
1

Make sure you have the lm-sensors package installed. There are a number of useful commandline utilities included that can return that information, including isadump and sensors-detect that are part of that package.

|improve this answer|||||
0

Let's assume the sensor has been connected via PCI bus.

First of all find your sensor directory using its driver (kernel module) name:

grep DRIVER /sys/bus/pci/devices/*/uevent

You'll see a batch of lines like this:

/sys/bus/pci/devices/0000:00:02.0/uevent:DRIVER=pcieport
/sys/bus/pci/devices/0000:00:04.0/uevent:DRIVER=pcieport
/sys/bus/pci/devices/0000:00:11.0/uevent:DRIVER=ahci
/sys/bus/pci/devices/0000:00:12.0/uevent:DRIVER=ohci-pci
/sys/bus/pci/devices/0000:00:12.2/uevent:DRIVER=ehci-pci
/sys/bus/pci/devices/0000:00:13.0/uevent:DRIVER=ohci-pci
/sys/bus/pci/devices/0000:00:13.2/uevent:DRIVER=ehci-pci
/sys/bus/pci/devices/0000:00:14.0/uevent:DRIVER=piix4_smbus
/sys/bus/pci/devices/0000:00:14.1/uevent:DRIVER=pata_atiixp
/sys/bus/pci/devices/0000:00:14.2/uevent:DRIVER=snd_hda_intel
/sys/bus/pci/devices/0000:00:14.5/uevent:DRIVER=ohci-pci
/sys/bus/pci/devices/0000:00:16.0/uevent:DRIVER=ohci-pci
/sys/bus/pci/devices/0000:00:16.2/uevent:DRIVER=ehci-pci
/sys/bus/pci/devices/0000:00:18.3/uevent:DRIVER=k10temp
/sys/bus/pci/devices/0000:01:00.0/uevent:DRIVER=nvidia
/sys/bus/pci/devices/0000:01:00.1/uevent:DRIVER=snd_hda_intel
/sys/bus/pci/devices/0000:02:00.0/uevent:DRIVER=r8169

One of this lines will contain name of your sensor kernel module - in the example above it's k10temp and the corresponding line is:

/sys/bus/pci/devices/0000:00:18.3/uevent:DRIVER=k10temp

Thus, now we know sensor's directory - in the example this directory is:

/sys/bus/pci/devices/0000:00:18.3/

The file device from the directory contains hex-address of the sensor, so execute (for the example above):

cat /sys/bus/pci/devices/0000:00:18.3/device

The output will be like this:

0x1703

If you can't recognize name of the sensor kernel module, just install lm-sensors, execute sudo sensors-detect and sensors afterwards - you'll find the name of kernel module easily since you'll see something like this for one of sensors:

k10temp-pci-00c3
|improve this answer|||||
  • What if the sensor is not a PCI device? E.g. behind a I2C bus? – dirkt Sep 3 '18 at 7:01
  • @dirkt Assume the OP author has PCI sensor. If another bus has been used, I'll add corresponding information. I have edited my answer and added assumption that PCI bus has been used. – Bob Sep 3 '18 at 7:03
  • The main problem is that the OP hasn't given any information about what kind of sensor(s) he has ... that's why the first thing to do is to use lm-sensors to find out what he has. – dirkt Sep 3 '18 at 7:10
  • @Bob That is exactly what my output looks like. Anyway it's not working with acerfand script. Maybe you have same device? ;) Acer aspire one 722, did you manage to get control over fan? ;) Thank you for help. – kshanowski Sep 3 '18 at 11:28
  • @kshanowski Try this https://github.com/RayfenWindspear/perl-acpi-fanspeed or one of the available online acer_ec.pl scripts like this: https://github.com/F0rth/acer_ec/blob/master/acer_ec.pl. Just run something like this sudo perl acer_ec.pl := 0x2F 0x3a or sudo perl acer_ec.pl := 0x2F 0x4a – Bob Sep 3 '18 at 13:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.