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

No way to handle sensor paths that change? #17

Closed
jhowla opened this issue Jul 29, 2016 · 13 comments
Closed

No way to handle sensor paths that change? #17

jhowla opened this issue Jul 29, 2016 · 13 comments
Assignees
Milestone

Comments

@jhowla
Copy link

jhowla commented Jul 29, 2016

The path to my CPU's sensors sometimes changes on restart. Specifically, the digit after "hwmon" varies. This results in the expected error from thinkfan:

/sys/devices/platform/coretemp.0/hwmon/hwmon2/temp2_input: No such file or directory

/sys/devices/platform/coretemp.0/hwmon/hwmon2/temp4_input: No such file or directory
readconfig: Error getting temperature.
Refusing to run without usable config file!

Does thinkfan support any sort of pattern matching in the config file to accommodate this?

@vmatare vmatare added this to the 1.0 stable release milestone Jul 29, 2016
@vmatare
Copy link
Owner

vmatare commented Jul 29, 2016

This problem has existed for some time now with certain distributions. In theory you can work around this by fixing the load order of the relevant kernel modules, however that can be non-trivial depending on your init system.

Solving this properly is surprisingly difficult because there may be multiple instances of a single hwmon driver, all of which have the same name. It might be solvable by allowing hwmon matching either by name, or by PCI ID, so that the user would have to figure out whether an hwmon's name is unique or not...

@vmatare vmatare self-assigned this Jul 29, 2016
@vmatare
Copy link
Owner

vmatare commented Nov 1, 2016

I've begun implementing a solution for this problem along with the new YAML config format. It supports specifying only a base path for any given hwmon driver, along with a number of indices that specify which temp*_input files should be used from that hwmon. Thinkfan then recursively searches the base path for the appropriate temp*_input files. Anyone interested in this can check out the yaml-config branch.

@vmatare
Copy link
Owner

vmatare commented Apr 20, 2017

This feature is now merged into the current master branch. The YAML config is still missing some documentation, but at least there's an example config that shows how to use sensor/fan paths with indices, which makes the config robust against changes in driver load order.

@vmatare
Copy link
Owner

vmatare commented Sep 8, 2017

Closing since the new feature is merged. Continuing with the new related issues that came up.

@vmatare vmatare closed this as completed Sep 8, 2017
@bssb
Copy link

bssb commented Feb 4, 2019

Sorry to comment on a closed issue, but I am having the same issue as described by @lynxite and the fix you mentioned seems to address a different problem.

specifying only a base path for any given hwmon driver, along with a number of indices that specify which temp*_input files should be used from that hwmon

It is not the temp*_input digit that changes, it is the hwmon* digit. Is there any way to handle when the hwmon base path changes between hwmon2 and hwmon3?

@vmatare
Copy link
Owner

vmatare commented Feb 4, 2019

It is not the temp*_input digit that changes, it is the hwmon* digit. Is there any way to handle when the hwmon base path changes between hwmon2 and hwmon3?

That's exactly what this feature does. You specify the temp*_input indices precisely because they do not change, but leave out the hwmon* index because it does change.
So let's say I have:
/sys/devices/platform/nct6775.2592/hwmon/hwmon2
And the 2 may change. Then I leave the last component out:

sensors:
   - hwmon: /sys/devices/platform/nct6775.2592/hwmon
     indices: [1, 3]

And specify indices 1 and 3 to use temp1_input and temp3_input, regardless of the hwmon* index. See examples/thinkfan.conf.yaml for a full example.

@vmatare vmatare reopened this Feb 4, 2019
@vmatare vmatare added this to Pending doc issues in update documentation via automation Feb 4, 2019
@vmatare vmatare modified the milestones: 1.0 stable release, 1.1 Feb 4, 2019
@bssb
Copy link

bssb commented Feb 4, 2019

Ok I have it working now. I had read the example config but it wasn't clear to me that in

  - hwmon: /sys/devices/platform/coretemp.0/hwmon
    indices: [2,3,4,5]

actually refers to the path /sys/devices/platform/coretemp.0/hwmon/hwmon*/. Thank you for clarifying.

@NeoFromMatrix
Copy link

Thanks a lot for implementing the feature, I was stuck with the same situation.

Could you maybe add documentation directly to the config file? How it operates, how the paths in the config file correspond to the paths in the file system and how to set it up.

It was hard to understand that it will automatically look for temp[indices]_input in all sub directories of a given base path as this behavior is quite different compared to the other config files.

@desdic

This comment has been minimized.

@vmatare
Copy link
Owner

vmatare commented Apr 4, 2020

Created issue #87 to keep track of missing YAML config documentation, because this is a technical issue that should be fixed in the current master and in the 1.1 release.

@vmatare vmatare closed this as completed Apr 4, 2020
@vmatare vmatare removed this from Pending doc issues in update documentation Apr 4, 2020
@thobianchi
Copy link

actually refers to the path /sys/devices/platform/coretemp.0/hwmon/hwmon*/. Thank you for clarifying.

This is not exact @bssb . Like vmatare said:

And specify indices 1 and 3 to use temp1_input and temp3_input, regardless of the hwmon* index.

from the man page man thinkfan.conf 5

  1. A directory that contains a specific hwmon driver, for example “/sys/devices/platform/nct6775.2592”.
    Note that this path does not contain the load-order dependent “hwmonX” folder.
    As long as it contains only a single hwmon driver/interface it is sufficient to specify the “indices: index-list” entry to tell
    thinkfan which specific sensors to use from that interface. The “name: hwmon-name” entry is unnecessary.

for specific sensor to use it refers to temp<index>_input file

@vmatare
Copy link
Owner

vmatare commented Nov 29, 2020

@thobianchi Note that the config manpage has been updated several times now, so people that read one of the older versions may well have been confused by some unclear or incomplete descriptions that used to be in there. Also keep in mind that getting feedback from people who misunderstood something is instrumental to improving the quality of documentation ;-)

@Reutertu3
Copy link

Reutertu3 commented Mar 7, 2021

After figuring out that thinkfan.conf isn't exactly the same as thinkfan.yaml, yet both can be used interchangeably (every documentary on the web other than the official really is outdated), I was still running into the problem that the sensors on my Laptop couldn't be found upon boot.

thinkfan[323]: ERROR: /etc/thinkfan.yaml:8:
name: coretemp
Could not find a hwmon with this name.

audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=thinkfan
comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed

systemd[1]: thinkfan.service: Control process exited, code=exited, status=1/FAILURE

systemd[1]: thinkfan.service: Failed with result 'exit-code'.

systemd[1]: Failed to start simple and lightweight fan control program.

Thinkfan and the config work flawlessly after startup. I solved it by delaying the systemd unit with After=multi-user.target

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

No branches or pull requests

7 participants