際際滷

際際滷Share a Scribd company logo
舒于亠仍 仂从亳仆 General R&D, 2017
lm-sensors 于 embedded
 亠仄仂亠仆亳从亳 亟仂 仗舒于仍亠仆亳 于 linux
LM -- Linux Monitoring
舒于亠仍 仂从亳仆 General R&D, 2017
 仄 仗仂亶亟 亠?
 舒从 仗仂弍仍亠仄 亠舒亠仄
 弌亠仄舒, 舒亳亠从舒
 丼亳仗 亠仆仂舒 于 device-tree
 亠亠从亳仄 亳仗 亠仆仂舒 于 linux
 hwmon userspace-亳仆亠亠亶
 仂仆亳亞亳亠仄 sensors
 仂仆亳亞亳亠仄 仗舒于仍亠仆亳亠 于亠仆亳仍仂舒仄亳
 亠仄仂 仆舒 亢亳于仂仄 仂亶于亠
2
舒于亠仍 仂从亳仆 General R&D, 2017
舒从 亰舒亟舒 亠舒亠仄?
 仂仆亳仂亳仆亞 仆舒仗礀亠仆亳亶 仆舒 仗仍舒亠 (3.3 , 2.5 , 5 )
 仂仆亳仂亳仆亞 仆舒仗礀亠仆亳亶  (12 )
 仂仆亳仂亳仆亞 亠仄仗亠舒 (仗仂亠仂, , 亠亟仆亠亠)
 于仂仄舒亳亠从仂亠 仗舒于仍亠仆亳亠 于亠仆亳仍仂舒仄亳
亢亠仆 从仂仆仂仍 仗仂亟亳亠仄 亳亰 linux!
3
舒于亠仍 仂从亳仆 General R&D, 2017
仍仂从-亠仄舒 仂亶于舒
4
舒于亠仍 仂从亳仆 General R&D, 2017
仂仄仗仂仆亠仆 亠仄
 adt7463 -- 舒仆舒仍仂亞 National lm85
 ads7830 -- 仄仆仂亞仂从舒仆舒仍仆亶 丶
 丐亠仄仗亠舒仆亠 亠仆仂: 2N3906 亳 NTC-亠仄亳仂
 AC/DC -- 舒亟舒仗亠 ~220V 于 12V
 Power supply -- 亳仂仆亳从亳 仗亳舒仆亳
5
舒于亠仍 仂从亳仆 General R&D, 2017
adt7463
弌亠仄仂亠仆亳从舒:
 仂仆亳仂亳仆亞 仆舒仗礀亠仆亳亶 亳 亠仄仗亠舒
 于仂仆仂仄仆仂亠 仗舒于仍亠仆亳亠 于亠仆亳仍仂舒仄亳
 https://www.onsemi.com/pub/Collateral/ADT7463-D.PDF
Linux:
 https://www.kernel.org/doc/Documentation/hwmon/lm85
 modprobe lm85
6
舒于亠仍 仂从亳仆 General R&D, 2017
ads7830
弌亠仄仂亠仆亳从舒:
 仂仆亳仂亳仆亞 仆舒仗礀亠仆亳亶
 8-仄亳 从舒仆舒仍仆亶 丶 (8 弍亳)
 http://www.ti.com/lit/ds/symlink/ads7830.pdf
Linux:
 modprobe ads7828
 https://www.kernel.org/doc/Documentation/hwmon/ads7828
7
舒于亠仍 仂从亳仆 General R&D, 2017
舒亞亰从舒 Linux 仆舒 SoC
1. 亠于亳仆亶 亰舒亞亰亳从 (preloader)
2. 仂亳仆亶 亰舒亞亰亳从 (u-boot)
3. Linux kernel
4. init/systemd
亢亠仆 从仂亠从仆亶 device-tree
8
舒于亠仍 仂从亳仆 General R&D, 2017
仂弍舒于仍磳仄 亳仗 于 device-tree
lm85@2d {
compatible = "national,adt7463";
reg = <0x2d>;
status = "okay";
};
adc@48 {
compatible = "at,ads7830";
reg = <0x48>;
status = "okay";
};
仂亟亟亠亢亳于舒亠 仄仂亟仍亠仄 ads7828.ko
~$ /sbin/modinfo ads7828 | grep ads7830
alias: i2c:ads7830
仂亟亟亠亢亳于舒亠 仄仂亟仍亠仄 lm85.ko
~$ /sbin/modinfo lm85 | grep adt7463
alias: i2c:adt7463
9
舒于亠仍 仂从亳仆 General R&D, 2017
仆仄亠仆 亟仍 i2c
 apt-get install i2c-tools
 丼亠仆亳亠-亰舒仗亳 亠亞亳仂于: i2cget, i2cset
 弌从舒仆亳仂于舒仆亳亠 亳仆: i2cdetect, i2cdump
10
舒于亠仍 仂从亳仆 General R&D, 2017
亠弍舒亢亳仄 i2c
# i2cdetect -r 0
...
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- 0c -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- UU -- -- -- -- -- 2d 2e --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- UU -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
亳仗仂仍亰亠 亟舒亶于亠仂仄
仆亠 亳仗仂仍亰亠
亟舒亶于亠仂仄
11
舒于亠仍 仂从亳仆 General R&D, 2017
舒亞亢舒亠仄 仄仂亟仍亳
# modprobe lm85
# modprobe ads7828
# i2cdetect -r 0
...
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- 0c -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- UU -- -- -- -- -- UU UU --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- UU -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
12
舒于亠仍 仂从亳仆 General R&D, 2017
hwmon
 Documentation/hwmon
/sys/class/hwmon
Documentation/hwmon/sysfs-interface
13
舒于亠仍 仂从亳仆 General R&D, 2017
hwmon sysfs interface
 舒仗礀亠仆亳亠
 丐仂从
 仂仆仂
 丐亠仄仗亠舒舒
 仂亢亠仆亳亠
 弍仂仂 于亠仆亳仍仂仂于
 PWM
 仂亢仆仂 亳仗仂仍亰仂于舒 弍亠亰 sensors
 Documentation/hwmon/sysfs-interface
舒 仍舒亶
14
舒于亠仍 仂从亳仆 General R&D, 2017
adt7463 sysfs contents
# ls /sys/class/hwmon/hwmon1/
alarms in0_max in4_min pwm3_auto_pwm_minctl temp2_auto_temp_off
cpu0_vid in0_min name pwm3_enable temp2_input
device in1_alarm pwm1 pwm3_freq temp2_max
fan1_alarm in1_input pwm1_auto_channels subsystem temp2_min
fan1_input in1_max pwm1_auto_pwm_min temp1_alarm temp3_alarm
fan1_min in1_min pwm1_auto_pwm_minctl temp1_auto_temp_crit temp3_auto_temp_crit
fan2_alarm in2_alarm pwm1_enable temp1_auto_temp_max temp3_auto_temp_max
fan2_input in2_input pwm1_freq temp1_auto_temp_min temp3_auto_temp_min
fan2_min in2_max pwm2 temp1_auto_temp_off temp3_auto_temp_off
fan3_alarm in2_min pwm2_auto_channels temp1_fault temp3_fault
fan3_input in3_alarm pwm2_auto_pwm_min temp1_input temp3_input
fan3_min in3_input pwm2_auto_pwm_minctl temp1_max temp3_max
fan4_alarm in3_max pwm2_enable temp1_min temp3_min
fan4_input in3_min pwm2_freq temp2_alarm uevent
fan4_min in4_alarm pwm3 temp2_auto_temp_crit vrm
in0_alarm in4_input pwm3_auto_channels temp2_auto_temp_max
in0_input in4_max pwm3_auto_pwm_min temp2_auto_temp_min
15
舒于亠仍 仂从亳仆 General R&D, 2017
ads7830 sysfs interface
# ls /sys/class/hwmon/hwmon2/
device in1_input in3_input in5_input in7_input subsystem
in0_input in2_input in4_input in6_input name uevent
16
舒于亠仍 仂从亳仆 General R&D, 2017
Checkpoint 1
仄亠亠仄:
 仂亰仄仂亢仆仂 仆舒舒亳于舒 亳 亳亰仄亠
 仂仍仆亶 亟仂仗 从 亳仗舒仄 仗仂 i2c
 仆亢仆仂:
 舒 仄仆亠仄仂仆亳亠从亳亠 仆舒亰于舒仆亳
 仂仆于亠亳仂于舒 仗仂仗亞舒亠于 于 仂仍 亳 亞舒亟
 舒仂亳 仗亠亟亠仍
 舒仂亳 舒于仂仄舒亳亠从仂亠 仗舒于仍亠仆亳亠 于亠仆亳仍仂舒仄亳
17
舒于亠仍 仂从亳仆 General R&D, 2017
sensors 弍亠亰 从仂仆亳亞舒
# sensors
adt7463-i2c-0-2d
Adapter: Synopsys DesignWare I2C adapter
in0: +0.00 V (min = +0.00 V, max = +3.32 V) ALARM
in1: +0.01 V (min = +0.00 V, max = +2.99 V) ALARM
in2: +3.30 V (min = +2.97 V, max = +3.63 V)
in3: +0.00 V (min = +4.50 V, max = +5.50 V) ALARM
in4: +0.00 V (min = +0.00 V, max = +15.94 V) ALARM
fan1: 15000 RPM (min = 0 RPM)
fan2: 15000 RPM (min = 0 RPM)
fan3: 0 RPM (min = 0 RPM)
fan4: 15000 RPM (min = 0 RPM)
temp1: +32.0 C (low = +5.0 C, high = +50.0 C)
temp2: +34.5 C (low = +5.0 C, high = +50.0 C)
temp3: +63.0 C (low = +5.0 C, high = +85.0 C)
cpu0_vid: +0.000 V
18
舒于亠仍 仂从亳仆 General R&D, 2017
仂仆亳亞亳亠仄 sensors
 舒舒仍仂亞 亟仍 从仂仆亳亞仂于 /etc/sensors.d/
 仂亢仆仂:
 舒亰仆舒亳 alias
 舒仂亳 min/max
 舒亠仄舒亳亠从亳亠 仂仗亠舒亳亳
 亞仆仂亳仂于舒 仗仂仍
 sensors -s 仗亳仄亠仆磳 仆舒仂亶从亳
19
舒于亠仍 仂从亳仆 General R&D, 2017
sensors c 从仂仆亳亞舒亳亠亶
# sensors
adt7463-i2c-0-2d
Adapter: Synopsys DesignWare I2C adapter
3.3V: +3.30 V (min = +2.97 V, max = +3.63 V)
PSB1FAN: 15000 RPM (min = 0 RPM)
PSB0FAN: 15000 RPM (min = 0 RPM)
CHTEMP: +32.0 C (low = +5.0 C, high = +50.0 C)
INTTEMP: +34.5 C (low = +5.0 C, high = +50.0 C)
SOMTEMP: +62.0 C (low = +5.0 C, high = +85.0 C)
ads7830-i2c-0-48
Adapter: Synopsys DesignWare I2C adapter
PSB0TEMP: -1.87 V
PSB1TEMP: +39.69 V
3V3: +3.32 V
5V: +4.98 V
PSB0VIN: +5.74 V
PSB1VIN: +12.19 V
SYS12V: +12.07 V
20
舒于亠仍 仂从亳仆 General R&D, 2017
 从仂 弍亟亠 仗舒于仍 于亠仆亳仍仂舒仄亳?
# export DEVPATH=/sys/class/hwmon/hwmon1
# echo 1 > $DEVPATH/pwm1_auto_channels
# echo 0 > $DEVPATH/pwm1_auto_pwm_min
# echo 20000 > $DEVPATH/temp1_auto_temp_min
# echo 19000 > $DEVPATH/temp1_auto_temp_off
# echo 35000 > $DEVPATH/temp1_auto_temp_max
pwm1 舒弍仂舒亠 仂 仗亠于仂亞仂 从舒仆舒仍舒
亳亰仄亠亠仆亳 亠仄仗亠舒
亳 仆亳亰从仂亶 亠仄仗亠舒亠 于亠仆亳仍仂
仆亠 从
舒舒亳于舒亠仄 亞舒仆亳
亠仄仗亠舒仆仂亞仂 亟亳舒仗舒亰仂仆舒
21
舒于亠仍 仂从亳仆 General R&D, 2017
ミ夷術 (亞舒弍仍亳)
 亳 亟于仗仂于仂亟仆仂仄 仗仂亟从仍ム亠仆亳亳 于亠仆亳仍仂仂于 PID-亠亞仍仂 舒弍仂舒
仆亠 弍亟亠
 丐亠弍亠 仆舒 仆舒仂亶从舒 (i2cget/i2cset)
 丐仂仆仂 亳亰仄亠亠仆亳 仆亳亰从舒
22
舒于亠仍 仂从亳仆 General R&D, 2017
仂亞仂
 弍亳舒亠仄 亳仗
 舒仂亟亳仄 亠亞仂 于 Documentation/hwmon
 仂仗亳于舒亠仄 于 device-tree
 舒仂亟亳仄 仆舒 亳仆亠 i2c
 舒亞亢舒亠仄 仄仂亟仍
 仂仆亳亞亳亠仄 sensors
 舒舒亳于舒亠仄 亠亠亰 sysfs 仗舒于仍亠仆亳亠 于亠仆亳仍仂舒仄亳
23
舒于亠仍 仂从亳仆 General R&D, 2017
弌仍从亳
 https://www.kernel.org/doc/Documentation/hwmon/
 https://www.onsemi.com/pub/Collateral/ADT7463-D.PDF
 http://www.ti.com/lit/ds/symlink/ads7830.pdf
24

More Related Content

lm-sensors in embedded systems: from schematics to management from linux

  • 1. 舒于亠仍 仂从亳仆 General R&D, 2017 lm-sensors 于 embedded 亠仄仂亠仆亳从亳 亟仂 仗舒于仍亠仆亳 于 linux LM -- Linux Monitoring
  • 2. 舒于亠仍 仂从亳仆 General R&D, 2017 仄 仗仂亶亟 亠? 舒从 仗仂弍仍亠仄 亠舒亠仄 弌亠仄舒, 舒亳亠从舒 丼亳仗 亠仆仂舒 于 device-tree 亠亠从亳仄 亳仗 亠仆仂舒 于 linux hwmon userspace-亳仆亠亠亶 仂仆亳亞亳亠仄 sensors 仂仆亳亞亳亠仄 仗舒于仍亠仆亳亠 于亠仆亳仍仂舒仄亳 亠仄仂 仆舒 亢亳于仂仄 仂亶于亠 2
  • 3. 舒于亠仍 仂从亳仆 General R&D, 2017 舒从 亰舒亟舒 亠舒亠仄? 仂仆亳仂亳仆亞 仆舒仗礀亠仆亳亶 仆舒 仗仍舒亠 (3.3 , 2.5 , 5 ) 仂仆亳仂亳仆亞 仆舒仗礀亠仆亳亶 (12 ) 仂仆亳仂亳仆亞 亠仄仗亠舒 (仗仂亠仂, , 亠亟仆亠亠) 于仂仄舒亳亠从仂亠 仗舒于仍亠仆亳亠 于亠仆亳仍仂舒仄亳 亢亠仆 从仂仆仂仍 仗仂亟亳亠仄 亳亰 linux! 3
  • 4. 舒于亠仍 仂从亳仆 General R&D, 2017 仍仂从-亠仄舒 仂亶于舒 4
  • 5. 舒于亠仍 仂从亳仆 General R&D, 2017 仂仄仗仂仆亠仆 亠仄 adt7463 -- 舒仆舒仍仂亞 National lm85 ads7830 -- 仄仆仂亞仂从舒仆舒仍仆亶 丶 丐亠仄仗亠舒仆亠 亠仆仂: 2N3906 亳 NTC-亠仄亳仂 AC/DC -- 舒亟舒仗亠 ~220V 于 12V Power supply -- 亳仂仆亳从亳 仗亳舒仆亳 5
  • 6. 舒于亠仍 仂从亳仆 General R&D, 2017 adt7463 弌亠仄仂亠仆亳从舒: 仂仆亳仂亳仆亞 仆舒仗礀亠仆亳亶 亳 亠仄仗亠舒 于仂仆仂仄仆仂亠 仗舒于仍亠仆亳亠 于亠仆亳仍仂舒仄亳 https://www.onsemi.com/pub/Collateral/ADT7463-D.PDF Linux: https://www.kernel.org/doc/Documentation/hwmon/lm85 modprobe lm85 6
  • 7. 舒于亠仍 仂从亳仆 General R&D, 2017 ads7830 弌亠仄仂亠仆亳从舒: 仂仆亳仂亳仆亞 仆舒仗礀亠仆亳亶 8-仄亳 从舒仆舒仍仆亶 丶 (8 弍亳) http://www.ti.com/lit/ds/symlink/ads7830.pdf Linux: modprobe ads7828 https://www.kernel.org/doc/Documentation/hwmon/ads7828 7
  • 8. 舒于亠仍 仂从亳仆 General R&D, 2017 舒亞亰从舒 Linux 仆舒 SoC 1. 亠于亳仆亶 亰舒亞亰亳从 (preloader) 2. 仂亳仆亶 亰舒亞亰亳从 (u-boot) 3. Linux kernel 4. init/systemd 亢亠仆 从仂亠从仆亶 device-tree 8
  • 9. 舒于亠仍 仂从亳仆 General R&D, 2017 仂弍舒于仍磳仄 亳仗 于 device-tree lm85@2d { compatible = "national,adt7463"; reg = <0x2d>; status = "okay"; }; adc@48 { compatible = "at,ads7830"; reg = <0x48>; status = "okay"; }; 仂亟亟亠亢亳于舒亠 仄仂亟仍亠仄 ads7828.ko ~$ /sbin/modinfo ads7828 | grep ads7830 alias: i2c:ads7830 仂亟亟亠亢亳于舒亠 仄仂亟仍亠仄 lm85.ko ~$ /sbin/modinfo lm85 | grep adt7463 alias: i2c:adt7463 9
  • 10. 舒于亠仍 仂从亳仆 General R&D, 2017 仆仄亠仆 亟仍 i2c apt-get install i2c-tools 丼亠仆亳亠-亰舒仗亳 亠亞亳仂于: i2cget, i2cset 弌从舒仆亳仂于舒仆亳亠 亳仆: i2cdetect, i2cdump 10
  • 11. 舒于亠仍 仂从亳仆 General R&D, 2017 亠弍舒亢亳仄 i2c # i2cdetect -r 0 ... 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- 0c -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- UU -- -- -- -- -- 2d 2e -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- UU -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- -- 亳仗仂仍亰亠 亟舒亶于亠仂仄 仆亠 亳仗仂仍亰亠 亟舒亶于亠仂仄 11
  • 12. 舒于亠仍 仂从亳仆 General R&D, 2017 舒亞亢舒亠仄 仄仂亟仍亳 # modprobe lm85 # modprobe ads7828 # i2cdetect -r 0 ... 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- 0c -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- UU -- -- -- -- -- UU UU -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- UU -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- -- 12
  • 13. 舒于亠仍 仂从亳仆 General R&D, 2017 hwmon Documentation/hwmon /sys/class/hwmon Documentation/hwmon/sysfs-interface 13
  • 14. 舒于亠仍 仂从亳仆 General R&D, 2017 hwmon sysfs interface 舒仗礀亠仆亳亠 丐仂从 仂仆仂 丐亠仄仗亠舒舒 仂亢亠仆亳亠 弍仂仂 于亠仆亳仍仂仂于 PWM 仂亢仆仂 亳仗仂仍亰仂于舒 弍亠亰 sensors Documentation/hwmon/sysfs-interface 舒 仍舒亶 14
  • 15. 舒于亠仍 仂从亳仆 General R&D, 2017 adt7463 sysfs contents # ls /sys/class/hwmon/hwmon1/ alarms in0_max in4_min pwm3_auto_pwm_minctl temp2_auto_temp_off cpu0_vid in0_min name pwm3_enable temp2_input device in1_alarm pwm1 pwm3_freq temp2_max fan1_alarm in1_input pwm1_auto_channels subsystem temp2_min fan1_input in1_max pwm1_auto_pwm_min temp1_alarm temp3_alarm fan1_min in1_min pwm1_auto_pwm_minctl temp1_auto_temp_crit temp3_auto_temp_crit fan2_alarm in2_alarm pwm1_enable temp1_auto_temp_max temp3_auto_temp_max fan2_input in2_input pwm1_freq temp1_auto_temp_min temp3_auto_temp_min fan2_min in2_max pwm2 temp1_auto_temp_off temp3_auto_temp_off fan3_alarm in2_min pwm2_auto_channels temp1_fault temp3_fault fan3_input in3_alarm pwm2_auto_pwm_min temp1_input temp3_input fan3_min in3_input pwm2_auto_pwm_minctl temp1_max temp3_max fan4_alarm in3_max pwm2_enable temp1_min temp3_min fan4_input in3_min pwm2_freq temp2_alarm uevent fan4_min in4_alarm pwm3 temp2_auto_temp_crit vrm in0_alarm in4_input pwm3_auto_channels temp2_auto_temp_max in0_input in4_max pwm3_auto_pwm_min temp2_auto_temp_min 15
  • 16. 舒于亠仍 仂从亳仆 General R&D, 2017 ads7830 sysfs interface # ls /sys/class/hwmon/hwmon2/ device in1_input in3_input in5_input in7_input subsystem in0_input in2_input in4_input in6_input name uevent 16
  • 17. 舒于亠仍 仂从亳仆 General R&D, 2017 Checkpoint 1 仄亠亠仄: 仂亰仄仂亢仆仂 仆舒舒亳于舒 亳 亳亰仄亠 仂仍仆亶 亟仂仗 从 亳仗舒仄 仗仂 i2c 仆亢仆仂: 舒 仄仆亠仄仂仆亳亠从亳亠 仆舒亰于舒仆亳 仂仆于亠亳仂于舒 仗仂仗亞舒亠于 于 仂仍 亳 亞舒亟 舒仂亳 仗亠亟亠仍 舒仂亳 舒于仂仄舒亳亠从仂亠 仗舒于仍亠仆亳亠 于亠仆亳仍仂舒仄亳 17
  • 18. 舒于亠仍 仂从亳仆 General R&D, 2017 sensors 弍亠亰 从仂仆亳亞舒 # sensors adt7463-i2c-0-2d Adapter: Synopsys DesignWare I2C adapter in0: +0.00 V (min = +0.00 V, max = +3.32 V) ALARM in1: +0.01 V (min = +0.00 V, max = +2.99 V) ALARM in2: +3.30 V (min = +2.97 V, max = +3.63 V) in3: +0.00 V (min = +4.50 V, max = +5.50 V) ALARM in4: +0.00 V (min = +0.00 V, max = +15.94 V) ALARM fan1: 15000 RPM (min = 0 RPM) fan2: 15000 RPM (min = 0 RPM) fan3: 0 RPM (min = 0 RPM) fan4: 15000 RPM (min = 0 RPM) temp1: +32.0 C (low = +5.0 C, high = +50.0 C) temp2: +34.5 C (low = +5.0 C, high = +50.0 C) temp3: +63.0 C (low = +5.0 C, high = +85.0 C) cpu0_vid: +0.000 V 18
  • 19. 舒于亠仍 仂从亳仆 General R&D, 2017 仂仆亳亞亳亠仄 sensors 舒舒仍仂亞 亟仍 从仂仆亳亞仂于 /etc/sensors.d/ 仂亢仆仂: 舒亰仆舒亳 alias 舒仂亳 min/max 舒亠仄舒亳亠从亳亠 仂仗亠舒亳亳 亞仆仂亳仂于舒 仗仂仍 sensors -s 仗亳仄亠仆磳 仆舒仂亶从亳 19
  • 20. 舒于亠仍 仂从亳仆 General R&D, 2017 sensors c 从仂仆亳亞舒亳亠亶 # sensors adt7463-i2c-0-2d Adapter: Synopsys DesignWare I2C adapter 3.3V: +3.30 V (min = +2.97 V, max = +3.63 V) PSB1FAN: 15000 RPM (min = 0 RPM) PSB0FAN: 15000 RPM (min = 0 RPM) CHTEMP: +32.0 C (low = +5.0 C, high = +50.0 C) INTTEMP: +34.5 C (low = +5.0 C, high = +50.0 C) SOMTEMP: +62.0 C (low = +5.0 C, high = +85.0 C) ads7830-i2c-0-48 Adapter: Synopsys DesignWare I2C adapter PSB0TEMP: -1.87 V PSB1TEMP: +39.69 V 3V3: +3.32 V 5V: +4.98 V PSB0VIN: +5.74 V PSB1VIN: +12.19 V SYS12V: +12.07 V 20
  • 21. 舒于亠仍 仂从亳仆 General R&D, 2017 从仂 弍亟亠 仗舒于仍 于亠仆亳仍仂舒仄亳? # export DEVPATH=/sys/class/hwmon/hwmon1 # echo 1 > $DEVPATH/pwm1_auto_channels # echo 0 > $DEVPATH/pwm1_auto_pwm_min # echo 20000 > $DEVPATH/temp1_auto_temp_min # echo 19000 > $DEVPATH/temp1_auto_temp_off # echo 35000 > $DEVPATH/temp1_auto_temp_max pwm1 舒弍仂舒亠 仂 仗亠于仂亞仂 从舒仆舒仍舒 亳亰仄亠亠仆亳 亠仄仗亠舒 亳 仆亳亰从仂亶 亠仄仗亠舒亠 于亠仆亳仍仂 仆亠 从 舒舒亳于舒亠仄 亞舒仆亳 亠仄仗亠舒仆仂亞仂 亟亳舒仗舒亰仂仆舒 21
  • 22. 舒于亠仍 仂从亳仆 General R&D, 2017 ミ夷術 (亞舒弍仍亳) 亳 亟于仗仂于仂亟仆仂仄 仗仂亟从仍ム亠仆亳亳 于亠仆亳仍仂仂于 PID-亠亞仍仂 舒弍仂舒 仆亠 弍亟亠 丐亠弍亠 仆舒 仆舒仂亶从舒 (i2cget/i2cset) 丐仂仆仂 亳亰仄亠亠仆亳 仆亳亰从舒 22
  • 23. 舒于亠仍 仂从亳仆 General R&D, 2017 仂亞仂 弍亳舒亠仄 亳仗 舒仂亟亳仄 亠亞仂 于 Documentation/hwmon 仂仗亳于舒亠仄 于 device-tree 舒仂亟亳仄 仆舒 亳仆亠 i2c 舒亞亢舒亠仄 仄仂亟仍 仂仆亳亞亳亠仄 sensors 舒舒亳于舒亠仄 亠亠亰 sysfs 仗舒于仍亠仆亳亠 于亠仆亳仍仂舒仄亳 23
  • 24. 舒于亠仍 仂从亳仆 General R&D, 2017 弌仍从亳 https://www.kernel.org/doc/Documentation/hwmon/ https://www.onsemi.com/pub/Collateral/ADT7463-D.PDF http://www.ti.com/lit/ds/symlink/ads7830.pdf 24