FAN is getting different speed setting every second
Hi Team,
I just recently found from the log, that the FAN speed is set multiple times within just a second. Maybe that could be changed, so maybe just every 5min or 10min the temperature is checked and the FAN speed is adjusted. I wouldn't think that this would be a risk for the CPU. But it would probably increase the FAN's lifetime.
Or I think maybe the temperature is checked every minute and if the CPU temp raises like 6 or 7 Celsius(as there is always some small mismatch of like 1Celsius when reading it 2 times one after the other) then adjust the FAN speed
Example from my log:
[2023-10-16 10:37:05 kvmd-fan.service] --- Temp: 46.251
[2023-10-16 10:37:05 kvmd-fan.service] --- set_speed: 31 %
[2023-10-16 10:37:05 kvmd-fan.service] --- Temp: 45.764
[2023-10-16 10:37:05 kvmd-fan.service] --- set_speed: 28 %
[2023-10-16 10:37:05 kvmd-fan.service] --- Temp: 45.764
[2023-10-16 10:37:05 kvmd-fan.service] --- set_speed: 28 %
[2023-10-16 10:37:05 kvmd-fan.service] --- Temp: 46.251
[2023-10-16 10:37:05 kvmd-fan.service] --- set_speed: 31 %
[2023-10-16 10:37:05 kvmd-fan.service] --- Temp: 48.199
[2023-10-16 10:37:05 kvmd-fan.service] --- set_speed: 40 %
[2023-10-16 10:37:05 kvmd-fan.service] --- Temp: 46.738
[2023-10-16 10:37:05 kvmd-fan.service] --- set_speed: 33 %
[2023-10-16 10:37:05 kvmd-fan.service] --- Temp: 46.251
[2023-10-16 10:37:05 kvmd-fan.service] --- set_speed: 31 %
[2023-10-16 10:37:05 kvmd-fan.service] --- Temp: 46.251
[2023-10-16 10:37:05 kvmd-fan.service] --- set_speed: 31 %
[2023-10-16 10:37:05 kvmd-fan.service] --- Temp: 47.712
[2023-10-16 10:37:05 kvmd-fan.service] --- set_speed: 38 %
[2023-10-16 10:37:05 kvmd-fan.service] --- Temp: 45.764
[2023-10-16 10:37:05 kvmd-fan.service] --- set_speed: 28 %
[2023-10-16 10:37:05 kvmd-fan.service] --- Temp: 46.251
[2023-10-16 10:37:05 kvmd-fan.service] --- set_speed: 31 %
[2023-10-16 10:37:05 kvmd-fan.service] --- Temp: 45.764
[2023-10-16 10:37:05 kvmd-fan.service] --- set_speed: 28 %
[2023-10-16 10:37:05 kvmd-fan.service] --- Temp: 46.738
[2023-10-16 10:37:05 kvmd-fan.service] --- set_speed: 33 %
[2023-10-16 10:37:05 kvmd-fan.service] --- Temp: 46.251
[2023-10-16 10:37:05 kvmd-fan.service] --- set_speed: 31 %
[2023-10-16 10:37:05 kvmd-fan.service] --- Temp: 45.277
[2023-10-16 10:37:05 kvmd-fan.service] --- set_speed: 26 %
[2023-10-16 10:37:05 kvmd-fan.service] --- Temp: 46.251
[2023-10-16 10:37:05 kvmd-fan.service] --- set_speed: 31 %
Thanks.
Which image do you use(pikvm or blikvm)? Which hardware do you have?(v1 v2 v3 or v4)
I use the Pikvm image and the v3 Hat hardware
https://github.com/ThomasVon2021/blikvm/blob/master/package/kvmd-fan/kvmd-fan.py You can update to use this code.
did I just had an old config file with that issue? or what was changed in the config file? because I see the latest change of that file was in August (well I just replaced my config file and did no backup, so I can't compare it anymore) now, no information regarding the fan status is printed anymore...
You can take a look at the python code, it's very simple. If you want to add more monitoring, I think it should be simple too. It's not quite sure what the previous version of the fan program you have is, but there is no problem in updating to the latest version of the current github repository.
I had a look today into my log files, the issue persists although I used your latest config. It seems that is only appears the time that script runs, that it checks and adjusts the fan speed multiple times in a second... weird
In the code, you can see
time.sleep(5)
That mean every loop will sleep 5s, I don't know how this time do you get:
[2023-10-16 10:37:05 kvmd-fan.service]
The script don't have print time.