New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core temp file not present #291

Open
chrissound opened this Issue Feb 27, 2017 · 19 comments

Comments

Projects
None yet
5 participants
@chrissound

chrissound commented Feb 27, 2017

ls /sys/bus/platform/devices/coretemp                      
ls: cannot access '/sys/bus/platform/devices/coretemp': No such file or directory

This file is present however (with the correct value) /sys/class/hwmon/hwmon0/device/hwmon/hwmon0/temp1_input

@jaor

This comment has been minimized.

Show comment
Hide comment
@jaor

jaor Feb 28, 2017

Owner
Owner

jaor commented Feb 28, 2017

@chrissound

This comment has been minimized.

Show comment
Hide comment
@chrissound

chrissound Mar 1, 2017

ls -l /sys/bus/platform/devices
total 0
lrwxrwxrwx 1 root root 0 Mar  1 10:01  alarmtimer -> ../../../devices/platform/alarmtimer
lrwxrwxrwx 1 root root 0 Mar  1 10:01  ATK0110:00 -> ../../../devices/pci0000:00/0000:00:14.3/ATK0110:00
lrwxrwxrwx 1 root root 0 Mar  1 10:01  i8042 -> ../../../devices/platform/i8042
lrwxrwxrwx 1 root root 0 Mar  1 10:01  microcode -> ../../../devices/platform/microcode
lrwxrwxrwx 1 root root 0 Mar  1 10:01  pcspkr -> ../../../devices/platform/pcspkr
lrwxrwxrwx 1 root root 0 Mar  1 10:01  PNP0103:00 -> ../../../devices/pci0000:00/0000:00:14.3/PNP0103:00
lrwxrwxrwx 1 root root 0 Mar  1 10:01  PNP0800:00 -> ../../../devices/pci0000:00/0000:00:14.3/PNP0800:00
lrwxrwxrwx 1 root root 0 Mar  1 10:01  PNP0C04:00 -> ../../../devices/pci0000:00/0000:00:14.3/PNP0C04:00
lrwxrwxrwx 1 root root 0 Mar  1 10:01  PNP0C0C:00 -> ../../../devices/platform/PNP0C0C:00
lrwxrwxrwx 1 root root 0 Mar  1 10:01  PNP0C14:00 -> ../../../devices/platform/PNP0C14:00
lrwxrwxrwx 1 root root 0 Mar  1 10:01  regulatory.0 -> ../../../devices/platform/regulatory.0
lrwxrwxrwx 1 root root 0 Mar  1 10:01  serial8250 -> ../../../devices/platform/serial8250
lrwxrwxrwx 1 root root 0 Mar  1 10:01 'SP5100 TCO timer' -> '../../../devices/platform/SP5100 TCO timer'
lrwxrwxrwx 1 root root 0 Mar  1 10:01  vboxdrv.0 -> ../../../devices/platform/vboxdrv.0
lrwxrwxrwx 1 root root 0 Mar  1 10:01  vesa-framebuffer.0 -> ../../../devices/platform/vesa-framebuffer.0

So no that does not appear there either.

chrissound commented Mar 1, 2017

ls -l /sys/bus/platform/devices
total 0
lrwxrwxrwx 1 root root 0 Mar  1 10:01  alarmtimer -> ../../../devices/platform/alarmtimer
lrwxrwxrwx 1 root root 0 Mar  1 10:01  ATK0110:00 -> ../../../devices/pci0000:00/0000:00:14.3/ATK0110:00
lrwxrwxrwx 1 root root 0 Mar  1 10:01  i8042 -> ../../../devices/platform/i8042
lrwxrwxrwx 1 root root 0 Mar  1 10:01  microcode -> ../../../devices/platform/microcode
lrwxrwxrwx 1 root root 0 Mar  1 10:01  pcspkr -> ../../../devices/platform/pcspkr
lrwxrwxrwx 1 root root 0 Mar  1 10:01  PNP0103:00 -> ../../../devices/pci0000:00/0000:00:14.3/PNP0103:00
lrwxrwxrwx 1 root root 0 Mar  1 10:01  PNP0800:00 -> ../../../devices/pci0000:00/0000:00:14.3/PNP0800:00
lrwxrwxrwx 1 root root 0 Mar  1 10:01  PNP0C04:00 -> ../../../devices/pci0000:00/0000:00:14.3/PNP0C04:00
lrwxrwxrwx 1 root root 0 Mar  1 10:01  PNP0C0C:00 -> ../../../devices/platform/PNP0C0C:00
lrwxrwxrwx 1 root root 0 Mar  1 10:01  PNP0C14:00 -> ../../../devices/platform/PNP0C14:00
lrwxrwxrwx 1 root root 0 Mar  1 10:01  regulatory.0 -> ../../../devices/platform/regulatory.0
lrwxrwxrwx 1 root root 0 Mar  1 10:01  serial8250 -> ../../../devices/platform/serial8250
lrwxrwxrwx 1 root root 0 Mar  1 10:01 'SP5100 TCO timer' -> '../../../devices/platform/SP5100 TCO timer'
lrwxrwxrwx 1 root root 0 Mar  1 10:01  vboxdrv.0 -> ../../../devices/platform/vboxdrv.0
lrwxrwxrwx 1 root root 0 Mar  1 10:01  vesa-framebuffer.0 -> ../../../devices/platform/vesa-framebuffer.0

So no that does not appear there either.

jaor added a commit that referenced this issue Mar 3, 2017

@jaor

This comment has been minimized.

Show comment
Hide comment
@jaor

jaor Mar 3, 2017

Owner
Owner

jaor commented Mar 3, 2017

@chrissound

This comment has been minimized.

Show comment
Hide comment
@chrissound

chrissound Mar 3, 2017

Hmmm so I'm getting error: Prelude.read: no parse in the temperature slot.

$ cat /sys/class/hwmon/hwmon0/device/hwmon/hwmon0/temp1_input
31000

chrissound commented Mar 3, 2017

Hmmm so I'm getting error: Prelude.read: no parse in the temperature slot.

$ cat /sys/class/hwmon/hwmon0/device/hwmon/hwmon0/temp1_input
31000
@jaor

This comment has been minimized.

Show comment
Hide comment
@jaor

jaor Mar 4, 2017

Owner
Owner

jaor commented Mar 4, 2017

@chrissound

This comment has been minimized.

Show comment
Hide comment
@chrissound

chrissound Mar 6, 2017

I do:

cat /sys/class/hwmon/hwmon0/device/hwmon/hwmon0/temp1_label    
CPU Temperature

chrissound commented Mar 6, 2017

I do:

cat /sys/class/hwmon/hwmon0/device/hwmon/hwmon0/temp1_label    
CPU Temperature
@jaor

This comment has been minimized.

Show comment
Hide comment
@jaor

jaor Mar 20, 2017

Owner
Owner

jaor commented Mar 20, 2017

@chrissound

This comment has been minimized.

Show comment
Hide comment
@chrissound

chrissound Mar 20, 2017

Could I call the corresponding function from GHCi? Might be able to track it down then.

I'm not sure which function it is though?

chrissound commented Mar 20, 2017

Could I call the corresponding function from GHCi? Might be able to track it down then.

I'm not sure which function it is though?

@jaor

This comment has been minimized.

Show comment
Hide comment
@jaor

jaor May 3, 2017

Owner

sorry @chrissound, i lost track of this one.

the function reading the files is checkDataRetrieval, which is called in src/Plugins/Monitors/CoreTemp.hs with a collection of path components. checkDataRetrieval is defined Plugins.Monitors.CoreCommon.

Owner

jaor commented May 3, 2017

sorry @chrissound, i lost track of this one.

the function reading the files is checkDataRetrieval, which is called in src/Plugins/Monitors/CoreTemp.hs with a collection of path components. checkDataRetrieval is defined Plugins.Monitors.CoreCommon.

@peterbecich

This comment has been minimized.

Show comment
Hide comment
@peterbecich

peterbecich Jun 5, 2017

Almost the same for me

  /sys/bus/platform/devices:
  total 0
  drwxr-xr-x 2 root root 0 Jun  5 10:32 .
  drwxr-xr-x 4 root root 0 Jun  4 21:11 ..
  lrwxrwxrwx 1 root root 0 Jun  4 21:11 alarmtimer -> ../../../devices/platform/alarmtimer
  lrwxrwxrwx 1 root root 0 Jun  4 21:11 AMDI0030:00 -> ../../../devices/platform/AMDI0030:00
  lrwxrwxrwx 1 root root 0 Jun  4 21:11 AMDIF030:00 -> ../../../devices/platform/AMDIF030:00
  lrwxrwxrwx 1 root root 0 Jun  4 21:11 i8042 -> ../../../devices/platform/i8042
  lrwxrwxrwx 1 root root 0 Jun  4 21:11 microcode -> ../../../devices/platform/microcode
  lrwxrwxrwx 1 root root 0 Jun  5 10:32 nct6775.656 -> ../../../devices/platform/nct6775.656
  lrwxrwxrwx 1 root root 0 Jun  4 21:11 pcspkr -> ../../../devices/platform/pcspkr
  lrwxrwxrwx 1 root root 0 Jun  4 21:11 platform-framebuffer.0 -> ../../../devices/platform/platform-framebuffer.0
  lrwxrwxrwx 1 root root 0 Jun  4 21:11 PNP0103:00 -> ../../../devices/platform/PNP0103:00
  lrwxrwxrwx 1 root root 0 Jun  4 21:11 PNP0800:00 -> ../../../devices/pci0000:00/0000:00:14.3/PNP0800:00
  lrwxrwxrwx 1 root root 0 Jun  4 21:11 PNP0C0C:00 -> ../../../devices/platform/PNP0C0C:00
  lrwxrwxrwx 1 root root 0 Jun  4 21:11 PNP0C14:00 -> ../../../devices/platform/PNP0C14:00
  lrwxrwxrwx 1 root root 0 Jun  5 10:32 regulatory.0 -> ../../../devices/platform/regulatory.0
  lrwxrwxrwx 1 root root 0 Jun  4 21:11 serial8250 -> ../../../devices/platform/serial8250
  lrwxrwxrwx 1 root root 0 Jun  5 10:32 SP5100 TCO timer -> ../../../devices/platform/SP5100 TCO timer

temp1, temp2, etc correspond to different things for me than for @chrissound


/sys/class/hwmon/hwmon0/device/hwmon/hwmon0 $ cat temp1_label
SYSTIN
/sys/class/hwmon/hwmon0/device/hwmon/hwmon0 $ cat temp2_label
CPUTIN
/sys/class/hwmon/hwmon0/device/hwmon/hwmon0 $ cat temp3_label
AUXTIN0

Thanks!

peterbecich commented Jun 5, 2017

Almost the same for me

  /sys/bus/platform/devices:
  total 0
  drwxr-xr-x 2 root root 0 Jun  5 10:32 .
  drwxr-xr-x 4 root root 0 Jun  4 21:11 ..
  lrwxrwxrwx 1 root root 0 Jun  4 21:11 alarmtimer -> ../../../devices/platform/alarmtimer
  lrwxrwxrwx 1 root root 0 Jun  4 21:11 AMDI0030:00 -> ../../../devices/platform/AMDI0030:00
  lrwxrwxrwx 1 root root 0 Jun  4 21:11 AMDIF030:00 -> ../../../devices/platform/AMDIF030:00
  lrwxrwxrwx 1 root root 0 Jun  4 21:11 i8042 -> ../../../devices/platform/i8042
  lrwxrwxrwx 1 root root 0 Jun  4 21:11 microcode -> ../../../devices/platform/microcode
  lrwxrwxrwx 1 root root 0 Jun  5 10:32 nct6775.656 -> ../../../devices/platform/nct6775.656
  lrwxrwxrwx 1 root root 0 Jun  4 21:11 pcspkr -> ../../../devices/platform/pcspkr
  lrwxrwxrwx 1 root root 0 Jun  4 21:11 platform-framebuffer.0 -> ../../../devices/platform/platform-framebuffer.0
  lrwxrwxrwx 1 root root 0 Jun  4 21:11 PNP0103:00 -> ../../../devices/platform/PNP0103:00
  lrwxrwxrwx 1 root root 0 Jun  4 21:11 PNP0800:00 -> ../../../devices/pci0000:00/0000:00:14.3/PNP0800:00
  lrwxrwxrwx 1 root root 0 Jun  4 21:11 PNP0C0C:00 -> ../../../devices/platform/PNP0C0C:00
  lrwxrwxrwx 1 root root 0 Jun  4 21:11 PNP0C14:00 -> ../../../devices/platform/PNP0C14:00
  lrwxrwxrwx 1 root root 0 Jun  5 10:32 regulatory.0 -> ../../../devices/platform/regulatory.0
  lrwxrwxrwx 1 root root 0 Jun  4 21:11 serial8250 -> ../../../devices/platform/serial8250
  lrwxrwxrwx 1 root root 0 Jun  5 10:32 SP5100 TCO timer -> ../../../devices/platform/SP5100 TCO timer

temp1, temp2, etc correspond to different things for me than for @chrissound


/sys/class/hwmon/hwmon0/device/hwmon/hwmon0 $ cat temp1_label
SYSTIN
/sys/class/hwmon/hwmon0/device/hwmon/hwmon0 $ cat temp2_label
CPUTIN
/sys/class/hwmon/hwmon0/device/hwmon/hwmon0 $ cat temp3_label
AUXTIN0

Thanks!

@peterbecich

This comment has been minimized.

Show comment
Hide comment
@peterbecich

peterbecich Jun 7, 2017

I suspect this is my issue: https://askubuntu.com/questions/912413/is-there-a-temperature-sensing-utility-for-linux-that-will-read-a-ryzen-1700-cpu

Reading the core temps in xmobar worked easily on my old computer. For me the problem is not xmobar. Thanks!

peterbecich commented Jun 7, 2017

I suspect this is my issue: https://askubuntu.com/questions/912413/is-there-a-temperature-sensing-utility-for-linux-that-will-read-a-ryzen-1700-cpu

Reading the core temps in xmobar worked easily on my old computer. For me the problem is not xmobar. Thanks!

@jaor

This comment has been minimized.

Show comment
Hide comment
@jaor

jaor Jun 7, 2017

Owner

@peterbecich thanks a lot for the update. @chrissound could this be also the problem for you?

Owner

jaor commented Jun 7, 2017

@peterbecich thanks a lot for the update. @chrissound could this be also the problem for you?

@chrissound

This comment has been minimized.

Show comment
Hide comment
@chrissound

chrissound Jun 7, 2017

Hmm, so I am using an AMD cpu (FX 8320). But the temperature shows up correctly using lm_sensors.

chrissound commented Jun 7, 2017

Hmm, so I am using an AMD cpu (FX 8320). But the temperature shows up correctly using lm_sensors.

@peterbecich

This comment has been minimized.

Show comment
Hide comment
@peterbecich

peterbecich Jun 7, 2017

@chrissound we must have different problems then. I will try the Ask Ubuntu solution now and report back.

No core temps for me, excluding CPUTIN which I've read is the mobo's temperature reading of the CPU:

peterbecich@Neptune:~$ sensors
nct6779-isa-0290
Adapter: ISA adapter
in0:                    +0.62 V  (min =  +0.00 V, max =  +1.74 V)
in1:                    +0.26 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in2:                    +3.34 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in3:                    +3.34 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in4:                    +1.82 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in5:                    +0.90 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in6:                    +0.28 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in7:                    +3.47 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in8:                    +3.26 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in9:                    +0.00 V  (min =  +0.00 V, max =  +0.00 V)
in10:                   +0.23 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in11:                   +1.04 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in12:                   +1.68 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in13:                   +1.05 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in14:                   +1.81 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
fan1:                  1112 RPM  (min =    0 RPM)
fan2:                  1854 RPM  (min =    0 RPM)
fan3:                     0 RPM  (min =    0 RPM)
fan4:                     0 RPM  (min =    0 RPM)
fan5:                     0 RPM  (min =    0 RPM)
SYSTIN:                 +26.0°C  (high =  +0.0°C, hyst =  +0.0°C)  ALARM  sensor = thermistor
CPUTIN:                 +29.0°C  (high = +80.0°C, hyst = +75.0°C)  sensor = thermistor
AUXTIN0:                +82.0°C    sensor = thermistor
AUXTIN1:                +99.0°C    sensor = thermistor
AUXTIN2:                +24.0°C    sensor = thermistor
AUXTIN3:                -23.0°C    sensor = thermistor
PCH_CHIP_CPU_MAX_TEMP:   +0.0°C  
PCH_CHIP_TEMP:           +0.0°C  
PCH_CPU_TEMP:            +0.0°C  
PCH_MCH_TEMP:            +0.0°C  
intrusion0:            OK
intrusion1:            ALARM
beep_enable:           disabled

Update: I'm totally confident my problem is completely unrelated to Xmobar. It will either be fixed by forcing the right kernel module (https://github.com/groeck/nct6775) or by waiting for kernel 4.10 or 4.11.

Sorry for taking your time on this. Thanks!

peterbecich commented Jun 7, 2017

@chrissound we must have different problems then. I will try the Ask Ubuntu solution now and report back.

No core temps for me, excluding CPUTIN which I've read is the mobo's temperature reading of the CPU:

peterbecich@Neptune:~$ sensors
nct6779-isa-0290
Adapter: ISA adapter
in0:                    +0.62 V  (min =  +0.00 V, max =  +1.74 V)
in1:                    +0.26 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in2:                    +3.34 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in3:                    +3.34 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in4:                    +1.82 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in5:                    +0.90 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in6:                    +0.28 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in7:                    +3.47 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in8:                    +3.26 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in9:                    +0.00 V  (min =  +0.00 V, max =  +0.00 V)
in10:                   +0.23 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in11:                   +1.04 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in12:                   +1.68 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in13:                   +1.05 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in14:                   +1.81 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
fan1:                  1112 RPM  (min =    0 RPM)
fan2:                  1854 RPM  (min =    0 RPM)
fan3:                     0 RPM  (min =    0 RPM)
fan4:                     0 RPM  (min =    0 RPM)
fan5:                     0 RPM  (min =    0 RPM)
SYSTIN:                 +26.0°C  (high =  +0.0°C, hyst =  +0.0°C)  ALARM  sensor = thermistor
CPUTIN:                 +29.0°C  (high = +80.0°C, hyst = +75.0°C)  sensor = thermistor
AUXTIN0:                +82.0°C    sensor = thermistor
AUXTIN1:                +99.0°C    sensor = thermistor
AUXTIN2:                +24.0°C    sensor = thermistor
AUXTIN3:                -23.0°C    sensor = thermistor
PCH_CHIP_CPU_MAX_TEMP:   +0.0°C  
PCH_CHIP_TEMP:           +0.0°C  
PCH_CPU_TEMP:            +0.0°C  
PCH_MCH_TEMP:            +0.0°C  
intrusion0:            OK
intrusion1:            ALARM
beep_enable:           disabled

Update: I'm totally confident my problem is completely unrelated to Xmobar. It will either be fixed by forcing the right kernel module (https://github.com/groeck/nct6775) or by waiting for kernel 4.10 or 4.11.

Sorry for taking your time on this. Thanks!

@nicolasavru

This comment has been minimized.

Show comment
Hide comment
@nicolasavru

nicolasavru Aug 26, 2017

938a8d8 broke cpu temp monitoring for me (I get error: Prelude.read: no parse).

lbl = Just ("_label", read . dropWhile (not . isDigit))
assumes that every sensor label ends with a number.
This is true for coretemp (hwmon0 corresponds to coretemp on my system):

[15:29:04][avru@gateway:~]$ cat /sys/devices/platform/coretemp.0/hwmon/hwmon0/*_label
Package id 0
Core 0
Core 1
Core 2
Core 3
Core 4
Core 5
[15:29:08][avru@gateway:~]$ cat /sys/class/hwmon/hwmon0/*_label
Package id 0
Core 0
Core 1
Core 2
Core 3
Core 4

This is not true for other sensors:

[15:29:12][avru@gateway:~]$ cat /sys/class/hwmon/hwmon1/*_label
SYSTIN
CPUTIN
AUXTIN0
AUXTIN1
AUXTIN2
AUXTIN3
PECI Agent 0
PCH_CHIP_CPU_MAX_TEMP
PCH_CHIP_TEMP
PCH_CPU_TEMP

When lbl tries to parse most of those strings, it tries to read the empty string it gets from dropWhile (not . isDigit) and throws Prelude.read: no parse.

The coretemp kernel module only applies to Intel CPUs (AMD CPUs use different sensors, don't know which offhand), which would explain the missing /sys/bus/platform/devices/coretemp dir in the original bug report. /sys/class/hwmon/... contains all sorts of sensors (including CPU temps), so having xmobar look at everything in there isn't correct. I doubt that looking at just /sys/class/hwmon/hwmon0/... is correct either since (I think) the CPU sensors aren't necessarily on hwmon0.

If you wish to be able to monitor non-coretemp temp sensors, a good approach may be to change the template spec to allow arbitrary labels that would match the *_label files. This would be useful for coretemp sensors also: on my system, given the current parsing, corresponds to the "Package id 0" sensor, to "Core 0", to "Core 1", and so on. May be worth leaving the current template syntax for backward-compatibility.

Full sensors output from my system:

[15:24:27][avru@gateway:/tmp/xmobar]$ sensors
coretemp-isa-0000
Adapter: ISA adapter
Package id 0:  +37.0°C  (high = +95.0°C, crit = +105.0°C)
Core 0:        +32.0°C  (high = +95.0°C, crit = +105.0°C)
Core 1:        +30.0°C  (high = +95.0°C, crit = +105.0°C)
Core 2:        +31.0°C  (high = +95.0°C, crit = +105.0°C)
Core 3:        +32.0°C  (high = +95.0°C, crit = +105.0°C)
Core 4:        +28.0°C  (high = +95.0°C, crit = +105.0°C)
Core 5:        +32.0°C  (high = +95.0°C, crit = +105.0°C)

nct6791-isa-0290
Adapter: ISA adapter
Vcore:                  +0.86 V  (min =  +0.00 V, max =  +1.74 V)
in1:                    +1.84 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
AVCC:                   +3.30 V  (min =  +2.98 V, max =  +3.63 V)
+3.3V:                  +3.30 V  (min =  +2.98 V, max =  +3.63 V)
in4:                    +1.25 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in5:                    +1.67 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in6:                    +0.26 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
3VSB:                   +3.49 V  (min =  +2.98 V, max =  +3.63 V)
Vbat:                   +3.33 V  (min =  +2.70 V, max =  +3.63 V)
in9:                    +1.06 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in10:                   +1.65 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in11:                   +0.35 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in12:                   +1.25 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in13:                   +1.05 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in14:                   +0.00 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
fan1:                  1053 RPM  (min =    0 RPM)
fan2:                  2347 RPM  (min =    0 RPM)
fan3:                     0 RPM  (min =    0 RPM)
fan4:                   929 RPM  (min =    0 RPM)
fan5:                   869 RPM  (min =    0 RPM)
fan6:                     0 RPM
SYSTIN:                 +37.0°C  (high =  +0.0°C, hyst =  +0.0°C)  ALARM  sensor = thermistor
CPUTIN:                 +31.0°C  (high = +80.0°C, hyst = +75.0°C)  sensor = thermistor
AUXTIN0:                +89.0°C    sensor = thermistor
AUXTIN1:                +35.0°C    sensor = thermistor
AUXTIN2:                +80.0°C    sensor = thermistor
AUXTIN3:               +127.0°C    sensor = thermistor
PECI Agent 0:           +36.5°C  (high = +80.0°C, hyst = +75.0°C)
                                 (crit = +105.0°C)
PCH_CHIP_CPU_MAX_TEMP:   +0.0°C  
PCH_CHIP_TEMP:           +0.0°C  
PCH_CPU_TEMP:            +0.0°C  
intrusion0:            ALARM
intrusion1:            ALARM
beep_enable:           disabled

nicolasavru commented Aug 26, 2017

938a8d8 broke cpu temp monitoring for me (I get error: Prelude.read: no parse).

lbl = Just ("_label", read . dropWhile (not . isDigit))
assumes that every sensor label ends with a number.
This is true for coretemp (hwmon0 corresponds to coretemp on my system):

[15:29:04][avru@gateway:~]$ cat /sys/devices/platform/coretemp.0/hwmon/hwmon0/*_label
Package id 0
Core 0
Core 1
Core 2
Core 3
Core 4
Core 5
[15:29:08][avru@gateway:~]$ cat /sys/class/hwmon/hwmon0/*_label
Package id 0
Core 0
Core 1
Core 2
Core 3
Core 4

This is not true for other sensors:

[15:29:12][avru@gateway:~]$ cat /sys/class/hwmon/hwmon1/*_label
SYSTIN
CPUTIN
AUXTIN0
AUXTIN1
AUXTIN2
AUXTIN3
PECI Agent 0
PCH_CHIP_CPU_MAX_TEMP
PCH_CHIP_TEMP
PCH_CPU_TEMP

When lbl tries to parse most of those strings, it tries to read the empty string it gets from dropWhile (not . isDigit) and throws Prelude.read: no parse.

The coretemp kernel module only applies to Intel CPUs (AMD CPUs use different sensors, don't know which offhand), which would explain the missing /sys/bus/platform/devices/coretemp dir in the original bug report. /sys/class/hwmon/... contains all sorts of sensors (including CPU temps), so having xmobar look at everything in there isn't correct. I doubt that looking at just /sys/class/hwmon/hwmon0/... is correct either since (I think) the CPU sensors aren't necessarily on hwmon0.

If you wish to be able to monitor non-coretemp temp sensors, a good approach may be to change the template spec to allow arbitrary labels that would match the *_label files. This would be useful for coretemp sensors also: on my system, given the current parsing, corresponds to the "Package id 0" sensor, to "Core 0", to "Core 1", and so on. May be worth leaving the current template syntax for backward-compatibility.

Full sensors output from my system:

[15:24:27][avru@gateway:/tmp/xmobar]$ sensors
coretemp-isa-0000
Adapter: ISA adapter
Package id 0:  +37.0°C  (high = +95.0°C, crit = +105.0°C)
Core 0:        +32.0°C  (high = +95.0°C, crit = +105.0°C)
Core 1:        +30.0°C  (high = +95.0°C, crit = +105.0°C)
Core 2:        +31.0°C  (high = +95.0°C, crit = +105.0°C)
Core 3:        +32.0°C  (high = +95.0°C, crit = +105.0°C)
Core 4:        +28.0°C  (high = +95.0°C, crit = +105.0°C)
Core 5:        +32.0°C  (high = +95.0°C, crit = +105.0°C)

nct6791-isa-0290
Adapter: ISA adapter
Vcore:                  +0.86 V  (min =  +0.00 V, max =  +1.74 V)
in1:                    +1.84 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
AVCC:                   +3.30 V  (min =  +2.98 V, max =  +3.63 V)
+3.3V:                  +3.30 V  (min =  +2.98 V, max =  +3.63 V)
in4:                    +1.25 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in5:                    +1.67 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in6:                    +0.26 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
3VSB:                   +3.49 V  (min =  +2.98 V, max =  +3.63 V)
Vbat:                   +3.33 V  (min =  +2.70 V, max =  +3.63 V)
in9:                    +1.06 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in10:                   +1.65 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in11:                   +0.35 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in12:                   +1.25 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in13:                   +1.05 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in14:                   +0.00 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
fan1:                  1053 RPM  (min =    0 RPM)
fan2:                  2347 RPM  (min =    0 RPM)
fan3:                     0 RPM  (min =    0 RPM)
fan4:                   929 RPM  (min =    0 RPM)
fan5:                   869 RPM  (min =    0 RPM)
fan6:                     0 RPM
SYSTIN:                 +37.0°C  (high =  +0.0°C, hyst =  +0.0°C)  ALARM  sensor = thermistor
CPUTIN:                 +31.0°C  (high = +80.0°C, hyst = +75.0°C)  sensor = thermistor
AUXTIN0:                +89.0°C    sensor = thermistor
AUXTIN1:                +35.0°C    sensor = thermistor
AUXTIN2:                +80.0°C    sensor = thermistor
AUXTIN3:               +127.0°C    sensor = thermistor
PECI Agent 0:           +36.5°C  (high = +80.0°C, hyst = +75.0°C)
                                 (crit = +105.0°C)
PCH_CHIP_CPU_MAX_TEMP:   +0.0°C  
PCH_CHIP_TEMP:           +0.0°C  
PCH_CPU_TEMP:            +0.0°C  
intrusion0:            ALARM
intrusion1:            ALARM
beep_enable:           disabled
@jaor

This comment has been minimized.

Show comment
Hide comment
@jaor

jaor Sep 2, 2017

Owner
Owner

jaor commented Sep 2, 2017

@ptkato

This comment has been minimized.

Show comment
Hide comment
@ptkato

ptkato Aug 20, 2018

Any news on this? My files are also in another directory. Should I symlink them? If so, which ones and to where?

ptkato commented Aug 20, 2018

Any news on this? My files are also in another directory. Should I symlink them? If so, which ones and to where?

@jaor

This comment has been minimized.

Show comment
Hide comment
@jaor

jaor Oct 10, 2018

Owner

@ptkato sorry for the awfully late reply, your question went totally under my radar. By default, CoreTemp is looking for directories inside /sys/class/hwmon/, which are in my system symlinks called hwmon0, hwmon1, and so on. An alternative place it looks into is /sys/bus/platform/devices/coretemp.n/hwmon/hwmon/. Inside there it's expecting files called temp1_input, temp1_label, and so on.

Owner

jaor commented Oct 10, 2018

@ptkato sorry for the awfully late reply, your question went totally under my radar. By default, CoreTemp is looking for directories inside /sys/class/hwmon/, which are in my system symlinks called hwmon0, hwmon1, and so on. An alternative place it looks into is /sys/bus/platform/devices/coretemp.n/hwmon/hwmon/. Inside there it's expecting files called temp1_input, temp1_label, and so on.

jaor added a commit that referenced this issue Oct 10, 2018

@jaor

This comment has been minimized.

Show comment
Hide comment
@jaor

jaor Oct 10, 2018

Owner

@nicolasavru i've reverted 938a8d8, since it wasn't actually helping in any way. @ptkato that means that the directory that it's being looked for is the /sys/bus one... we still need a proper fix for the problems described by @nicolasavru .

Owner

jaor commented Oct 10, 2018

@nicolasavru i've reverted 938a8d8, since it wasn't actually helping in any way. @ptkato that means that the directory that it's being looked for is the /sys/bus one... we still need a proper fix for the problems described by @nicolasavru .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment