i2cdetect -lLists the I²C buses on the system.
Utilities to detect, read and write devices on an I²C bus: i2cdetect, i2cget, i2cset and i2cdump.
sudo apt install i2c-toolsi2cdetect -lLists the I²C buses on the system.
i2cdetect -y 1Scans bus 1 and shows a grid of responding 7-bit addresses. -y skips the confirmation prompt.
i2cdetect -y -r 1Scans with read-byte commands instead of quick-write — safer for some write-sensitive chips.
i2cdetect -F 1Shows what the bus adapter supports.
i2cget -y <bus> <addr> <reg>Reads one register. 0xD0 on a BME280 at 0x76 returns its chip ID (0x60).
Example
i2cget -y 1 0x76 0xD0i2cget -y <bus> <addr> <reg> wReads a 16-bit word. Note the byte order may be swapped relative to the datasheet.
Example
i2cget -y 1 0x48 0x00 wi2cdump -y <bus> <addr>Dumps all 256 registers — on an EEPROM at 0x50 this reads stored data.
Example
i2cdump -y 1 0x50i2cdump -y -r <start>-<end> <bus> <addr>Dumps only a range of registers.
Example
i2cdump -y -r 0x00-0x0F 1 0x68i2cset -y <bus> <addr> <reg> <value>Writes a byte to a register — here, setting all pins of an MCP23017 as outputs.
Example
i2cset -y 1 0x20 0x00 0x00i2cset -y <bus> <addr> <reg> <value> wWrites a 16-bit word.
Example
i2cset -y 1 0x40 0x00 0x1234 wi2ctransfer -y <bus> w<n>@<addr> <bytes> r<m>Combined write-then-read in one transaction — here, setting an EEPROM pointer to 0 and reading 16 bytes.
Example
i2ctransfer -y 1 w1@0x50 0x00 r16Reading and driving Raspberry Pi GPIO pins from the shell using pinctrl and the libgpiod utilities (gpiodetect, gpioget, gpioset).
The Raspberry Pi configuration tool, interactive or scriptable: enable interfaces, set locale, expand storage and tune boot options.
Capture stills and video from Raspberry Pi camera modules with rpicam-still, rpicam-vid and friends (formerly libcamera-*).