1.
Kod: Markera allt
sudo apt-get install lm-sensors
a. Kopiera raderna under, och lägg in det i valfri editor, döp filen till mkdev.sh
Kod: Markera allt
#!/bin/bash
# Here you can set several defaults.
# The number of devices to create (max: 256)
NUMBER=32
# The owner and group of the devices
OUSER=root
OGROUP=root
# The mode of the devices
MODE=600
# This script doesn't need to be run if devfs is used
if [ -r /proc/mounts ] ; then
if grep -q "/dev devfs" /proc/mounts ; then
echo "You do not need to run this script as your system uses devfs."
exit;
fi
fi
i=0;
while [ $i -lt $NUMBER ] ; do
echo /dev/i2c-$i
mknod -m $MODE /dev/i2c-$i c 89 $i || exit
chown "$OUSER:$OGROUP" /dev/i2c-$i || exit
i=$[$i + 1]
done
#end of file
b. Gör scriptet körbart
Kod: Markera allt
chmod 755 mkdev.sh
Kör scriptet från där det ligger (I mitt fall (/home/gholen/system/ blir det alltså
Kod: Markera allt
cd /home/gholen/system/ && sudo ./mkdev.sh
Nu ska vi köra kommandot sensors-detect och svara YES på ALLA YES/no frågor.
Kod: Markera allt
sudo sensors-detect
Efter att det har kört klart, en lista av moduler som behöver laddas blir nu synlig.
Under är ett resultat av sensors-detect:
#******************************************************************************
To make the sensors modules behave correctly, add these lines to
/etc/modules:
#----cut here----
# I2C adapter drivers
i2c-viapro
i2c-isa
# I2C chip drivers
eeprom
it87
#----cut here----
Then, run /etc/init.d/module-init-tools
To make the sensors modules behave correctly, add these lines to
/etc/modprobe.d/local and run update-modules:
#----cut here----
# I2C module options
alias char-major-89 i2c-dev
#----cut here----
#************************************************* *******************************
4. I detta exempel, lägger vi till modelerna i OMVÄND ordning i /etc/modules
exempelfil:
Kod: Markera allt
#************************************************* ***********************
# /etc/modules: kernel modules to load at boot time.
#
# This file should contain the names of kernel modules that are
# to be loaded at boot time, one per line. Comments begin with
# a "#", and everything on the line after them are ignored.
psmouse
mousedev
ide-cd
ide-disk
ide-generic
lp
#For lm-sensors, i2c modules
it87
i2c-viapro
i2c-isa
#end of file!
#************************************************* ****************
Nu laddar vi modulerna MANUELLT med hjälp av modprobe och att uppdatera beroenden.
Kod: Markera allt
sudo modprobe i2c-sensor
sudo modprobe i2c-viapro
sudo modprobe i2c-isa
sudo modprobe it87
Kod: Markera allt
sudo depmod -a
Kod: Markera allt
sudo update-modules
Nu testar vi att köra kommadot "sensors"
Kod: Markera allt
sensors
Kod: Markera allt
************************************************** *****************
it87-isa-0290
Adapter: ISA adapter
VCore 1: +1.57 V (min = +1.42 V, max = +1.57 V) ALARM
VCore 2: +2.66 V (min = +2.40 V, max = +2.61 V) ALARM
+3.3V: +6.59 V (min = +3.14 V, max = +3.46 V) ALARM
+5V: +5.11 V (min = +4.76 V, max = +5.24 V)
+12V: +11.78 V (min = +11.39 V, max = +12.61 V)
-12V: -19.14 V (min = -12.63 V, max = -11.41 V) ALARM
-5V: +0.77 V (min = -5.26 V, max = -4.77 V) ALARM
Stdby: +5.00 V (min = +4.76 V, max = +5.24 V)
VBat: +3.12 V
fan1: 3668 RPM (min = 0 RPM, div =
fan2: 0 RPM (min = 664 RPM, div = ALARM
fan3: 0 RPM (min = 2657 RPM, div = 2) ALARM
M/B Temp: +39°C (low = +15°C, high = +40°C) sensor = thermistor
CPU Temp: +36°C (low = +15°C, high = +45°C) sensor = thermistor
Temp3: +96°C (low = +15°C, high = +45°C) sensor = diode
************************************************** ********************
8. Uppgifter om sensorerna kan bli trimmade genom att redigera /etc/sensorns.conf filen. För mer info om det, referera till man sensors.conf
/gholen