# (Solved) fancontrol dies with "ambiguous redirect"

## mf2

Hello,

I'd like to have dynamic control of the fanspeed. Therefore I emerged lm_sensors and run sensors-detect and pwmconfig.

```

echo 155 > /sys/class/hwmon/hwmon0/subsystem/hwmon0/device/pwm2 

```

That works fine but fancontrol won't:

```

localhost phil # fancontrol

Loading configuration from /etc/fancontrol ...

Common settings:

  INTERVAL=4

Settings for hwmon0/device/pwm2:

  Depends on

  Controls hwmon0/device/fan2_input

  MINTEMP=40

  MAXTEMP=60

  MINSTART=170

  MINSTOP=55

  MINPWM=55

  MAXPWM=255

Enabling PWM on fans...

Starting automatic fan control...

/usr/sbin/fancontrol: line 265: ${tsens}: ambiguous redirect

Error reading temperature from /sys/class/hwmon/

Aborting, restoring fans...

Verify fans have returned to full speed

```

So I tried unmasking lm_sensors and upgraded from 2.10.4 to 3.0.1 but:

```

localhost phil # fancontrol

Loading configuration from /etc/fancontrol ...

Common settings:

  INTERVAL=10

Settings for hwmon0/device/pwm2:

  Depends on

  Controls hwmon0/device/fan2_input

  MINTEMP=40

  MAXTEMP=60

  MINSTART=170

  MINSTOP=55

  MINPWM=55

  MAXPWM=255

Enabling PWM on fans...

Starting automatic fan control...

/usr/sbin/fancontrol: line 272: ${AFCTEMP[$fcvcount]}: ambiguous redirect

Error reading temperature from /sys/class/hwmon/

Aborting, restoring fans...

Verify fans have returned to full speed

```

Any ideas?   :Sad: Last edited by mf2 on Tue Apr 29, 2008 9:29 pm; edited 1 time in total

----------

## eccerr0r

My first guess would be, are you using bash as your default shell?  That error shows up a lot with csh-variant shells...

And what version of lm_sensors are you using?

Also, is your BIOS automatic speed control working?  My BIOS/MB seems to automatically change my fan speed depending on temperature without lm_sensors working...

----------

## energyman76b

are you enabling 'old' or 'compatible' or 'deprecated' sysfs support in the kernel?

----------

## mf2

 *eccerr0r wrote:*   

> My first guess would be, are you using bash as your default shell?

 

Yes, that's right.

 *Quote:*   

> And what version of lm_sensors are you using?

 

As I wrote above, I tried the stable and the unstable version in Portage.

 *Quote:*   

> Also, is your BIOS automatic speed control working?  My BIOS/MB seems to automatically change my fan speed depending on temperature without lm_sensors working...

 

I've just enabled that and it seems to work fine  :Smile: 

@energyman76b: 

As far as I see... no

----------

## energyman76b

If I enable speed control in the bios, fan speed goes down from ~2000 ~1500

With fancontrol, it goes down to ~900 .... and I can make it my choice when the fan starts spinning up (at 45°C, because with light to medium load, I always stay below that).

if you don't have it enabled, try:

[*] Create deprecated sysfs files

----------

## mf2

Ok, I've enabled that, recompiled the kernel and rebooted but that didn't solve the fancontrol-problem  :Sad: 

Any other ideas?

----------

## eccerr0r

What version of bash are you using?

Also, exactly what does your FCTEMPS look like in your /etc/fancontrol ?

Do you have any special symbols in /etc/fancontrol ? saved it in msdos (crlf) format?

Just some more guesses...

----------

## mf2

```

# bash --version

GNU bash, version 3.2.17(1)-release (i686-pc-linux-gnu)

Copyright (C) 2005 Free Software Foundation, Inc.

```

```

# grep FCTEMPS /etc/fancontrol

FCTEMPS=hwmon0/device/pwm2=

```

No, there aren't any special symbols in the config file and it's saved in unix format.

----------

## eccerr0r

 *mf2 wrote:*   

> 
> 
> ```
> 
> # grep FCTEMPS /etc/fancontrol
> ...

 

Is that last '=' supposed to be there?

Sorry, I've never set this up so I'm just picking out funny looking stuff...

----------

## energyman76b

should look similar to this:

INTERVAL=10

FCTEMPS=hwmon0/device/pwm2=hwmon0/device/temp3_input

FCFANS=hwmon0/device/pwm2=hwmon0/device/fan2_input

MINTEMP=hwmon0/device/pwm2=45

MAXTEMP=hwmon0/device/pwm2=55

MINSTART=hwmon0/device/pwm2=0

MINSTOP=hwmon0/device/pwm2=0

MINPWM=hwmon0/device/pwm2=0

MAXPWM=hwmon0/device/pwm2=255

----------

## mf2

 *energyman76b wrote:*   

> FCTEMPS=hwmon0/device/pwm2=hwmon0/device/temp3_input

 

This line has been my problem! I've pasted your code and now it works fine  :Smile:  Thanks!

----------

