ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm writing a program that will determine my current cpu temperature. As I understand it, in order to do this I need to know the chip and sensor on my motherboard. I believe I have determined this through sensor-detect; I have an 'Intel Core family thermal sensor' chip. So basically my question is now what? I'm not sure how I would go about using this information in c or c++ using Kubuntu linux.
Thanks very much I'll definitely look into using those library functions. I do suppose I could just parse the output from 'sensors' but that seems like an inefficient method to get in the habit of.
2. You can check basic settings from the command line:
Quote:
sensors
cat /proc/cpuinfo
3. Chances are, however, these two commands might not work: APCI is not necessarily fully enabled out of the box (OOTB). Here's how you can configure it:
I did spend several hours earlier trying to figure out acpi -t but to no avail. I just get the error message "No support for device type: thermal". I did, however, figure out how to get sensors working so I'll most likely end up using that in some capacity if I cannot figure out how to code this myself.
I am interested in determining cpu temperature, fan speed and also voltage. As I understand it, acpi no longer supports Core 2 Duo processors, which is why the directories /proc/acpi/fan and /proc/acpi/thermal_zone are empty on my machine.
EDIT: Now I'm not sure what I think. At my laptop at home with a Core 2 Duo the /proc/acpi/thermal_zone directory is populated and virtual files do exist to read cpu temperature.... I'm very confused at the moment.
However, I'm under the impression that lm-sensors is capable of reporting all of this information. Thus far I've only been able to get 'sensors' to report my cpu temperature. When I run sensors-detect, the sole thing that it detects is the driver 'coretemp'. Is it likely that my other sensors are not supported at this time?
Thanks again.
Also, is there a file somewhere in linux that contains anything resembling voltage or fan speed? I know systems it supports /proc/acpi/fan/whatever tells you whether or not the fan is on, but is there anything more specific than that?
When I run sensors-detect, the sole thing that it detects is the driver 'coretemp'. Is it likely that my other sensors are not supported at this time?
lmsensors can only report what the motherboard provides. Usually the BIOS is written to display everything that the motherboard provides in the BIOS setup screens so you could check there to get an idea of what's possible. If sensors-detect doesn't find anything you may be out of luck or have a very new monitoring chip. Which motherboard do you have?
Well, I'm trying to create a tool that will operate over multiple custom Linux OS's and several different hardware setups. For that reason using lm_sensors would probably be ideal, but I'm having trouble setting that up on a couple of the OS's. For example trying to make all or make install lm_sensors results in a "no rule to make '/usr/include/gnu/stubs-32.h', needed by 'prog/dump/superio.rd'. . ." compiler error, meaning I'm missing glibc-dev or something like that?
One small plus (I think) is that in running sensors-detect on all the different configurations results in the same chip being detected. They all need/use the w83627hf driver, which means theoretically I could perhaps write a very dumbed down, specific version of lm_sensors that could do the trick?
However, at the end of sensors-detect I receive the message "Warning: the required module w83627hf is not currently installed on your system. If it is built into the kernel then it's OK. Otherwise, check http://www.lm-sensors.org/wiki/Devices for driver availability." So I'm kind of at a loss of what step to take next.
Thanks again for the assistance, it is much appreciated.
Well, I'm trying to create a tool that will operate over multiple custom Linux OS's and several different hardware setups. For that reason using lm_sensors would probably be ideal, but I'm having trouble setting that up on a couple of the OS's. For example trying to make all or make install lm_sensors results in a "no rule to make '/usr/include/gnu/stubs-32.h', needed by 'prog/dump/superio.rd'. . ." compiler error, meaning I'm missing glibc-dev or something like that?
Sorry -- I have only installed the pre-built package so cannot advise. If netsearching doesn't find an answer you could ask in the [CODE]lmsensors mailing list.
Quote:
Originally Posted by Aztral
One small plus (I think) is that in running sensors-detect on all the different configurations results in the same chip being detected. They all need/use the w83627hf driver, which means theoretically I could perhaps write a very dumbed down, specific version of lm_sensors that could do the trick?
You could but would any benefits justify the extra work?
Quote:
Originally Posted by Aztral
However, at the end of sensors-detect I receive the message "Warning: the required module w83627hf is not currently installed on your system. If it is built into the kernel then it's OK. Otherwise, check http://www.lm-sensors.org/wiki/Devices for driver availability." So I'm kind of at a loss of what step to take next.
Strange -- that page says it's been supported since kernel 2.6.5 so you shouldn't have a problem. Why didn't installation detect the chip and install the module? Maybe time to start another thread on this specific question, quoting which OS you are using.
I'm thinking the lack of that module is going to be the biggest problem.
I've also looked at /sys/class/hwmon, which it turns out actually does record the temperature of some systems (not the ones I need it on, of course) where /proc/acpi does not, but as I understand it it also relies on the i2c driver. Since that driver doesn't exist on the systems I need it on (I've looked in /sys/bus/i2c/devices, /sys/bus/platform/devices and about every other /sys directory I can think of, plus sensors-detect probably knows what it's talking about) the /sys/class/hwmon directory is empty.
Also, looking at the lm_sensors source, I think that lm_sensors actually uses the information in the /sys/class/hwmon directory, which means I'm completely out of luck unless I can find a way to populate it.
Crap.
Is it possible to install that module at this point?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.