The hwmon Interface
ESPROS kernel modules may expose an on-chip temperature sensors through the Linux hardware monitoring subsystem (hwmon).
This interface allows system software and monitoring tools to read sensor temperatures using standard Linux mechanisms.
The hwmon interface is read-only and intended for:
thermal monitoring
system diagnostics
health monitoring
integration with monitoring daemons
Overview
Linux hwmon devices appear under:
/sys/class/hwmon/
Each hwmon device is assigned a dynamic directory:
/sys/class/hwmon/hwmonX/
Where X is determined at runtime.
To identify the epc sensor device:
cat /sys/class/hwmon/hwmon*/name
Expected entry like:
epcxxx
Exposed Sensors
The driver exposes four internal temperature sensors from the epc670 device.
Channel |
Label |
|---|---|
0 |
epc670_temp_sensor_0 |
1 |
epc670_temp_sensor_1 |
2 |
epc670_temp_sensor_2 |
2 |
epc670_temp_sensor_3 |
File Layout
Inside the detected hwmon directory:
/sys/class/hwmon/hwmonX/
├── name
├── temp1_input
├── temp1_label
├── temp2_input
├── temp2_label
├── temp3_input
├── temp3_label
├── temp4_input
└── temp4_label
Reading Temperatures
Temperature values are reported in millidegree Celsius.
Reading the temperature of a sensor
cat temp1_input
Example output:
42375
This corresponds to:
42.375 °C
Reading the temperature with labels
paste temp*_label temp*_input
Example output:
epc670_temp_sensor_0 42375
epc670_temp_sensor_1 40122
epc670_temp_sensor_2 38910
epc670_temp_sensor_3 41190
Using lm-sensors
Standard Linux monitoring tools can read the device automatically.
Install:
sudo apt install lm-sensors
Detect sensors:
sudo sensors-detect
Read values:
sensors
Example output:
epc670-i2c-11-3c
Adapter: Synopsys DesignWare I2C adapter
epc670_temp_sensor_0: +42.4°C
epc670_temp_sensor_1: +40.1°C
epc670_temp_sensor_2: +38.9°C
epc670_temp_sensor_3: +41.2°C
Typical Monitoring Workflow
# Find device
cat /sys/class/hwmon/hwmon*/name
# Enter directory (replace hwmonX with your device ID)
cd /sys/class/hwmon/hwmonX
# Read temperatures
cat temp*_input
# Read labeled values
paste temp*_label temp*_input
Notes & Limitations
Values are updated on demand when read
Sensor precision depends on internal calibration
Interface is read-only
hwmon index (hwmonX) may change after reboot
Driver Implementation Notes
The hwmon interface is implemented using:
Linux hwmon subsystem
Standard temperature sensor class
Label exposure via
.read_string()callback
Sensor labels are defined in the driver:
epc670_temp_sensor_0
epc670_temp_sensor_1
epc670_temp_sensor_2
epc670_temp_sensor_3
Troubleshooting
hwmon device entry not present (e.g. /sys/class/hwmon/hwmonX/)
Possible causes:
Driver not loaded
Device Tree overlay not applied
Sensor probe failed
Check:
lsmod | grep epc670
dmesg | grep epc670
Permission denied
Most systems allow read access to hwmon.
If restricted:
sudo cat temp1_input
Or add yourself to the corresponding user group (e.g. i2c, video, …)
Unrealistic temperature readings
May occur if:
Sensor not initialized
Device in standby mode
Temperature registers are not configured properly
Integration with Monitoring Systems
The hwmon interface integrates naturally with:
system health dashboards
embedded watchdog systems
thermal throttling frameworks
data center monitoring stacks
No special APIs are required beyond standard Linux hwmon support.