CPUtemp - A CPU Temperature Monitor

Miscellaneous tools
Message
Author
User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

CPUtemp - A CPU Temperature Monitor

#1 Post by rcrsn51 »

Update: V1.9 recognizes CPU scaling governors like PowerSave in addition to OnDemand. This will give you more information in recent Puppies.

One of my machines won't run traytemp, so I decided to make my own. I noticed that System > Hardinfo > Sensors has two readings - the CPU core temperature and the thermal zone temperature. There is a considerable difference between the two and no consistency among machines as to which is correct.

This applet shows both readings plus the CPU frequency scaling status and the current CPU frequency.

1. Install the PET below.

2. You should see a "flame" icon in the system tray. It is launched from your /root/Startup folder. Click it.

3. If you have an AMD or Intel processor, CPUtemp should display the temperature information. If not, click on Help and follow the instructions for detecting other temperature modules.

4. To change the CPU scaling method, run the CPU Frequency Scaling Tool. Look for it in Menu > Utility or Menu > System.
Attachments
CPUtemp-2.0.pet
Updated 2017-02-03
Different tray applet
(78.36 KiB) Downloaded 1141 times
CPUtemp-1.9.pet
Updated 2015-09-21
(80.27 KiB) Downloaded 1282 times
CPUtemp-1.7.pet
Updated 2013-12-16
(80.46 KiB) Downloaded 2334 times
Last edited by rcrsn51 on Fri 03 Feb 2017, 17:51, edited 30 times in total.

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#2 Post by Karl Godt »

1: This .pet introduced me to `sensors` and sensors-detect .

Hardinfo now shows temp ! This is very very good !

2: I also was introduced to modules I never stumbled upon : it87 , acpi* , hwmon , k8temp , processor and much more. Even without k8temp on my K7 board i got temp.

3. /usr/bin/CPUtemp I had to modify a little, because even with loaded acpi* via BootManager and BOOT_IMAGE=/dpup004/vmlinuz pdev=sdc3 psubdir=dpup004 acpi=force from /proc/cmdline
I still have no /proc/acpi -directory

Code: Select all

if [ -d /proc/acpi/ ]; then
                              THRMFILE=`find /proc/acpi/thermal_zone -name "temperature"`
without such prove the screen frooze clicking the sun and even killing kill -9

7858 root 0:00 tr -s
7859 root 0:00 sed s/temperature/THRM Temp/

didn't help .... I had to kill X ! and startx again !

Now the clicking the sun doesn't show any tempers but it doesn't freeze anymore.
I also if'ed

Code: Select all

if [ -f /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor ]; then
if [ -f /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq ]; then 
so the end looks like this for now:

Code: Select all

 xmessage -file /tmp/CPUtemp.txt -timeout 10 -buttons Okay:0,Help:1
  [ $? -eq 1 ] && exec xmessage -file /usr/bin/CPUtemp.hlp
 
				fi
	
		fi 

else 
echo line 43 $?,$FREQ,$THRMFILE
exit

fi
var-log-messages:
ACPI Error: A valid RSDP was not found (20091214/tbxfroot-219)
ACPI WAKEUP ==> [0000011000 - 0000015000]
Kernel command line: BOOT_IMAGE=/dpup004/vmlinuz pdev=sdc3 psubdir=dpup004 acpi=force
ACPI: Interpreter disabled.
pnp: PnP ACPI: disabled

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#3 Post by Karl Godt »

now the code is that :

Code: Select all

#!/bin/sh

#modprobe k8temp
#modprobe coretemp

sensors -A  | tr -s " " > /tmp/CPUtemp.txt

   if [ -d /proc/acpi/ ]; then
                              THRMFILE=`find /proc/acpi/thermal_zone -name "temperature"`
 
                              cat $THRMFILE | tr -s " " | sed s/"temperature"/"THRM Temp"/ >> /tmp/CPUtemp.txt
 
                              echo >> /tmp/CPUtemp.txt

		if [ -f /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor ]; then
                                                                   cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor | grep -q ondemand
  
  
			if [ $? -eq 0 ]; then
  
			echo "OnDemand CPU Scaling: on" >> /tmp/CPUtemp.txt
			else
			echo "OnDemand CPU Scaling: off" >> /tmp/CPUtemp.txt 
			fi
 
				if [ -f /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq ]; then 
                                                                   FREQ=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq`
 
					if [ -n "$FREQ" ]; then
						echo -n "Current CPU Freq: " >> /tmp/CPUtemp.txt
   
						echo ${FREQ%???} MHz >> /tmp/CPUtemp.txt
					fi

  xmessage -file /tmp/CPUtemp.txt -timeout 10 -buttons Okay:0,Help:1
  [ $? -eq 1 ] && exec xmessage -file /usr/bin/CPUtemp.hlp
 
				fi
	
		fi 

else 
# echo line 43 $?,$FREQ,$THRMFILE

 xmessage -file /tmp/CPUtemp.txt -timeout 107 -buttons Okay:0,Help:1
  [ $? -eq 1 ] && exec xmessage -file /usr/bin/CPUtemp.hlp


fi
Attachments
YATM-1.0.jpg
(176.92 KiB) Downloaded 15876 times

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#4 Post by rcrsn51 »

Thanks for this. I see the problem with missing files and have uploaded a patched version.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#5 Post by rcrsn51 »

CPUtemp v1.1 is posted above. If you have previously installed v1.0, you MUST remove it from the PPM before installing the new version.

User avatar
Bert
Posts: 1103
Joined: Fri 30 Jun 2006, 20:09

#6 Post by Bert »

Just discovered this pet. Worked perfectly...after I changed from openbox to jwm :oops: The included guide was a great help.

Clicking the little sun reveals a healthy 33°C core temperature.

For the first time on this box, Hardinfo is displaying temperatures!

Thank you rcrsn51!
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#7 Post by rcrsn51 »

Glad you like it. If you don't want to use JWM, you can run CPUtemp from the command line with

Code: Select all

CPUtemp
Or you can drag a shortcut to /usr/local/bin/CPUtemp onto your desktop.

User avatar
Bert
Posts: 1103
Joined: Fri 30 Jun 2006, 20:09

#8 Post by Bert »

rcrsn51 wrote:Glad you like it. If you don't want to use JWM, you can run CPUtemp from the command line with

Code: Select all

CPUtemp
Or you can drag a shortcut to /usr/local/bin/CPUtemp onto your desktop.
You mean like this? :lol:
Thanks again!
Attachments
buroscr.png
(78.11 KiB) Downloaded 14219 times
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#9 Post by rcrsn51 »

So Mr. Shakespeare might have said, "Shall I compare thy CPU to a Summer's day?" :wink:

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#10 Post by rcrsn51 »

Mick and I are pleased to announce the release of CPUtemp v1.2. This version has a simplified installation procedure and a nicer looking user interface. It should work with other window managers in addition to JWM.

See the first post.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#11 Post by rcrsn51 »

CPUtemp v1.3 is posted above. This release is now a gtkdialog app, so it removes the dependency on gxmessage. Also, it resolves some problems with displaying temperatures in non-English languages.

Thank you to Béèm for being my regular tester.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#12 Post by rcrsn51 »

For those of you who prefer your temperature readings in Fahrenheit, here are the modifications to CPUtemp.

1. Open the file /usr/local/bin/CPUtemp in a text editor.

2. Go to Line 8 and add an "f" as follows

Code: Select all

/usr/local/bin/sensors -Af -c /etc/sensors3.conf | tr -s " " > /tmp/CPUtemp.txt
3. Go to Line 13 and insert a new line AFTER it.

Code: Select all

TEMP=${TEMP%???}
let TEMP=TEMP*9/5+32
4. On the next line, change the "C" to an "F".

Code: Select all

echo "THRM Temp: " $TEMP F >> /tmp/CPUtemp.txt
Last edited by rcrsn51 on Mon 09 Dec 2013, 11:51, edited 2 times in total.

User avatar
lithpr
Posts: 86
Joined: Thu 10 Mar 2011, 06:33

#13 Post by lithpr »

Works great on Lucid Puppy 5.2.5! Thank you very much!

nooby
Posts: 10369
Joined: Sun 29 Jun 2008, 19:05
Location: SwedenEurope

#14 Post by nooby »

Oh I should have found this one a year ago. So much frustration.

Now I know the CPU temp. it is not 26 which I was very skeptical to. it is 48 Celsius. That is more likely to be the true temp than 26 C.

So thanks indeed for providing this pet. I tested it on Snow5 and on Ice-010
I use Google Search on Puppy Forum
not an ideal solution though

User avatar
playdayz
Posts: 3799
Joined: Fri 25 Apr 2008, 18:57

#15 Post by playdayz »

Oh wait a minute, in a terminal i did 'modprobe w83627ehf' and now I have more info than I wanted ;-)

Hi rcrsn51, I run sensors-detect

Code: Select all

Found `Winbond W83627EHF/EF/EHG/EG Super IO Sensors'        Success!
    (address 0x290, driver `w83627ehf')
That is the only Success.

Then I get CPUTemp in the systray. But all I get is

Code: Select all

CPUTemp
ONDemand CPU Scaling On
Current CPU Frequency 150MHz
lsmod shows that k10temp is running and is used by hwmon.

Hardinfo gives no Sensors at all, blank.

I changed the module on line 5 to k10temp.

No big deal, but does anything jump out at you? Thanks.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#16 Post by rcrsn51 »

This is the reality of temperature detection. Sometimes, both methods (libsensors and thermal zone) will detect a temperature, but only one will make sense. Sometimes, only one method will give a value. In your case, neither works.

However, some processors appear to keep their thermal zone info in different locations, so another temperature tool may find it.
Oh wait a minute, in a terminal i did 'modprobe w83627ehf' and now I have more info than I wanted
Was the temperature included?

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#17 Post by 8-bit »

I downloaded and modified the CPUtemp file as per your instructions to show the temperature in fahrenheit.

But the display window has some unknown character symbols shown.

See attached example.
How to fix it?
Attachments
cputemp.png
What I see.
(15.24 KiB) Downloaded 3236 times

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#18 Post by rcrsn51 »

That's the degree symbol. But I thought that we had the program fixed so it never showed it. Do you have the latest version from above?

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#19 Post by 8-bit »

I downloaded CPUtemp-1.3.pet and ran it from its own directory.
Both the original and the modified one showed the unknown character symbol.
I think the message in the terminal may help in determining what is happening.

The old 1.1 version did not display the unknown character.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#20 Post by rcrsn51 »

What Puppy are you using? None of my machines show that symbol anymore.
I downloaded CPUtemp-1.3.pet and ran it from its own directory.
Version 1.3 runs the script /usr/local/bin/CPUtemp. It calls /usr/local/bin/sensors. Is that where you are? Or do you have an older version still installed? Type

Code: Select all

which sensors
Last edited by rcrsn51 on Thu 25 Aug 2011, 22:30, edited 1 time in total.

Post Reply