Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup #2

Closed
smhmd opened this issue Dec 16, 2019 · 3 comments
Closed

Setup #2

smhmd opened this issue Dec 16, 2019 · 3 comments

Comments

@smhmd
Copy link
Contributor

smhmd commented Dec 16, 2019

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
Copy link
Owner

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
Copy link
Contributor Author

smhmd commented Dec 17, 2019

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: vmatare/thinkfan#17

@Arnavion
Copy link
Owner

Arnavion commented Dec 17, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants