Alecriar Studioの中の人の技術メモ

横浜の個人事業主が日々の技術的な情報をつづります

ASRock J4205-ITXでのlm_sensors

まずは公式リポジトリから lm_sensors パッケージをインストールします。

$ pacman -S lm_sensors

lm_sensorsの設定

自動検出

マザーボードに搭載されているセンサー類は多くの種類がありますが、 lm_sensors はそれを自動検出する以下のコマンドがあります。

# sensors-detect

以下は ASRock J4205-ITX での検出結果です。

# sensors-detect revision $Revision$
# Board: ASRock J4205-ITX
# Kernel: 4.17.5-1-ARCH x86_64
# Processor: Intel(R) Pentium(R) CPU J4205 @ 1.50GHz (6/92/9)

This program will help you determine which kernel modules you need
to load to use lm_sensors most effectively. It is generally safe
and recommended to accept the default answers to all questions,
unless you know what you're doing.

Some south bridges, CPUs or memory controllers contain embedded sensors.
Do you want to scan for them? This is totally safe. (YES/no): 
Module cpuid loaded successfully.
Silicon Integrated Systems SIS5595...                       No
VIA VT82C686 Integrated Sensors...                          No
VIA VT8231 Integrated Sensors...                            No
AMD K8 thermal sensors...                                   No
AMD Family 10h thermal sensors...                           No
AMD Family 11h thermal sensors...                           No
AMD Family 12h and 14h thermal sensors...                   No
AMD Family 15h thermal sensors...                           No
AMD Family 16h thermal sensors...                           No
AMD Family 15h power sensors...                             No
AMD Family 16h power sensors...                             No
Intel digital thermal sensor...                             Success!
    (driver `coretemp')
Intel AMB FB-DIMM thermal sensor...                         No
Intel 5500/5520/X58 thermal sensor...                       No
VIA C7 thermal sensor...                                    No
VIA Nano thermal sensor...                                  No

Some Super I/O chips contain embedded sensors. We have to write to
standard I/O ports to probe them. This is usually safe.
Do you want to scan for Super I/O sensors? (YES/no): 
Probing for Super-I/O at 0x2e/0x2f
Trying family `National Semiconductor/ITE'...               No
Trying family `SMSC'...                                     No
Trying family `VIA/Winbond/Nuvoton/Fintek'...               Yes
Found unknown chip with ID 0xd121
    (logical device B has address 0x290, could be sensors)
Probing for Super-I/O at 0x4e/0x4f
Trying family `National Semiconductor/ITE'...               No
Trying family `SMSC'...                                     No
Trying family `VIA/Winbond/Nuvoton/Fintek'...               No
Trying family `ITE'...                                      No

Some systems (mainly servers) implement IPMI, a set of common interfaces
through which system health data may be retrieved, amongst other things.
We first try to get the information from SMBIOS. If we don't find it
there, we have to read from arbitrary I/O ports to probe for such
interfaces. This is normally safe. Do you want to scan for IPMI
interfaces? (YES/no): 
# DMI data unavailable, please consider installing dmidecode 2.7
# or later for better results.
Probing for `IPMI BMC KCS' at 0xca0...                      No
Probing for `IPMI BMC SMIC' at 0xca8...                     No

Some hardware monitoring chips are accessible through the ISA I/O ports.
We have to write to arbitrary I/O ports to probe them. This is usually
safe though. Yes, you do have ISA I/O ports even if you do not have any
ISA slots! Do you want to scan the ISA I/O ports? (YES/no): 
Probing for `National Semiconductor LM78' at 0x290...       No
Probing for `National Semiconductor LM79' at 0x290...       No
Probing for `Winbond W83781D' at 0x290...                   No
Probing for `Winbond W83782D' at 0x290...                   No

Lastly, we can probe the I2C/SMBus adapters for connected hardware
monitoring devices. This is the most risky part, and while it works
reasonably well on most systems, it has been reported to cause trouble
on some systems.
Do you want to probe the I2C/SMBus adapters now? (YES/no): 
Found unknown SMBus adapter 8086:5ad4 at 0000:00:1f.1.
Sorry, no supported PCI bus adapters found.
Module i2c-dev loaded successfully.

Next adapter: SMBus I801 adapter at f040 (i2c-0)
Do you want to scan it? (YES/no/selectively): 
Client found at address 0x50
Probing for `Analog Devices ADM1033'...                     No
Probing for `Analog Devices ADM1034'...                     No
Probing for `SPD EEPROM'...                                 Yes
    (confidence 8, not a hardware monitoring chip)
Probing for `EDID EEPROM'...                                No
Client found at address 0x52
Probing for `Analog Devices ADM1033'...                     No
Probing for `Analog Devices ADM1034'...                     No
Probing for `SPD EEPROM'...                                 Yes
    (confidence 8, not a hardware monitoring chip)

Next adapter: i915 gmbus dpb (i2c-1)
Do you want to scan it? (yes/NO/selectively): 

Next adapter: i915 gmbus dpc (i2c-2)
Do you want to scan it? (yes/NO/selectively): 

Next adapter: i915 gmbus misc (i2c-3)
Do you want to scan it? (yes/NO/selectively): 

Next adapter: DPDDC-A (i2c-4)
Do you want to scan it? (yes/NO/selectively): 

Next adapter: DPDDC-B (i2c-5)
Do you want to scan it? (yes/NO/selectively): 


Now follows a summary of the probes I have just done.
Just press ENTER to continue: 

Driver `coretemp':
  * Chip `Intel digital thermal sensor' (confidence: 9)

Do you want to generate /etc/conf.d/lm_sensors? (YES/no): 
Created symlink /etc/systemd/system/multi-user.target.wants/lm_sensors.service → /usr/lib/systemd/system/lm_sensors.service.
Unloading i2c-dev... OK
Unloading cpuid... OK

現在値の表示

sensorsコマンドで現在の値が表示されます。

# sensors

ASRock J4205-ITXの場合、以下のように表示されるはずです。

acpitz-virtual-0
Adapter: Virtual device
temp1:        +40.0°C  (crit = +100.0°C)

coretemp-isa-0000
Adapter: ISA adapter
Package id 0:  +39.0°C  (high = +105.0°C, crit = +105.0°C)
Core 0:        +39.0°C  (high = +105.0°C, crit = +105.0°C)
Core 1:        +39.0°C  (high = +105.0°C, crit = +105.0°C)
Core 2:        +39.0°C  (high = +105.0°C, crit = +105.0°C)
Core 3:        +39.0°C  (high = +105.0°C, crit = +105.0°C)

何やら acpitz-virtual-0 の温度が40度で、CPUコア温度が39度と言っていますね。ここでの acpitz-virtual-0 はマザーボード上のセンサーではないかと推測できます。

もう少し詳しく情報を見たい場合は以下のようにします。

# sensors -u

ASRock J4205-ITXの場合、このように表示されました。

acpitz-virtual-0
Adapter: Virtual device
temp1:
  temp1_input: 40.000
  temp1_crit: 100.000

coretemp-isa-0000
Adapter: ISA adapter
Package id 0:
  temp1_input: 40.000
  temp1_max: 105.000
  temp1_crit: 105.000
  temp1_crit_alarm: 0.000
Core 0:
  temp2_input: 39.000
  temp2_max: 105.000
  temp2_crit: 105.000
  temp2_crit_alarm: 0.000
Core 1:
  temp3_input: 39.000
  temp3_max: 105.000
  temp3_crit: 105.000
  temp3_crit_alarm: 0.000
Core 2:
  temp4_input: 39.000
  temp4_max: 105.000
  temp4_crit: 105.000
  temp4_crit_alarm: 0.000
Core 3:
  temp5_input: 39.000
  temp5_max: 105.000
  temp5_crit: 105.000
  temp5_crit_alarm: 0.000

lm_sensorsの自動起動

sensors-detect の中での設問で、Do you want to generate /etc/conf.d/lm_sensors? (YES/no): をそのまま空欄かYESとすれば、 systemdのサービスとして組み込まれ、システム起動時に自動的に起動します。

lm_sensors の systemdユニットの状態を確認するには以下のようにします。

$ systemctl status lm_sensors