question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CPU temperature is incorrect on Linux

See original GitHub issue

Describe the bug CPU temperature reporting does not work on some Linux systems due to the library not looking in the correct sysfs devices.

To Reproduce Use systeminformation.cpuTemperature on affected Linux systems.

Current Output

❯ node -e "require('systeminformation').cpuTemperature(t => console.log(t))"
{ main: 35.9, cores: [], max: 35.9 }

Expected behavior See actual CPU temperature, for instance on my system it was ~20° hotter than sysinf reported.

❯ cat /sys/class/hwmon/hwmon3/temp3_label; cat /sys/class/hwmon/hwmon3/temp3_input
Core 1
54000

Environment (please complete the following information):

  • systeminformation package version: v4.30.4
  • OS: Linux 5.9.10-arch1-1 x86_64
  • Hardware: Dell XPS 15 7590

Additional context Sysinf expects to see the core temperatures on the hwmon1 sysfs device. https://github.com/sebhildebrandt/systeminformation/blob/7b4693505872b273a87353b339c4b1d6219c4d69/lib/cpu.js#L775

On my device the temps are located at hwmon3 - and I believe the order of hwmon devices is not fixed even from one reboot to another anyway:

❯ cat /sys/class/hwmon/hwmon3/temp*_label
Package id 0
Core 0
Core 1
Core 2
Core 3
Core 4
Core 5

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
sebhildebrandtcommented, Nov 29, 2020

@GitSquared version 4.30.7 just published. Thank you for your awesome idea! If you have further ideas for this module, do not hesitate to contact me. Best regards.

1reaction
sebhildebrandtcommented, Nov 28, 2020

@GitSquared wow. No need to push a pull request. Will work on it later tomorrow.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Incorrect CPU Temp - Linux Mint Forums
Re: Incorrect CPU Temp ... They sense the temperatures, voltages and fans and provide this information to your operating system via a chip...
Read more >
CPU temperatures in linux: throttling or wrong reading?
Linux stays at around 2.0Ghz on idle, with a temperature of around 50C. Here's where it gets weird: when stressing the cpu, the...
Read more >
sensors reporting incorrect temperatures - Ask Ubuntu
I'm trying to plot these temperatures with Munin, but having one that high makes it impossible to read the real temperatures. Could anyone...
Read more >
Cputemp showing wrong temp - LinuxQuestions.org
I am running Ubuntu-Mate and it uses Psensor which uses lmsensor. It is showing 34 degrees F. BIOS shows cpu temp at about...
Read more >
Incorrect CPU temp on AMD A10-7850 APU (Kaveri) on ...
In particular, the CPU temperature reported was incorrect: It would read around 0 degrees at idle, then maybe 20 under load. Regardless, after ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found