Getting CPU Temp

This is the place for queries that don't fit in any of the other categories.

Getting CPU Temp

Postby ms4sman » Fri Jul 05, 2013 3:48 am

If you were ever on the old forums, you probably remember me and my annoying questions about getting CPU temp. Well I have a new question. I finally got a simple script going that uses WMI to get the current CPU temperature, but it doesn't seem to ever change. I am not sure if it is using a placeholder value or what. I got my code from here: http://stackoverflow.com/questions/3262603/accessing-cpu-temperature-in-python and the top script example does not work for me. However, the second one is where I get a value, but it doesn't change. I have loaded my computer up with a heavy task load (ie running multiple high graphics games) to try to raise the temperature, and it always stays at 3332. The value is supposedly in tenths of a kelvin, so converted that would read to be 60.2 celcius. Anyone have any idea why it gives me a value, but it doesn't change? Thanks!

PS one more note, I tried both of those scripts on my old computer a long time ago and neither of them worked. I am very confused.
ms4sman
 
Posts: 24
Joined: Sat Feb 16, 2013 5:55 pm

Re: Getting CPU Temp

Postby metulburr » Fri Jul 05, 2013 4:12 am

are you using linux?

install package
Code: Select all
lm-sensors

Code: Select all
sudo sensors-detect


and then jsut run sensors to get the data:
Code: Select all
metulburr@ubuntu:~$ sensors
coretemp-isa-0000
Adapter: ISA adapter
Physical id 0:  +41.0°C  (high = +80.0°C, crit = +99.0°C)
Core 0:         +36.0°C  (high = +80.0°C, crit = +99.0°C)
Core 1:         +41.0°C  (high = +80.0°C, crit = +99.0°C)
Core 2:         +38.0°C  (high = +80.0°C, crit = +99.0°C)
Core 3:         +36.0°C  (high = +80.0°C, crit = +99.0°C)

metulburr@ubuntu:~$ sensors
coretemp-isa-0000
Adapter: ISA adapter
Physical id 0:  +42.0°C  (high = +80.0°C, crit = +99.0°C)
Core 0:         +37.0°C  (high = +80.0°C, crit = +99.0°C)
Core 1:         +42.0°C  (high = +80.0°C, crit = +99.0°C)
Core 2:         +40.0°C  (high = +80.0°C, crit = +99.0°C)
Core 3:         +35.0°C  (high = +80.0°C, crit = +99.0°C)

metulburr@ubuntu:~$ sensors
coretemp-isa-0000
Adapter: ISA adapter
Physical id 0:  +41.0°C  (high = +80.0°C, crit = +99.0°C)
Core 0:         +37.0°C  (high = +80.0°C, crit = +99.0°C)
Core 1:         +41.0°C  (high = +80.0°C, crit = +99.0°C)
Core 2:         +39.0°C  (high = +80.0°C, crit = +99.0°C)
Core 3:         +35.0°C  (high = +80.0°C, crit = +99.0°C)

metulburr@ubuntu:~$


and also hdd temp:
Code: Select all
metulburr@ubuntu:~$ sudo hddtemp /dev/sda   
/dev/sda: ST31000528AS: 37°C
metulburr@ubuntu:~$
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1382
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: Getting CPU Temp

Postby ms4sman » Fri Jul 05, 2013 4:31 am

Unfortunately I am not using Linux at the moment. This application is for Windows. Any idea what would be causing the problem with WMI? I would prefer to stick with that if I can. Thanks!
ms4sman
 
Posts: 24
Joined: Sat Feb 16, 2013 5:55 pm

Re: Getting CPU Temp

Postby ms4sman » Mon Jul 08, 2013 2:18 am

Since posting this, I made a bit of progress. I found out that the value does change, just not very often, and it seems to be accurate. But it only changes on occasion, not every time I ask for the current temp. Also, for this script to run, Python has to have admin privileges. Does anyone know why it doesn't seem to be grabbing a current temp every time the script runs?
ms4sman
 
Posts: 24
Joined: Sat Feb 16, 2013 5:55 pm


Return to General Coding Help

Who is online

Users browsing this forum: D-termined, sellersmd and 1 guest