Hardware Reference
In-Depth Information
In this output, you can see two readings:
bcm2835_thermal-virtual-0
This is the temperature sensor inside the Broadcom BCM2835 system on chip
at the heart of the Raspberry Pi. It is also the same reading you can get from
vcgencmd , as described in “Measure Temperature” on page 16 .
tmp102-i2c-1-48
This is your TMP102 sensor, reporting for duty.
From this output, you can see that your TMP102 sensor is reporting a lovely temper-
ature of 24.8°C. The high value is the value at which the TMP102 shuts down due to
extreme overheating (160.0°C qualifies).
It also has a hyst value, which refers to “temperature hysteresis limit” (sadly, not Def
Leppard's legendary 1987 album Hysteria ). The hysteresis limit value is the value at
which the sensor reading no longer fluctuates, as it approaches the shutdown tem-
perature.
If you just want to see the TMP102 reading, you just need to pass the lm_sensors “chip
name” for that device as an option. As configured, the TMP102 is tmp102-i2c-1-48
( $sensortype-$bustype-$busnumber-$devicenumber ). If you want to see the values in
Fahrenheit, just pass -f :
$ sensors -f tmp102-i2c-1-48
tmp102-i2c-1-48
Adapter: bcm2708_i2c.1
temp1: +76.5°F (high = +320.0°F, hyst = +302.0°F)
If you want to parse the sensor values directly, you can either use the aforementioned
libsensors library, or you can access the values directly via /sys . /sys/class/i2c-dev/
i2c-1/device/1-0048/ is the device node where you can find the values stored in spe-
cial /sys files. These files represent the values reported from the device driver, and are
updated constantly. If you want to get an updated value, just reopen one of these files:
$ cd /sys/class/i2c-dev/i2c-1/device/1-0048/
$ ls
driver modalias power temp1_input temp1_max_hyst
hwmon name subsystem temp1_max uevent
$ cat temp1_input
23312
To convert that value to Celsius, just divide it by 1,000. If you need to convert it to other
temperature units, refer to “Fun with Math and Science” on page 16 .
Search WWH ::




Custom Search