3

I know that this question been asked many times, I even tried most of them, but I'm not satisfied on the results that I get.

First of all I'll explain my problem. I have tried the following code to get the cpu temperature (running it in admin mode):

import wmi
w = wmi.WMI(namespace="root\\wmi")
print ((w.MSAcpi_ThermalZoneTemperature()[0].CurrentTemperature / 10) - 273.2)

Whenever I run the code, I get 25 as the result. I tried to increase the cpu temperature by opening lot of heavy applications. Even though the value didn't change.

I tried to check this value with another open source software named "Open Hardware Monitor" where the temperature changes every second and it was between 50 and 60.

I tried the following code also. The result is same as before (25):

from pyspectator.processor import Cpu
from time import sleep
cpu = Cpu(monitoring_latency=1)
while True:
    print (cpu.temperature)
    sleep(1)

I even tried the following code. It displays nothing.

import wmi
w = wmi.WMI(namespace="root\OpenHardwareMonitor")
temperature_infos = w.Sensor()
for sensor in temperature_infos:
    if sensor.SensorType==u'Temperature':
        print(sensor.Name)
        print(sensor.Value)

Now coming to my question.

  • Is 25 the right value? If so, How to increase / decrease the cpu temperature? (to test the result)
  • What will be the normal and maximum cpu temperature?
  • Why "Open Hardware Monitor" software showing different value?

Extra note: I'm using python 3.6, windows 10, processor - Intel core i7

Developer
  • 103
  • 2
  • 10
  • What's the output of `print(w.MSAcpi_ThermalZoneTemperature))`? – zimmerrol Sep 05 '17 at 14:04
  • [<_wmi_object: b'\\\\root\\wmi:MSAcpi_ThermalZoneTemperature.InstanceName="ACPI\\\\ThermalZone\\\\THM__0"'>] – Developer Sep 05 '17 at 14:06
  • Result of print(w.MSAcpi_ThermalZoneTemperature()[0]) is here: instance of MSAcpi_ThermalZoneTemperature { Active = TRUE; ActiveTripPoint = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; ActiveTripPointCount = 0; CriticalTripPoint = 3802; CurrentTemperature = 2982; InstanceName = "ACPI\\ThermalZone\\THM__0"; PassiveTripPoint = 0; Reserved = 0; SamplingPeriod = 0; ThermalConstant1 = 0; ThermalConstant2 = 0; ThermalStamp = 36; }; – Developer Sep 05 '17 at 14:07
  • Can you access items with other indices like `[1]`? – zimmerrol Sep 05 '17 at 14:11
  • Nope. When I try to execute print(w.MSAcpi_ThermalZoneTemperature()[1]), I'm getting "IndexError: list index out of range" – Developer Sep 05 '17 at 14:14
  • Waiting to get help regarding this issue... – Developer Sep 06 '17 at 05:03
  • Did you try executing this code on other machines? – zimmerrol Sep 06 '17 at 07:59
  • yes I tried the first code (ie) import wmi w = wmi.WMI(namespace="root\\wmi") print ((w.MSAcpi_ThermalZoneTemperature()[0].CurrentTemperature / 10) - 273.2) ... It prints 26 in that machine – Developer Sep 06 '17 at 09:27

0 Answers0