PC Review
Forums
Newsgroups
Windows XP
Windows XP WMI
Get CPU Fan Speed and CPU Temp
Forums
Newsgroups
Windows XP
Windows XP WMI
Get CPU Fan Speed and CPU Temp
![]() |
Get CPU Fan Speed and CPU Temp |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
"William DePalo [MVP VC++]" <willd.no.spam@mvps.org> wrote in message news:eOc1%23r3VHHA.388@TK2MSFTNGP04.phx.gbl... > I wish Ferraris were cheap. :-) But then we wouldn't want them ![]() > Seriously, I've not had an on-the-job need to use WMI, but my experiments > with it have resulted in less than stellar results. I suggest that you try > on your systems some samples known to work elsewhere before you start > writing code. Yes, this is my first foray into WMI as well. I've found that you do need COM to access it in unmanaged code, and I've built a little sample that allows me to use WQL (WMI Query Language) to retrieve some data. I created a little C++ wrapper class that creates the COM object and initializes WMI in its constructor, and gets rid of it in the destructor. Then I figure I can expose some methods that return exactly what I want (fan speed, CPU temp., etc.) I've tested it with a few WQL queries and can retrieve some information like printers, logical disk drives, etc., etc. So far so good. The issue now is that, while I can get all this other information I don't need, I can't seem to get the information I actually do need I've triedquerying Win32_Fan, Win32_TemperatureProbe, CIM_Sensor and CIM_NumericSensor. It doesn't error out, but it consistently fails to return any results. I think it may be a security issue? But not sure... I'm going to post this response over to the WMI groups as well, in the hopes that someone out there might have an idea. I can post my code if necessary also (about 150 lines). Thanks! |
|
|
|
#2 |
|
Guest
Posts: n/a
|
I tried to play with WMI to get the fan and probe info but got nothing from
attempt. I used the WMI Object Browser from WMI Tools and the response was something along the lines of there not being any instances. However, I know my motherboard has sensors. I've used MSI's own monitor tool as well as Speedfan which collected everything. I also used pcpbios to dump out smbios info and there was no info on the fans or probes. I thought I'd use WMI to get the raw smbios data and enumerate through it based on the smbios spec and it showed the same info as the pcpbios. In other words, no fan or probe info. SMBios contained Types 0,1,2,3,4,5,6,7,8,9,11,12,13 (refer to the smbios spec). I think speedfan uses giveio.sys to get to the hardware info. I was wondering if that is the only way. What is needed to get the info? Thanks, Nathan "Mike C#" wrote: > > "William DePalo [MVP VC++]" <willd.no.spam@mvps.org> wrote in message > news:eOc1%23r3VHHA.388@TK2MSFTNGP04.phx.gbl... > > I wish Ferraris were cheap. :-) > > But then we wouldn't want them ![]() > > > Seriously, I've not had an on-the-job need to use WMI, but my experiments > > with it have resulted in less than stellar results. I suggest that you try > > on your systems some samples known to work elsewhere before you start > > writing code. > > Yes, this is my first foray into WMI as well. I've found that you do need > COM to access it in unmanaged code, and I've built a little sample that > allows me to use WQL (WMI Query Language) to retrieve some data. I created > a little C++ wrapper class that creates the COM object and initializes WMI > in its constructor, and gets rid of it in the destructor. Then I figure I > can expose some methods that return exactly what I want (fan speed, CPU > temp., etc.) I've tested it with a few WQL queries and can retrieve some > information like printers, logical disk drives, etc., etc. > > So far so good. > > The issue now is that, while I can get all this other information I don't > need, I can't seem to get the information I actually do need I've tried> querying Win32_Fan, Win32_TemperatureProbe, CIM_Sensor and > CIM_NumericSensor. It doesn't error out, but it consistently fails to > return any results. I think it may be a security issue? But not sure... > > I'm going to post this response over to the WMI groups as well, in the hopes > that someone out there might have an idea. I can post my code if necessary > also (about 150 lines). |
|
|
|
#3 |
|
Guest
Posts: n/a
|
"Nathan" <Nathan@discussions.microsoft.com> wrote in message news:5C1F19C8-990E-4DD6-8FAF-8B570BD41B98@microsoft.com... >I tried to play with WMI to get the fan and probe info but got nothing from > attempt. > I used the WMI Object Browser from WMI Tools and the response was > something > along the lines of there not being any instances. > > However, I know my motherboard has sensors. I've used MSI's own monitor > tool > as well as Speedfan which collected everything. > > I also used pcpbios to dump out smbios info and there was no info on the > fans or probes. I thought I'd use WMI to get the raw smbios data and > enumerate through it based on the smbios spec and it showed the same info > as > the pcpbios. In other words, no fan or probe info. > SMBios contained Types 0,1,2,3,4,5,6,7,8,9,11,12,13 (refer to the smbios > spec). > > I think speedfan uses giveio.sys to get to the hardware info. I was > wondering if that is the only way. What is needed to get the info? > > Thanks, > Nathan The general consensus seems to be that hardware vendors don't care to provide us with a standardized interface, or standardized WMI drivers, for retrieving fan speeds, voltages, CPU temp, etc. Doing it yourself appears to involve a lot of painstaking research and corporate lawyers. |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 


