i2cget
Read I2C device register value
TLDR
Read from a register of an I2C device
Read from a register of an I2C device without asking for confirmation
Read from a register of an I2C device using a specific mode
SYNOPSIS
i2cget [-f] [-y] [-V] [--help] I2CBUS CHIP-ADDRESS [DATA-ADDRESS] [MODE]
PARAMETERS
-f, --force
Force access even if adapter driver reports unsupported method (use cautiously).
-y, --yes
Skip interactive prompt; send read request immediately.
-V, --version
Print version information and exit.
--help
Display help summary and exit.
DESCRIPTION
i2cget is a utility from the i2c-tools package used to read bytes, words, or blocks from registers on I2C or SMBus slave devices connected to a Linux system's I2C bus. It is essential for hardware debugging, sensor monitoring, EEPROM reading, and development on embedded platforms like Raspberry Pi or industrial controllers.
The command targets a specific bus (e.g., 1 for /dev/i2c-1), slave chip address (e.g., 0x48), optional register address (defaults to 0x00), and read mode. It performs a combined write-then-read operation by default: writes the register address then reads the data. Interactive mode prompts for confirmation unless disabled.
Common use cases include querying temperature sensors (e.g., BMP280 at 0x76), RTC chips, or PMICs. Output is in hexadecimal with '0x' prefix. Requires kernel I2C support and device tree or module loading for buses. Typically run as root or i2c group member for /dev/i2c-* access.
This tool provides quick, userspace access without custom kernel modules or programming, aiding rapid prototyping and troubleshooting.
CAVEATS
Requires root or 'i2c' group access to /dev/i2c-* devices. Wrong addresses may corrupt hardware or data. Not all adapters support all modes; -f risks errors. Interactive mode prevents accidents on multi-user systems.
MODES
b (default): byte read with register set.
w: word read with register set.
i: I2C block read.
s: SMBus block read.
c: byte read with PEC (error checking).
EXAMPLES
Read default byte: i2cget -y 1 0x48
Read register 0x04 as word: i2cget -y 1 0x48 0x04 w
SMBus block: i2cget -f -y 0 0x76 s
HISTORY
Developed as part of i2c-tools by Frodo Looijaard and Mark D. Studebaker (~2001); maintained by Jean Delvare since 2007. Integrated into lm-sensors project, now standard in most Linux distros for I2C/SMBus support.


