You are not logged in.

#1 2022-05-04 07:15:46

gca
Member
Registered: 2021-06-08
Posts: 63

[SOLVED] Thinkfan and sensors simple problem

Hi,
every reboot/startup system thinkfan service not start cause sensosr's name has changed and i need to edit thinkfan.conf.
This mine conf and the sensors are hwmon4 and 5 (k10temp-pci-00c3 and thinkpad-isa-0000)

~: cat /etc/thinkfan.conf 
sensors:
# Composite
- hwmon: /sys/class/hwmon/hwmon2/temp1_input
# Sensor 1
- hwmon: /sys/class/hwmon/hwmon2/temp2_input
# Sensor 2
- hwmon: /sys/class/hwmon/hwmon2/temp3_input
# edge
- hwmon: /sys/class/hwmon/hwmon3/temp1_input
# CPU
- hwmon: /sys/class/hwmon/hwmon5/temp1_input
#- hwmon: /sys/class/hwmon/hwmon4/temp1_input
# GPU
- hwmon: /sys/class/hwmon/hwmon5/temp2_input
#- hwmon: /sys/class/hwmon/hwmon4/temp2_input
# Others
- hwmon: /sys/class/hwmon/hwmon5/temp3_input
#- hwmon: /sys/class/hwmon/hwmon4/temp3_input
- hwmon: /sys/class/hwmon/hwmon5/temp4_input
#- hwmon: /sys/class/hwmon/hwmon4/temp4_input
- hwmon: /sys/class/hwmon/hwmon5/temp5_input
#- hwmon: /sys/class/hwmon/hwmon4/temp5_input
- hwmon: /sys/class/hwmon/hwmon5/temp6_input
#- hwmon: /sys/class/hwmon/hwmon4/temp6_input
- hwmon: /sys/class/hwmon/hwmon5/temp7_input
#- hwmon: /sys/class/hwmon/hwmon4/temp7_input
# Tctl
- hwmon: /sys/class/hwmon/hwmon4/temp1_input
#- hwmon: /sys/class/hwmon/hwmon5/temp1_input
# Unknown
- hwmon: /sys/class/hwmon/hwmon6/temp1_input
## iwlwifi_1
#- hwmon: /sys/class/hwmon/hwmon6/temp1_input
#  correction: [-5]

# platform
- tpacpi: /proc/acpi/ibm/thermal
#  correction: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -15, 0, 0, 0, 0, 0]
  indeces: [0]

fans:
- tpacpi: /proc/acpi/ibm/fan

levels:
 - [0, 0, 61]
 - [1, 55, 67]
 - [2, 65, 71]
 - [3, 68, 77]
 - [4, 72, 79]
 - [5, 74, 84]
 - [7, 80, 91]
 - [127, 85, 3276]
~: sensors
iwlwifi_1-virtual-0
Adapter: Virtual device
temp1:        +44.0°C  

k10temp-pci-00c3
Adapter: PCI adapter
Tctl:         +54.2°C  

nvme-pci-0100
Adapter: PCI adapter
Composite:    +39.9°C  (low  = -273.1°C, high = +81.8°C)
                       (crit = +84.8°C)
Sensor 1:     +39.9°C  (low  = -273.1°C, high = +65261.8°C)
Sensor 2:     +39.9°C  (low  = -273.1°C, high = +65261.8°C)

thinkpad-isa-0000
Adapter: ISA adapter
fan1:        2600 RPM
CPU:          +54.0°C  
GPU:           +0.0°C  
temp3:         +0.0°C  
temp4:         +0.0°C  
temp5:         +0.0°C  
temp6:         +0.0°C  
temp7:         +0.0°C  
temp8:            N/A  

amdgpu-pci-0700
Adapter: PCI adapter
vddgfx:        1.34 V  
vddnb:       818.00 mV 
edge:         +45.0°C  
slowPPT:       2.00 mW 

BAT0-acpi-0
Adapter: ACPI interface
in0:          12.83 V

How i can fix this annoing problem?
Thank you so much.

Last edited by gca (2022-05-22 14:06:30)

Offline

#2 2022-05-04 07:23:40

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] Thinkfan and sensors simple problem


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2022-05-22 14:06:08

gca
Member
Registered: 2021-06-08
Posts: 63

Re: [SOLVED] Thinkfan and sensors simple problem

Solved.
Edited Service unit:

[Unit]
Description=simple and lightweight fan control program
Wants=lm_sensors.service
After=lm_sensors.service

[Service]
Type=forking
ExecStartPre=/usr/bin/thinkfan-conf
ExecStart=/usr/bin/thinkfan $THINKFAN_ARGS
PIDFile=/run/thinkfan.pid
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure

[Install]
WantedBy=multi-user.target
Also=thinkfan-sleep.service
Also=thinkfan-wakeup.service

thinkfan-conf:

#!/bin/bash

MAIN_CONF="/etc/thinkfan.d/main.conf"
THINKPAD1_CONF="/etc/thinkfan.d/thinkfan1.conf"
THINKPAD2_CONF="/etc/thinkfan.d/thinkfan2.conf"
WIFI_CONF="/etc/thinkfan.d/wifi.conf"
PLATFORM_CONF="/etc/thinkfan.d/platform.conf"
CONF="/etc/thinkfan.conf"

HWMON="/sys/class/hwmon/hwmon5/name"
THINKPAD="thinkpad"

WIFI="/sys/class/hwmon/hwmon7/temp1_input"

/bin/cp $MAIN_CONF $CONF

if [ -z $(/bin/grep -q $THINKPAD $HWMON) ]; then
  /bin/cat $THINKPAD1_CONF >> $CONF
else
  /bin/cat $THINKPAD2_CONF >> $CONF
fi 

if [ $(/bin/cat $WIFI 2> /dev/null) ]; then
  /bin/cat $WIFI_CONF >> $CONF
fi

/bin/cat $PLATFORM_CONF >> $CONF

No more editing conf file...

PS: inserting kernel modules not solved...

Last edited by gca (2022-05-22 14:08:42)

Offline

Board footer

Powered by FluxBB