Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all! :)

I'm writing a hardware monitoring utility and I got to the point I have to read all the possible sensors in my PC. That is: tempeartures, fan speeds, voltages, etc...

After a very long search I found that unlike other factors like CPU/GPU load, RAM usage etc. for sensors readout there isn't a convinient DLL you can just load into your application, get the address of a function like "GetUsageOf..." and voila! Not to mention that a google search mostly shows all sorts of utilities instead of articles onto how this job is done.

Since the number and the kind of sensors and their controllers varies greatly from vendor to vendor and from motherboard to motherboard there is no standardized way of getting the number of sensors, their kind and reading them out.

So if one wants this fuctionality in their own app they sould get their hands dirty and write their own kernel driver that has to be able to scan various buses for controllers, identify them and only after that a sensor readout could be possible.

Using Depends.exe (a standard VS tool that can show what DLLs an application loads. Both statically and dynamically) I tried to find a DLL that might incrporate this functionality in various hardware utilities, but without any success. it appears that the EXE of a program itself is responsible for that functionality.

Now, it would be great if you can show me a way of detecting and reading the sensors, but I would also greatly appreciate if you can point me to a source of information, book, article ..., like in which addresses and buses those controllers could be found. Of course DDK knowledge is absolutely needed I already know that :).

Thanks in advance :)
Posted

1 solution

I think you probably need to learn about Windows Management Instrumentation[^].
 
Share this answer
 
Comments
Ivan Ivanov 83 24-Oct-11 14:30pm    
Hi Richard

Thanks to your post I was able to find this topic:

http://bytes.com/topic/net/answers/606945-get-cpu-fan-speed-cpu-temp

Which explains in detail my porblem and why WMI can't be used at this point.
In essence the problem with WMI is that it has all the tools for this job like: Objects/Clsses/APIs but they are all kind of abstract. That means that they exist as names, as structures but they are not attached to an actual physical device specific implementation that does the job! Only few vendors have provided WMI compliant drivers for the high-end workstations/servers so WMI can be useful only in those limited cases. This is why, in many computers when you try to use WMI to get temperatures the WMI functions return no results... (they don't issue an error, but just no result - 0)

Also I used "wbemtest" WMI testing tool to check if my PC is "lucky" to be in this group, and I confirmed it is not :D

It appears that for now getting eyeball to eyeball with drivers, buses and controllers is the only (if painful) way...

So WMI is no go, but anyway your post was very useful for me so thanks a lot again :)
Richard MacCutchan 24-Oct-11 14:48pm    
Thanks for your comments. The only other option I know of is checking with the manufacturer to see if they have some interface or SDK that you can use to get the information. I know some manufacturers provide utilities that can display the information so it's a matter of finding out how they access it.
Ivan Ivanov 83 24-Oct-11 15:08pm    
Yes there are such utilities. In my case that is ASUS PC Probe. I used Depends.exe to find what kind of DLLs it loads but found nothing related to hardware, IO or sensors. It appears that the EXE iteslf does this job. I also tried SpeedFan and Everest... All the same, they load pretty mutch the same bunch of DLLs. I think thats made on purpose, so guys like me couldn't just take the related DLL and use it in their porgrams ... He he he :)

And about contacting ASUS, That's a very good idea. I actually had success doing this with ATi back when I was writing GPU load and GPU colocks tab so I'm going to mail them (ASUS) tomorrow 'cause as I can see now there isn't any section in their site about this subject...

Thanks again :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900