Closed RadJKW closed 2 years ago
based on the good job done by @bartlet7827 , I further modified the python pwmControlFan-mcb04.py file to be able to log the fan mode changes in /home/pi/fan.log file. so you would be able to know the history of CPU temperature and mode changes for whatever purpose, get a bit more feeling of how your machine and fan works.
Note: if the fan mode hasn't been changed, it will not write any log, to keep log file small in size.
the log file will looks like this:
-------------------------------------------------------- 2022-07-31 23:30:46, Deskpi Fan service started! -------------------------------------------------------- 2022-07-31 23:30:46, CPU Temp is 47°C, adjust fan to 25% 2022-07-31 23:30:51, CPU Temp is 50°C, adjust fan to 50% 2022-07-31 23:30:56, CPU Temp is 48°C, adjust fan to 25%
Great work, unfortunately your code doesn't run directly for me. I get some python errors in all lines where 'cpu_temp' (int) is compared to the 'cpuTemp_config' array (string).
I've added some type casting for 'cpuTemp_config' to int, now it works flawlessly for me.
Unfortunately I had to attach the file as txt, because GitHub won’t let me use py files for some reason.
Hi @sven1601, thank you for pickup the bug. The issue is in line 23 where if the /etc/deskpi.conf file doesn't exist (which I'm assuming is your case), it creates a list of temperatures and fanspeeds. These values should be integers not strings. Your fix works fine. Alternatively, you can remove the quotes around the numbers in line 23.
if you have lost /etc/deskpi.conf, you can just create it by using deskpi-config
and navigate to 6
option, and setting the threshold as you will.
Hardware/Software
uname -a
Linux 5.10.74-v7l+ #1471 armv7l GNU/Linux
Issue Details
How did i find the issue?
I leave my deskpi running throughout the week in my office. If i pay attention, i will notice that the deskpi is running at around 60c on idle ( just loaded into the desktop environment). It took me a minute, but i realized that 60 degrees was a little high with the type of cooler in the deskpi case.
Can i fix the issue?
I have not completely "FIXED" the issue. However, if i run the command
deskpi-config
and choose7 - Cancel manual control and enable automatic fan control
. Immediately after the fan kicks on and the temperature reaches about 48c.Other
Option 6
once upon a time but have since usedOption 7
almost daily to kick the fan on