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

Non-hardcoded temperature files #3

Closed
smhmd opened this issue Aug 29, 2020 · 8 comments
Closed

Non-hardcoded temperature files #3

smhmd opened this issue Aug 29, 2020 · 8 comments

Comments

@smhmd
Copy link
Contributor

smhmd commented Aug 29, 2020

Invoking sudo tpfancontrol errors out:

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

I don't understand the function of these monitors, but I'm pretty sure the better way to find these paths is to do:

$ find /sys/devices -type f -name "temp*_input"

In my device, the output is:

/sys/devices/platform/coretemp.0/hwmon/hwmon3/temp3_input
/sys/devices/platform/coretemp.0/hwmon/hwmon3/temp1_input
/sys/devices/platform/coretemp.0/hwmon/hwmon3/temp2_input
/sys/devices/virtual/thermal/thermal_zone0/hwmon0/temp1_input
/sys/devices/virtual/thermal/thermal_zone0/hwmon0/temp2_input

Thinkfan makes you include these in your config file, for instance. Other tools find them on their own.

My device is a ThinkPad L540 running Artix Linux using runit for init.

@Arnavion
Copy link
Owner

https://github.com/Arnavion/tpfancontrol-rs/blob/master/README.md

The program reads a config file /etc/tpfancontrol/config.toml for the names of the temperature sensors and for the temperature-to-fan-level mapping. There is an example config.toml.example in this repository.

@Arnavion
Copy link
Owner

Also,

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

The hwmon2 part comes from autodetecting whichever hwmon that has name == "thinkpad". But then you say:

/sys/devices/platform/coretemp.0/hwmon/hwmon3/temp1_input

... which implies your hwmon2 identifies as "thinkpad" but hwmon3 is the one with the temp sensors? Or were these two taken across reboots and thus the hwmon numbers changed?

What's the output of:

grep -Hn . /sys/class/hwmon/hwmon*/name

?

@Arnavion
Copy link
Owner

On top of that, #2 was also you, and I gave you the same answer that time too.

@smhmd
Copy link
Contributor Author

smhmd commented Aug 30, 2020

On top of that, #2 was also you, and I gave you the same answer that time too.

Hhh, I didn't realize that. If I'm not wrong, at the time I had mid-semester exams. So, I apologize for not going back to you.

$ grep -Hn . /sys/class/hwmon/hwmon*/name
/sys/class/hwmon/hwmon0/name:1:acpitz
/sys/class/hwmon/hwmon1/name:1:ADP1
/sys/class/hwmon/hwmon2/name:1:thinkpad
/sys/class/hwmon/hwmon3/name:1:coretemp

It's hwmon2 as was auto-detected, then. And:

$ ls /sys/class/hwmon/hwmon2
power
device -> ../../../thinkpad_hwmon
fan1_input
name
pwm1
pwm1_enable
subsystem -> ../../../../../class/hwmon
uevent

So, temp1_input does not exist.

@smhmd
Copy link
Contributor Author

smhmd commented Aug 30, 2020

Or were these two taken across reboots and thus the hwmon numbers changed?

No. And since I just booted my PC, here's the output once again:

$ find /sys/devices -type f -name "temp*_input"
/sys/devices/platform/coretemp.0/hwmon/hwmon3/temp3_input
/sys/devices/platform/coretemp.0/hwmon/hwmon3/temp1_input
/sys/devices/platform/coretemp.0/hwmon/hwmon3/temp2_input
/sys/devices/virtual/thermal/thermal_zone0/hwmon0/temp1_input
/sys/devices/virtual/thermal/thermal_zone0/hwmon0/temp2_input

Arnavion added a commit to Arnavion/hwtop that referenced this issue Aug 30, 2020
See <Arnavion/tpfancontrol-rs#3> for an example of
a thermal zone with two sensors.
@Arnavion
Copy link
Owner

$ ls /sys/class/hwmon/hwmon2
power
device -> ../../../thinkpad_hwmon
fan1_input
name
pwm1
pwm1_enable
subsystem -> ../../../../../class/hwmon
uevent

So your thinkpad_acpi module doesn't report any temp sensors. Not sure if it's just for your particular model, or if there's some config you need to enable in the kernel module for it.

Apart from that, the hwmon3 that's being reported by coretemp is the Intel CPU's own temp sensors. Apparently you have a dual-core, so the three sensors are probably CPU 1, CPU 2 and the package as a whole (look at their corresponding temp*_label files). The hwmon0 that's being reported by acpitz is a generic one probably being reported by the motherboard.

Anyway, tpfancontrol-rs only supports the thinkpad_acpi's hwmon sensors. It could support arbitrary sensors like thinkfan apparently does, but at that point it's kind of not Thinkpad-specific any more. I have been working on another TUI monitor for generic hwmons at https://github.com/Arnavion/hwtop. But that one currently cannot set fan speeds, only monitor them. I want to support setting fan speeds with it but haven't had the time to implement it.

@smhmd
Copy link
Contributor Author

smhmd commented Aug 30, 2020

Thanks for the explanation (hand-holding, if you ask me.)

$ cat /sys/devices/platform/coretemp.0/hwmon/hwmon3/temp1_label
Package id 0
$ cat /sys/devices/platform/coretemp.0/hwmon/hwmon3/temp2_label
Core 0
$ cat /sys/devices/platform/coretemp.0/hwmon/hwmon3/temp3_label
Core 1

I want to support setting fan speeds with it but haven't had the time to implement it.

Care to open an issue that I could subscribe to?

@Arnavion
Copy link
Owner

I want to support setting fan speeds with it but haven't had the time to implement it.

Care to open an issue that I could subscribe to?

Arnavion/hwtop#1

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