Skip to content

Conversation

@mschwarzmeier
Copy link

the lines of the config-file don't change for me, so I got rid of that part of your script.

Another "advantage" (could maybe be a disadvantage to others):
My code does not find new or all temp_input files. In my case that is preferred, because otherwise one is found that is wrong. So I don't include that in my thinkfan.conf. Therefore it is never added.

@hareldev
Copy link
Owner

hareldev commented Sep 4, 2023

Thanks @mschwarzmeier for your PR!

I see the existing script is working for Fedora / RHEL on Lenovo ThinkPad X1 Gen8 models.
Can you say what is your OS + Laptop model?
Maybe we could make the script differentiate between versions?

Another option is we could find a way to check if the find /sys/devices -type f -name "temp*_input"| grep platform line (that provides the wrong output in your case), is correct, and use your method in case it isn't.
What's the output of find /sys/devices -type f -name "temp*_input"| grep platform in your case?

@hareldev hareldev mentioned this pull request Sep 4, 2023
@mschwarzmeier
Copy link
Author

I am working on a Lenovo Thinkpad T15g with Ubuntu 22.04 LTS.
Yes, please go ahead and combine the methods or have them stand side-by-side and let the user decide.

There is a problem with my temp8_input (I think it hasn't always been there, not sure on that though). Might be the same problem as in #2.

> find /sys/devices -type f -name "temp*_input"| grep platform
/sys/devices/platform/thinkpad_hwmon/hwmon/hwmon8/temp6_input
/sys/devices/platform/thinkpad_hwmon/hwmon/hwmon8/temp3_input
/sys/devices/platform/thinkpad_hwmon/hwmon/hwmon8/temp7_input
/sys/devices/platform/thinkpad_hwmon/hwmon/hwmon8/temp4_input
/sys/devices/platform/thinkpad_hwmon/hwmon/hwmon8/temp8_input
/sys/devices/platform/thinkpad_hwmon/hwmon/hwmon8/temp1_input
/sys/devices/platform/thinkpad_hwmon/hwmon/hwmon8/temp5_input
/sys/devices/platform/thinkpad_hwmon/hwmon/hwmon8/temp2_input
/sys/devices/platform/coretemp.0/hwmon/hwmon6/temp6_input
/sys/devices/platform/coretemp.0/hwmon/hwmon6/temp3_input
/sys/devices/platform/coretemp.0/hwmon/hwmon6/temp7_input
/sys/devices/platform/coretemp.0/hwmon/hwmon6/temp4_input
/sys/devices/platform/coretemp.0/hwmon/hwmon6/temp1_input
/sys/devices/platform/coretemp.0/hwmon/hwmon6/temp5_input
/sys/devices/platform/coretemp.0/hwmon/hwmon6/temp2_input
> cat /sys/devices/platform/thinkpad_hwmon/hwmon/hwmon8/temp8_input
cat: /sys/devices/platform/thinkpad_hwmon/hwmon/hwmon8/temp8_input: No such device or address
> cat /sys/devices/platform/thinkpad_hwmon/hwmon/hwmon8/temp7_input
54000

@hareldev
Copy link
Owner

hareldev commented Sep 7, 2023

Would it help if we would change

new_entries=$(find /sys/devices -type f -name "temp*_input"| grep platform |sed 's/^/hwmon /g')

to

new_entries=$(find /sys/devices/platform/coretemp* -type f -name "temp*_input" | sed 's/^/hwmon /g')

?

@mschwarzmeier
Copy link
Author

It seems to me, this would be the temperature of every cpu-core, not the temperatures measured at different locations of the laptop. Then this only being seven and my problem with the input8 should be a coincidence.

@mschwarzmeier
Copy link
Author

latest commit should be more stable, previous sometimes added a 0 to folder (e.g. hwmon60/)

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

Successfully merging this pull request may close these issues.

2 participants