Skip to content
Vasco Craveiro Costa edited this page Jul 6, 2015 · 4 revisions

For use and debug of I2C, you should install i2c-tools (if not done previously on initial configurations). After, you should configure the I2C kernel modules to be loaded on boot, adding the following lines to the end of /etc/modules:

i2c-bcm2708
i2c-dev

On file /etc/modprobe.d/raspi-blacklist.conf you should comment (in case they exist) the following lines:

#blacklist spi-bcm2708
#blacklist i2c-bcm2708

When using an Linux OS with 3.18 kernel or higher (you can check the version using uname -r command), add the following lines (or uncomment them, in case they already exist) to /boot/config.txt:

dtparam=i2c1=on
dtparam=i2c_arm=on

Last, reboot the system (sudo reboot), and if everything was correctly configures, you should be able to test I2C bus by using sudo i2cdetect -y 1 command (which lists the devices on I2C bus, if any is connected).

Reference