# fancontol stopped working.

## energyman76b

For no good reason at all I get:

fancontrol                             

Loading configuration from /etc/fancontrol ...

Common settings:

  INTERVAL=10

Settings for hwmon1/device/pwm2:

  Depends on hwmon0/device/temp1_input

  Controls hwmon1/device/fan2_input

  MINTEMP=50

  MAXTEMP=65

  MINSTART=

  MINSTOP=45

  MINPWM=0

  MAXPWM=255

/usr/sbin/fancontrol: Invalid path to sensors

The settings have worked in the past. Running pwmconfig the fanspeed decreases like I want it to. It even gives me the same config. sensors shows... well sensors. Only fancontrol has a problem.

I create a new one - pwmconfig correctly slows down the right fan, everything is fine, config saved:

Common settings:

  INTERVAL=3

Settings for hwmon1/device/pwm2:

  Depends on hwmon0/device/temp1_input

  Controls hwmon1/device/fan2_input

  MINTEMP=50

  MAXTEMP=65

  MINSTART=150

  MINSTOP=0

  MINPWM=0

  MAXPWM=255

same error.

Idea anyone?

----------

## Sadako

Try running it with strace, to figure out what "Invalid path to sensors" it seems to be trying to use?

There are a few options introduced in recent kernels which I imagine could cause this, so if this has started to occur since a kernel update you should probably look there first.

----------

## energyman76b

 *Hopeless wrote:*   

> Try running it with strace, to figure out what "Invalid path to sensors" it seems to be trying to use?
> 
> There are a few options introduced in recent kernels which I imagine could cause this, so if this has started to occur since a kernel update you should probably look there first.

 

I am using the same kernel for 3 weeks now. But fancontrol only acts up for the last three or something.

and this:

rt_sigaction(SIGINT, {SIG_DFL, [], SA_RESTORER, 0x301d0335f0}, {0x43ff60, [], SA_RESTORER, 0x301d0335f0},  :Cool:  = 0

close(3)                                = -1 EBADF (Bad file descriptor)

isn't really helpfull.

----------

## Cyker

Can you less /etc/fancontrol for me, and also what is in /sys/class/hwmon/?

I don't suppose you've upgraded lm_sensors recently...?

----------

## energyman76b

 *Cyker wrote:*   

> Can you less /etc/fancontrol for me, and also what is in /sys/class/hwmon/?
> 
> I don't suppose you've upgraded lm_sensors recently...?

 

I rebuilt lm_sensors, last night, after fancontrol stopped working.

Just downgraded to lm_sensors 3.1.1 and it gives a very helpfull error message:

usr/sbin/fancontrol: Zeile 232: hwmon1/device/pwm2: Datei oder Verzeichnis nicht gefunden

Error enabling PWM on /sys/bus/i2c/devices/hwmon1/device/pwm2

Aborting, restoring fans...

/usr/sbin/fancontrol: Zeile 194: hwmon1/device/pwm2: Datei oder Verzeichnis nicht gefunden

so it is looking into the wrong directory. But why?

And what changed? Kernel was installed ages ago - and fancontrol did work - in fact I installed 2.6.33 to be able to use k10temp as temp source for fancontrol - and it worked for a while.

In  /usr/sbin/fancontrol from 3.1.2 one finds this:

 Detect path to sensors

if echo "${AFCPWM[0]}" | egrep -q '^/'

then

        DIR=/

elif echo "${AFCPWM[0]}" | egrep -q '^hwmon[0-9]'

then

        DIR=/sys/class/hwmon

elif echo "${AFCPWM[0]}" | egrep -q '^[1-9]*[0-9]-[0-9abcdef]{4}'

then

        DIR=/sys/bus/i2c/devices

else

        echo "$0: Invalid path to sensors"

        exit 1

fi

if [ ! -d $DIR ]

then

        echo $0: 'No sensors found! (did you load the necessary modules?)'

        exit 1

fi

cd $DIR

----------

## Cyker

I recently emerged a ~ version of lm_sensors (3.1.2, To see if they'd updated the ACPI driver with fan control ironically) and they've changed the format of the /etc/fancontrol file slightly which was (and still is) why I'm curious what was in yours and your /sys/class/hwmon/*.

The hwmon stuff can be a bit finicky, esp. between lm_sensors or kernel updates (I normally have hwmon0-2, but a couple times they've changed order on me after a reboot which is annoying).

If you regenerate the /etc/fancontrol it should fix the path problems, assuming your current lm_sensors modules hasn't had the fancontrol code removed or something.

----------

## energyman76b

I re-did /etc/fancontrol with pwmconfig before I posted - it is the one I posted. pwmconfig has no problems finding the sensors and pwm-files.

ls /sys/class/hwmon/           

hwmon0  hwmon1

hwmon0 is k10temp

hwmon1 is the sensor chip w-something

s /sys/class/hwmon/hwmon0/device 

broken_parity_status  consistent_dma_mask_bits  driver  irq            modalias  power   resource          subsystem_vendor  uevent

class                 device                    enable  local_cpulist  msi_bus   remove  subsystem         temp1_input       vendor

config                dma_mask_bits             hwmon   local_cpus     name      rescan  subsystem_device  temp1_max

ls /sys/class/hwmon/hwmon1/device 

cpu0_vid    fan3_div    in0_min    in3_max    in6_input  in9_alarm          pwm1_stop_output   pwm2_stop_time     subsystem       temp3_alarm

driver      fan3_input  in1_alarm  in3_min    in6_max    in9_input          pwm1_stop_time     pwm2_target        temp1_alarm     temp3_input

fan1_alarm  fan3_min    in1_input  in4_alarm  in6_min    in9_max            pwm1_target        pwm2_tolerance     temp1_input     temp3_max

fan1_div    fan5_alarm  in1_max    in4_input  in7_alarm  in9_min            pwm1_tolerance     pwm3               temp1_max       temp3_max_hyst

fan1_input  fan5_div    in1_min    in4_max    in7_input  modalias           pwm2               pwm3_enable        temp1_max_hyst  temp3_type

fan1_min    fan5_input  in2_alarm  in4_min    in7_max    name               pwm2_enable        pwm3_mode          temp1_type      uevent

fan2_alarm  fan5_min    in2_input  in5_alarm  in7_min    power              pwm2_max_output    pwm3_start_output  temp2_alarm

fan2_div    hwmon       in2_max    in5_input  in8_alarm  pwm1               pwm2_mode          pwm3_stop_output   temp2_input

fan2_input  in0_alarm   in2_min    in5_max    in8_input  pwm1_enable        pwm2_start_output  pwm3_stop_time     temp2_max

fan2_min    in0_input   in3_alarm  in5_min    in8_max    pwm1_mode          pwm2_step_output   pwm3_target        temp2_max_hyst

fan3_alarm  in0_max     in3_input  in6_alarm  in8_min    pwm1_start_output  pwm2_stop_output   pwm3_tolerance     temp2_type

----------

## Cyker

Hmmm... what if you use the hwmon1 temperature sensors?

It looks like everything is there and visible; Not sure why its not working.

I assume executing the fancontrol via init.d still gives the same problem?

It might be worth sanity-checking your /etc/fancontrol anyway; IIRC I had to hand-tweak mine after I stopped using ACPI.

For reference, mine looks like this:

```
# Configuration file generated by pwmconfig, changes will be lost

INTERVAL=10

DEVPATH=hwmon0=devices/platform/it87.3328

DEVNAME=hwmon0=it8712

FCTEMPS= hwmon0/device/pwm1=hwmon0/device/temp1_input

FCFANS= hwmon0/device/pwm1=hwmon0/device/fan1_input

MINTEMP= hwmon0/device/pwm1=20

MAXTEMP= hwmon0/device/pwm1=40

MINSTART= hwmon0/device/pwm1=150

MINSTOP= hwmon0/device/pwm1=0
```

Last edited by Cyker on Sat Mar 27, 2010 9:07 pm; edited 1 time in total

----------

## energyman76b

 *Cyker wrote:*   

> Hmmm... what if you use the hwmon1 temperature sensors?
> 
> It looks like everything is there and visible; Not sure why its not working.
> 
> I assume executing the fancontrol via init.d still gives the same problem?

 

via init I get no working and 'crashed'

And why should there be any change using hwmon1's temp?

----------

## energyman76b

ARGH!

I am going mad!

Just to get the error message again, I did fancontrol and:

fancontrol 

Loading configuration from /etc/fancontrol ...

Common settings:

  INTERVAL=3

Settings for hwmon1/device/pwm2:

  Depends on hwmon0/device/temp1_input

  Controls hwmon1/device/fan2_input

  MINTEMP=50

  MAXTEMP=65

  MINSTART=150

  MINSTOP=0

  MINPWM=0

  MAXPWM=255

Enabling PWM on fans...

Starting automatic fan control...

and I changed nothing! NOTHING! I echo'ed 110 into pwm2 a couple of hours ago that is all. ARRRGH!

----------

## Cyker

 :Shocked: 

lolololol!  :Laughing: 

I don't suppose dmesg has anything to shed any light on it?

Otherwise we'll have to chalk it up to Murphy  :Razz: 

Well, at least you got it working!!  :Mr. Green: 

----------

## energyman76b

nothing besides some hpet lost interrupt warnings (caused by tvtime) and an usb crash (caused by virtualbox) hmpf

----------

