The {0:d}
is just to format the first argument as a digit, see below.
_CORETEMP_FILENAME_BASE = "/sys/class/hwmon/hwmon0/temp{0:d}_{1}"
_CORETEMP_CORE_OFFSET = 2
...
file_name = _CORETEMP_FILENAME_BASE.format(_CORETEMP_CORE_OFFSET + cpu_index,
value_type)
Indeed, you need to use hwmon1. I see I had disabled CPU temperature monitoring in my setup and just relied on the other sensors. Sorry about that.
I’m now running the non-root systemd config and this diff
root@ptr-eiwxtdwig27a15tzjnm:/usr/local/lib/wdhwd# git diff
diff --git a/wdhwlib/fancontroller.py b/wdhwlib/fancontroller.py
index 896c3e5..7e27aef 100644
--- a/wdhwlib/fancontroller.py
+++ b/wdhwlib/fancontroller.py
@@ -615,6 +615,7 @@ class FanController(FanControllerCallback):
level = monitor.level
if level is not None:
if global_level < level:
+ _logger.info("ZZZ %s got temp %s lvl %s", monitor._log_name, monitor.temperature, level)
global_level = level
fan_speed_change = False
diff --git a/wdhwlib/temperature.py b/wdhwlib/temperature.py
index 9a5d49f..a81b2aa 100644
--- a/wdhwlib/temperature.py
+++ b/wdhwlib/temperature.py
@@ -35,7 +35,7 @@ _logger = logging.getLogger(__name__)
_CPUINFO_FILENAME = "/proc/cpuinfo"
_CPUINFO_REGEX_CORES = re.compile(r"^cpu\s+cores.*:\s*([0-9]+)\s*$")
-_CORETEMP_FILENAME_BASE = "/sys/class/hwmon/hwmon0/temp{0:d}_{1}"
+_CORETEMP_FILENAME_BASE = "/sys/class/hwmon/hwmon1/temp{0:d}_{1}"
_CORETEMP_CORE_OFFSET = 2
_CORETEMP_TYPE_JUNCTION_VALUE = "input"
_CORETEMP_TYPE_JUNCTION_REGULAR_MAX = "max"
@@ -56,7 +56,7 @@ _SMBUS_MEMORY_SPD_TEMP_ADDRESS = 0x18
_SMBUS_MEMORY_SPD_TEMP_REG_TEMPERATURE = 5
_HDSMART_COMMAND_BASE = ["/usr/bin/sudo", "-n", "/usr/sbin/hddtemp", "-n", "-u", "C"]
-HDSMART_DISKS = ["/dev/sda", "/dev/sdb"]
+HDSMART_DISKS = ["/dev/sda", "/dev/sdb", "/dev/sdc", "/dev/sdd"]
_HDSMART_REGEX_TEMPERATURE = re.compile(r"^([0-9]+)[^0-9]*$")
To run the daemon manually, go to the /usr/local/lib/wdhwd directory (or wherever you installed the repo) first.
/usr/local/lib/wdhwd# ls
LICENSE messagequeue README.md scripts threadedserial threadedsockets tlv tools wdhwdaemon wdhwlib
/usr/local/lib/wdhwd# sudo python3 -m wdhwdaemon.daemon
In a separate window check the logs
tailf /var/log/wdhwd/daemon.log