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

[Suggestion] Use hwmon name instead of the hwmon path #15

Open
Br31zh opened this issue Oct 14, 2024 · 3 comments
Open

[Suggestion] Use hwmon name instead of the hwmon path #15

Br31zh opened this issue Oct 14, 2024 · 3 comments

Comments

@Br31zh
Copy link

Br31zh commented Oct 14, 2024

Hello,

I’m using the drivetemp kernel module since hddclient is deprecated, but sometimes the numbers of the hwmon interfaces change.

So my CPU is normally hwmon6 while my disks are hwmon1 to hwmon5, but sometimes 6 is a disk and 5 the CPU, and it mess up with my configuration.

It could be interesting to have a way to select the name of the hwmon interface instead of a path (/sys/class/hwmon/hwmon?/name, here I have amdgpu, zenpower, drivetemp and others).

For now I’m trying to use predictable paths, if anyone have the same problem, it looks like this (you can obtain it using realpath on /sys/class/hwmon entries):

# GPU
path = /sys/devices/pci0000:00/0000:00:03.1/0000:27:00.0/0000:28:00.0/0000:29:00.0/hwmon/hwmon?/temp2_input
# CPU
path = /sys/devices/pci0000:00/0000:00:18.3/hwmon/hwmon?/temp1_input

# Fans
pwm = /sys/devices/platform/nct6775.2592/hwmon/hwmon?/pwm2
fan_input = /sys/devices/platform/nct6775.2592/hwmon/hwmon?/fan2_input
pwm = /sys/devices/platform/nct6775.2592/hwmon/hwmon?/pwm3
fan_input = /sys/devices/platform/nct6775.2592/hwmon/hwmon?/fan3_input
pwm = /sys/devices/platform/nct6775.2592/hwmon/hwmon?/pwm5
fan_input = /sys/devices/platform/nct6775.2592/hwmon/hwmon?/fan5_input
pwm = /sys/devices/platform/nct6775.2592/hwmon/hwmon?/pwm6
fan_input = /sys/devices/platform/nct6775.2592/hwmon/hwmon?/fan6_input

It seems to work (and I have a fake hddclient that use /sys/devices/pci0000:00/0000:00:01.3/0000:03:00.1/ata?/host?/target?:0:0/?:0:0:0/hwmon/hwmon?/temp1_input for the disks).

@geosone
Copy link

geosone commented Oct 21, 2024

could you provide the fake hddcleint or is it in any repository ?

@Br31zh
Copy link
Author

Br31zh commented Oct 21, 2024

It’s litteraly just this:

#!/bin/bash
cat /sys/devices/pci0000:00/0000:00:01.3/0000:03:00.1/ata?/host?/target?:0:0/?:0:0:0/hwmon/hwmon?/temp1_input

I made it executable, in /usr/local/bin/hddtemp-client and then using this in the afancontrol configuration file:

[daemon]
hddtemp = /usr/local/bin/hddtemp-client

[temp:hdd]
type = hdd
path = whatever
min = 40000
max = 50000
panic = 50000

Since afancontrol is using the highest value hddtemp return when you’re using the hdd temp type, you just have to return all the drive you want to check, one by line. I didn’t bother dividing the results by 1000 since it was easier to just add some zeros in the config file.

If you want separate control (if they depends on different fans), you can just change the path in the script (or add a condition so you can return something different depending on the parameter you’ve set instead of whatever in my example).

@geosone
Copy link

geosone commented Oct 21, 2024

i have created an script with the help of copilot

hddtemp-next.sh.txt

that is a drop in replacement for hddtemp and it si working with the drivetemp kernel module

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