Arnavion / tpfancontrol-rs

Temperature and fan controller for Thinkpads on Linux
27 stars 2 forks source link

Setup #2

Closed smhmd closed 4 years ago

smhmd commented 4 years ago

What I did:

$ hub clone --depth 1 Arnavion/tpfancontrol-rs && cd tpfancontrol-rs/
$ cargo build # sudo ?
$ sudo mkdir /etc/tpfancontrol
$ sudo cp config.toml.example /etc/tpfancontrol/config.toml
$ cargo run # ran with error
$ sudo cargo run # ran with error as well

error:

Finished dev [unoptimized + debuginfo] target(s) in 0.03s
     Running `target/debug/tpfancontrol`
Error: sysfs error with /sys/class/hwmon/hwmon2/temp1_input: No such file or directory (os error 2)

Do I need to modify something in the conf file other than thresholds?

I'm not familiar with Rust; hopefully, I'm not doing something obviously wrong.

If I wanted to start tpfancontrol-rs on boot or login, should I run cargo run in the directory or there is a binary I'm missing? (could not find anything in ~/.cargo/bin)

Arnavion commented 4 years ago

cargo build will create the binary in ./target/debug/tpfancontrol. cargo run will just execute that binary. You don't need sudo for either of those. But you'll probably want to copy that binary to ~/bin, /usr/local/bin, etc rather than leave it in that directory.


If you're not doing this on a T61 then you'll almost certainly need to update the mapping in the [sensors] section of the config. What's the output of grep '' /sys/class/hwmon/hwmon2/temp*_input ?

Also just to be sure, what's the output of grep 'thinkpad' /sys/class/hwmon/hwmon*/name ? Is there only one result for the .../hwmon2/name file or is there more than one?

smhmd commented 4 years ago

I am on a Thinkpad L540.

What's the output of grep '' /sys/class/hwmon/hwmon2/temp*_input?

no matches found: /sys/class/hwmon/hwmon2/temp*_input /sys/class/hwmon dir has only these symbolic links:

lrwxrwxrwx 0 root 17 Dec 16:29 hwmon0 -> ../../devices/virtual/thermal/thermal_zone0/hwmon0
lrwxrwxrwx 0 root 17 Dec 16:30 hwmon1 -> ../../devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0003:00/power_supply/ADP1/hwmon1
lrwxrwxrwx 0 root 17 Dec 16:30 hwmon3 -> ../../devices/platform/thinkpad_hwmon/hwmon/hwmon3
lrwxrwxrwx 0 root 17 Dec 16:30 hwmon4 -> ../../devices/platform/coretemp.0/hwmon/hwmon4

what's the output of grep 'thinkpad' /sys/class/hwmon/hwmon*/name?

/sys/class/hwmon/hwmon3/name:thinkpad


running target/debug/tpfancontrol now errors with:

Error: sysfs error with /sys/class/hwmon/hwmon3/temp1_input: No such file or directory (os error 2)

I think this is the same issue another similar project ran into: https://github.com/vmatare/thinkfan/issues/17

Arnavion commented 4 years ago

There is no problem if the sensor paths change on reboot. tpfancontrol auto-detects the hwmon path (notice how the error you get is correctly talking about /sys/class/hwmon/hwmon3/temp1_input, not /sys/class/hwmon/hwmon2/temp1_input any more). If it's now hwmon3 then re-run the first command I asked you to run with hwmon3 instead of hwmon2.

The point is that you don't have a temp1 sensor, and that command will tell you what sensors you do have. Then you can use that information to update the mapping in [sensors] for your L540.