Reading DDR4 SDRAM Memory Temperatures on Ubuntu using i2c-tools
In this article, we will discuss how to read the temperature of two DDR4 SDRAM modules on a motherboard using Ubuntu 22.04 and the i2c-tools package. This is a continuation of a previous article where we used HwInfo program on Windows to read the memory temperatures. In this article, we will use command-line tools on Ubuntu to achieve the same result.
Prerequisites
Before we begin, make sure you have the following:
- Ubuntu 22.04 installed on your system
- Two DDR4 SDRAM modules installed on your motherboard
- i2c-tools package installed on your Ubuntu system
Installing the i2c-tools Package
To install the i2c-tools package, open a terminal and enter the following command:
sudo apt-get install i2c-tools
Checking the i2c Bus
To check the available i2c buses on your system, enter the following command:
i2cdetect -l
This will display a list of available i2c buses on your system. Look for the i2c bus that is connected to your memory modules. In most cases, it will be i2c-2 or i2c-3.
Reading the Memory Temperatures
To read the temperature of the memory modules, enter the following command:
i2cget -y [i2c-bus] [memory-address] 0x2f
Replace [i2c-bus] with the i2c bus number that is connected to your memory modules, and [memory-address] with the memory module address. The memory module address is usually 0x2c or 0x2d. The command will return a hexadecimal value, which can be converted to temperature using the following formula:
temperature = (value / 256) - 273.15
For example, if the command returns 0x5b, the temperature can be calculated as follows:
temperature = (0x5b / 256) - 273.15 = 24.375°C
In this article, we have discussed how to read the temperature of two DDR4 SDRAM modules on a motherboard using Ubuntu 22.04 and the i2c-tools package. We have covered the following key concepts:
- Installing the i2c-tools package
- Checking the i2c bus
- Reading the memory temperatures
References
This article includes references to the following types of resources:
- Man pages
- Kernel documentation
This article does not include any references to books or online resources.