Conky looks in the wrong sysfs dir for hwmon temperature info

Bug #435571 reported by Ricardo Teixeira
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Conky
Unknown
Unknown
conky (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: conky

ctrler@jupiter:~$ lsb_release -d
Description: Ubuntu karmic (development branch)

ctrler@jupiter:~$ apt-cache policy conky
conky:
  Installed: (none)
  Candidate: 1.7.2-0ubuntu1
  Version table:
     1.7.2-0ubuntu1 0
        500 http://pt.archive.ubuntu.com karmic/universe Packages
        100 /var/lib/dpkg/status

When I add the following line in .conkyrc to get my cpu temperature from hwmon:

CPU Temp: ${hwmon 0 temp 1}°Cr

I get the following error when starting conky:

Conky: can't open '/sys/class/hwmon/hwmon0/device/temp1_input': No such file or directory
please check your device or remove this var from Conky
Conky: X Error: type 0 Display 9ee7788 XID 0 serial 25 error_code 3 request_code 61 minor_code 0 other Display: 9ee7788
Aborted (core dumped)

What I think is happening Conky is looking in the wrong place because there is nothing in /sys/class/hwmon/hwmon0/device/temp1_input:

ctrler@jupiter:~$ cat /sys/class/hwmon/hwmon0/device/temp1_input
cat: /sys/class/hwmon/hwmon0/device/temp1_input: No such file or directory

and the file with the temperature information is actually in /sys/class/hwmon/hwmon0/temp1_input as you can see here:

ctrler@jupiter:~$ cat /sys/class/hwmon/hwmon0/temp1_input
34000
ctrler@jupiter:~$ cat /sys/class/hwmon/hwmon0/temp1_label
CPU Temperature

Related branches

Revision history for this message
Cesare Tirabassi (norsetto) wrote :

There is already a check for /device which is eventually stripped out. The problem with the kernel 2.6.31 is that /sys/class/hwmon/hwmon0/device apparently still exists so that check fails.
Waiting to find a proper solution upstream that maintains compatibility with older kernels, I made an horrible hack that should work for karmic (hopefully it doesn't break anything else). Can you check it out? The package is available in my ppa:

https://launchpad.net/%7Enorsetto/%2Barchive

If you do that please check if it still works for vol too, not just temp, and also if the device is not specified or specified as *.
(I can't test myself as my VM stopped working after the latest karmic upgrade).

PS. If in the future you open a bug also upstream, can you please link it to the launchpad one?

Revision history for this message
Cesare Tirabassi (norsetto) wrote :

I just checked with the latest kernel (2.6.31-10) and I don' t see any problem like you described.
I guess is just a problem on your particular machine (perhaps you still have an old symlink from a previous kernel).

Changed in conky (Ubuntu):
status: New → Incomplete
Revision history for this message
Ricardo Teixeira (ricardo-ctrler) wrote :

I just upgraded to the latest kernel and for me the problem still exists.
Later today or tomorrow I will try with the package in your ppa.
And I apologize for not linking the upstream bug to this one.

Here is some more data:

ctrler@jupiter:~$ ls -L /sys/class/hwmon/hwmon0/*
/sys/class/hwmon/hwmon0/fan1_input /sys/class/hwmon/hwmon0/in1_min
/sys/class/hwmon/hwmon0/fan1_label /sys/class/hwmon/hwmon0/in2_input
/sys/class/hwmon/hwmon0/fan1_max /sys/class/hwmon/hwmon0/in2_label
/sys/class/hwmon/hwmon0/fan1_min /sys/class/hwmon/hwmon0/in2_max
/sys/class/hwmon/hwmon0/fan2_input /sys/class/hwmon/hwmon0/in2_min
/sys/class/hwmon/hwmon0/fan2_label /sys/class/hwmon/hwmon0/in3_input
/sys/class/hwmon/hwmon0/fan2_max /sys/class/hwmon/hwmon0/in3_label
/sys/class/hwmon/hwmon0/fan2_min /sys/class/hwmon/hwmon0/in3_max
/sys/class/hwmon/hwmon0/in0_input /sys/class/hwmon/hwmon0/in3_min
/sys/class/hwmon/hwmon0/in0_label /sys/class/hwmon/hwmon0/name
/sys/class/hwmon/hwmon0/in0_max /sys/class/hwmon/hwmon0/temp1_crit
/sys/class/hwmon/hwmon0/in0_min /sys/class/hwmon/hwmon0/temp1_input
/sys/class/hwmon/hwmon0/in1_input /sys/class/hwmon/hwmon0/temp1_label
/sys/class/hwmon/hwmon0/in1_label /sys/class/hwmon/hwmon0/temp1_max
/sys/class/hwmon/hwmon0/in1_max /sys/class/hwmon/hwmon0/uevent

/sys/class/hwmon/hwmon0/device:
driver hid hwmon modalias path power subsystem uevent

/sys/class/hwmon/hwmon0/power:
wakeup

/sys/class/hwmon/hwmon0/subsystem:
hwmon0 hwmon1 hwmon2

ctrler@jupiter:~$ uname -a
Linux jupiter 2.6.31-10-generic #35-Ubuntu SMP Tue Sep 22 17:33:42 UTC 2009 i686 GNU/Linux

ctrler@jupiter:~$ cat /sys/class/hwmon/hwmon0/name
atk0110

Revision history for this message
Ricardo Teixeira (ricardo-ctrler) wrote :

Another thing.
I've been searching to see if I could remove the symlink device but I haven't found a way to do it.
If it is a leftover from something it must have been done by the system itself.

Revision history for this message
Cesare Tirabassi (norsetto) wrote :

As you can see here:

>/sys/class/hwmon/hwmon0/device:
>driver hid hwmon modalias path power subsystem uevent

in your case /sys/class/hwmon/hwmon0/device points to something.
If I look at the kernel docs for 2.6.31 (http://www.mjmwired.net/kernel/Documentation/hwmon/sysfs-interface) I get the impression that that is wrong, and would be a bug in the kernel for your particular chipset implementation.

Revision history for this message
Cesare Tirabassi (norsetto) wrote :

I need to have at least a couple of positive feedbacks on this (that it solves this problem and it doesn' t break anything else). I' m planning to upload a bug-fix release this week-end, that would be the deadline if you want this in karmic.

Revision history for this message
Ricardo Teixeira (ricardo-ctrler) wrote :

Hi.
I've just updated with the package from your ppa. I'm sorry for the delay.
The package conky - 1.7.2-0ubuntu2~karmic3 in https://launchpad.net/%7Enorsetto/%2Barchive ppa solves my problem and still shows voltage and fan speed.
I don't know what you mean by "(...) and also if the device is not specified or specified as *" but all seems OK.

Thanks.

ctrler@jupiter:~$ apt-cache policy conky-all
conky-all:
  Installed: 1.7.2-0ubuntu2~karmic3
  Candidate: 1.7.2-0ubuntu2~karmic3
  Version table:
 *** 1.7.2-0ubuntu2~karmic3 0
        500 http://ppa.launchpad.net karmic/main Packages
        100 /var/lib/dpkg/status
     1.7.2-0ubuntu1 0
        500 http://pt.archive.ubuntu.com karmic/universe Packages

ctrler@jupiter:~$ uname -a
Linux jupiter 2.6.31-11-generic #36-Ubuntu SMP Fri Sep 25 06:37:51 UTC 2009 i686 GNU/Linux

Revision history for this message
Cesare Tirabassi (norsetto) wrote :

conky should also find the first device if the device is not specified, or is specified with a wildcard (the cararacter *). For instance as ${hwmon temp 1} or ${hwmon * temp 1).

Revision history for this message
Ricardo Teixeira (ricardo-ctrler) wrote :

OK.
I just checked with both ${hwmon temp 1} and ${hwmon * temp 1) and it works.

Changed in conky (Ubuntu):
status: Incomplete → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package conky - 1.7.2-0ubuntu2

---------------
conky (1.7.2-0ubuntu2) karmic; urgency=low

  * Bug-fix only release:
    - add quilt support in debian/control and debian/rules
    - add debian/patches/fix_if_running.patch:
      fix if_running not working on linux when a top flavour is not running
      commit 75ce3b259be20f4a304fbf90d7c5f55871c872da
    - add debian/patches/fix_hwmon_for_2.6.31.patch (LP: #435571):
      horrible hack to make hwmon works with kernel 2.6.31 also when
      /sys/class/hwmon/hwmon0/device erroneously exists
    - package is now maintained in bzr/launchpad
      https://code.launchpad.net/~norsetto/+junk/conky:
      + add Vcs-* fields to debian/control
    - add --disable-static flag to conky-all instead of building and
      then manually removing the static library
    - make conky-all with --enable-nvidia only on i386 and amd64
      arches (fix FTBFS for all other arches)
    - change naming scheme to ease transitions, conky is now a transitional
      package that installs conky-all. Standard conky is now named conky-std

 -- Cesare Tirabassi <email address hidden> Sat, 26 Sep 2009 15:12:38 +0200

Changed in conky (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
miegiel (nix-miegiel) wrote :

${hwmon 2 temp 1} and ${hwmon 1 temp 1} still cause conky to crash for me (temps for core 1 and 2 of my cpu). ${hwmon 0 temp 1} does work though but it's not accurate.

Conky: can't open '/sys/class/hwmon/hwmon1/temp1_input': No such file or directory
please check your device or remove this var from Conky
Conky: X Error: type 0 Display a07d7e0 XID 0 serial 25 error_code 3 request_code 61 minor_code 0 other Display: a07d7e0

Aborted (core dumped)

  Installed: 1.7.2-0ubuntu2
  Candidate: 1.7.2-0ubuntu2

Revision history for this message
Cesare Tirabassi (norsetto) wrote :

Can you show me what is the content (recursively) of your /sys/class/hwmon, and please confirm that your kernel is 2.6.31?

Revision history for this message
miegiel (nix-miegiel) wrote :

In case its relevant, it's the 'coretemp' sensor and it only shows the temperatures of core 1 and core 2 of my CPU.

user@machine:~$ uname -a
Linux grass 2.6.31-14-generic #46-Ubuntu SMP Tue Oct 13 16:47:59 UTC 2009 i686 GNU/Linux

user@machine:~$ ls -L /sys/class/hwmon/*
/sys/class/hwmon/hwmon0:
name power subsystem temp1_crit temp1_input uevent

/sys/class/hwmon/hwmon1:
device power subsystem uevent

/sys/class/hwmon/hwmon2:
device power subsystem uevent

user@machine:~$ ls -L /sys/class/hwmon/hwmon1/*
/sys/class/hwmon/hwmon1/uevent

/sys/class/hwmon/hwmon1/device:
driver modalias power temp1_crit temp1_input temp1_max
hwmon name subsystem temp1_crit_alarm temp1_label uevent

/sys/class/hwmon/hwmon1/power:
wakeup

/sys/class/hwmon/hwmon1/subsystem:
hwmon0 hwmon1 hwmon2

user@machine:~$ ls -L /sys/class/hwmon/hwmon2/*
/sys/class/hwmon/hwmon2/uevent

/sys/class/hwmon/hwmon2/device:
driver modalias power temp1_crit temp1_input temp1_max
hwmon name subsystem temp1_crit_alarm temp1_label uevent

/sys/class/hwmon/hwmon2/power:
wakeup

/sys/class/hwmon/hwmon2/subsystem:
hwmon0 hwmon1 hwmon2

user@machine:~$ ls -L /sys/class/hwmon/hwmon0/*
/sys/class/hwmon/hwmon0/name /sys/class/hwmon/hwmon0/temp1_input
/sys/class/hwmon/hwmon0/temp1_crit /sys/class/hwmon/hwmon0/uevent

/sys/class/hwmon/hwmon0/power:
wakeup

/sys/class/hwmon/hwmon0/subsystem:
hwmon0 hwmon1 hwmon2

Revision history for this message
Cesare Tirabassi (norsetto) wrote :

So, forgetting what the documentation says, looks like as we have 3 possible cases:

1. hwmonX contains directly the sensors data; hwmonX/device doesn't exist
2. hwmonX contains directly the sensors data; hwmonX/device exists but is irrelevant
3. hwmonX doesn't contain the sensors data, they are in hwmonX/device

Case 1 is covered by conky, either patched or unpatched
Case 2 would cause the unpatched conky to fail
Case 3 would cause the patched conky to fail

I can prepare a patch that covers all these cases but I can't guarantee that this will go in before karmic is released.

Changed in conky (Ubuntu):
status: Fix Released → In Progress
assignee: nobody → Cesare Tirabassi (norsetto)
Revision history for this message
miegiel (nix-miegiel) wrote :

I belive it's case 3. I just did 'cat /sys/class/hwmon/hwmon1/device/temp1_input' a couple of times. Idle it returns 32000 or 33000, while doing a virus scan it goes up to 40000 or 41000.

Revision history for this message
Cesare Tirabassi (norsetto) wrote :

I've got a new package (1.7.2-0ubuntu4~karmic1) up for testing in my ppa (https://launchpad.net/%7Enorsetto/%2Barchive), it should cover all cases reported here. Can you please test once the binaries are available and report here?

Changed in conky (Ubuntu):
status: In Progress → Incomplete
assignee: Cesare Tirabassi (norsetto) → nobody
Revision history for this message
miegiel (nix-miegiel) wrote :

I just installed conky_1.7.2-0ubuntu4~karmic1_i386.deb and conky-all_1.7.2-0ubuntu4~karmic1_i386.deb from https://launchpad.net/~norsetto/+archive/ppa/+packages and it's working. Thanks : )

Revision history for this message
Cesare Tirabassi (norsetto) wrote :

Ricardo, can you please check that things are still ok with you with the latest version from my ppa?

Revision history for this message
Ricardo Teixeira (ricardo-ctrler) wrote :

Yup. Just checked with 1.7.2-0ubuntu4~karmic1 and everything is still the same: OK.

ctrler@jupiter:~$ sudo aptitude show conky-all
Package: conky-all
State: installed
Automatically installed: no
Version: 1.7.2-0ubuntu4~karmic1
Priority: optional
Section: utils
Maintainer: Cesare Tirabassi <email address hidden>

Revision history for this message
Ricardo Teixeira (ricardo-ctrler) wrote :

And, just checked, it also works with hwmon 1 and hwmon 2 (CPU Core Temp).
So for me it works when the info is in /sys/class/hwmon/hwmon0 and when the info is in /sys/class/hwmon/hwmon1/device.

Here is the listing of my hwmon dir

ctrler@jupiter:/sys/class/hwmon$ ls */*
hwmon0/fan1_input hwmon0/in0_input hwmon0/in2_input hwmon0/name
hwmon0/fan1_label hwmon0/in0_label hwmon0/in2_label hwmon0/temp1_crit
hwmon0/fan1_max hwmon0/in0_max hwmon0/in2_max hwmon0/temp1_input
hwmon0/fan1_min hwmon0/in0_min hwmon0/in2_min hwmon0/temp1_label
hwmon0/fan2_input hwmon0/in1_input hwmon0/in3_input hwmon0/temp1_max
hwmon0/fan2_label hwmon0/in1_label hwmon0/in3_label hwmon0/uevent
hwmon0/fan2_max hwmon0/in1_max hwmon0/in3_max hwmon1/uevent
hwmon0/fan2_min hwmon0/in1_min hwmon0/in3_min hwmon2/uevent

hwmon0/device:
driver hid hwmon modalias path power subsystem uevent

hwmon0/power:
wakeup

hwmon0/subsystem:
hwmon0 hwmon1 hwmon2

hwmon1/device:
driver modalias power temp1_crit temp1_input temp1_max
hwmon name subsystem temp1_crit_alarm temp1_label uevent

hwmon1/power:
wakeup

hwmon1/subsystem:
hwmon0 hwmon1 hwmon2

hwmon2/device:
driver modalias power temp1_crit temp1_input temp1_max
hwmon name subsystem temp1_crit_alarm temp1_label uevent

hwmon2/power:
wakeup

hwmon2/subsystem:
hwmon0 hwmon1 hwmon2
ctrler@jupiter:/sys/class/hwmon$

Thanks Cesare,

Ricardo

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package conky - 1.7.2-0ubuntu4

---------------
conky (1.7.2-0ubuntu4) karmic; urgency=low

  * Bug-fix only release:
    - modify debian/patches/fix_hwmon_for_2.6.31.patch (LP: #435571):
      modify the patch so that all possible cases for the hwmon data location
      are taken into account. This should also be compatible with older
      kernels.

 -- Cesare Tirabassi <email address hidden> Thu, 15 Oct 2009 18:37:15 +0200

Changed in conky (Ubuntu):
status: Incomplete → Fix Released
Revision history for this message
Mytonn (mytonn) wrote :

x@x-desktop:~$ sudo aptitude show conky-all
Package: conky-all
New: yes
State: installed
Automatically installed: no
Version: 1.7.2-0ubuntu4
Priority: optional
Section: universe/utils
Maintainer: Cesare Tirabassi <email address hidden>

x@x-desktop:~$ uname -a
Linux x-desktop 2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:04:26 UTC 2009 i686 GNU/Linux

Conky: can't open '/sys/class/hwmon/hwmon1/temp3_input': No such file or directory
please check your device or remove this var from Conky
Conky: X Error: type 0 Display 82e1788 XID 0 serial 41 error_code 3 request_code 61 minor_code 0 other Display: 82e1788

Revision history for this message
Cesare Tirabassi (norsetto) wrote :

And what is the content (recursively) of your /sys/class/hwmon and the hwmon variable in your .conkyrc?

Revision history for this message
Mytonn (mytonn) wrote :

${alignr}${hwmon 1 temp 3}

x@x-desktop:~$ ls -L /sys/class/hwmon/hwmon0/*
/sys/class/hwmon/hwmon0/name /sys/class/hwmon/hwmon0/temp1_input
/sys/class/hwmon/hwmon0/temp1_crit /sys/class/hwmon/hwmon0/uevent

/sys/class/hwmon/hwmon0/power:
wakeup

/sys/class/hwmon/hwmon0/subsystem:
hwmon0

x@x-desktop:~$ ls -L /sys/class/hwmon/hwmon1/*
ls: cannot access /sys/class/hwmon/hwmon1/*: No such file or directory

Hwmon variable in my conky was working fine before i upgraded my jaunty to karmic.

Revision history for this message
Cesare Tirabassi (norsetto) wrote :

Well, that's certainly not conky' s fault. You may want to check with the kernel guys (open a different bug if necessary, just don' t pollute this one).

Revision history for this message
Gabriel_P (gabp) wrote :

I'm having a very similar issue. If I use the line:

CPU Temp: ${hwmon 1 temp 1}°Cr

conky will fail with the message:

Conky: can't open '/sys/class/hwmon/hwmon1/temp1_input': No such file or directory
please check your device or remove this var from Conky
X Error of failed request: BadWindow (invalid Window parameter)
  Major opcode of failed request: 61 (X_ClearArea)
  Resource id in failed request: 0x0
  Serial number of failed request: 49
  Current serial number in output stream: 51

but if I change that line to:

CPU Temp: ${hwmon 0 temp 1}°Cr

then conky will work just fine... until I restart my system. Then it will stop working once again with the same error except now it complains of not finding the '/sys/class/hwmon/hwmon1/temp0_input' folder, so I have to go and change the line back (ie: change the '0' to a '1') to make it work again. This works until I restart the system in a never-ending loop.

I have both '/sys/class/hwmon/hwmon1/' AND '/sys/class/hwmon/hwmon0/' folders so I think this might be causing some confusion to conky.

Could this be related to this bug or is this an issue with my system? Any ideas how I could fix this? Cheers.

Revision history for this message
miegiel (nix-miegiel) wrote :

@Gabriel, I'll be sending you a mail about what's going on ;)

@Everyone, this bug has been fixed! Though it might reappear, it is most likely you have found a new bug or something else is going wrong.

Revision history for this message
Srinivas Murthy (smurthygr) wrote :

Using Xubuntu 14.04, Conky. I use
CPU: ${color1}${hwmon 1 temp 1}°C ${color0}${goto 90}MB: ${color1}${hwmon 0 temp 1}°C ${alignr} ${color0}Fan: ${color1}${hwmon 0 fan 1} ${color0}RPM
to show cpu temp, system temp and fanspeed respectively. But every once in a while after rebooting (I shut down my system every day), hwmon 0 and hwmon 1 swap places and cputemp shows systemtemp and vice versa, fanspeed remains blank. If change hwmon 0 to hwmon 1 it works for some time and randomly on some reboot they again interchange.

Revision history for this message
Oleg Moiseichuk (berroll) wrote :

Same problem here. I'm using Ubuntu 12.04 and Conky 1.8.1. I've got 3 hwmon entries in '/sys/class/hwmon': 0, 1, 2 for k10temp, it8720 and nouveau, respectively. After several boots 'hwmon0' and 'hwmon1' swap their places and ${hwmon 1 fan 1} and ${hwmon 1 temp 2} (for CPU fan and temperature, respectively) cannot find their data anymore and Conky crashes. Possibly this happens because some modules change their load order. While I haven't found how this can be influenced, this issue can be resolved by changing sensor. Conky has got 'i2c' and 'platform' variables for the monitoring purposes in addition to 'hwmon'. Platform devices are also symlinks, but they have more distinctive names. I changed my variables to ${platform it87.552 fan 1} and ${platform it87.552 temp 2} and this fixed the issue.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.