Raspberry Pi notes

How to enable/disable/check I2C

sudo raspi-config nonint get_i2c
  • 1 if the port is disabled
  • 0 if the port is enabled

Enabling I2C :

sudo raspi-config nonint do_i2c 0

Disabling I2C :

sudo raspi-config nonint do_i2c 1

Note : nonint means non-interactive

I2C device nodes :

When I2C is enabled on the Raspberry Pi, you will also see a /dev node for it:

ls /dev/i2*

lsmod | grep i2c

Detecting connected devices

sudo i2cdetect -y 1

How to enable/disable/check I2C

sudo raspi-config nonint get_spi

Emable with :

sudo raspi-config nonint do_spi 0