Hey Mel! I donāt yet have an RPi3, but I was struggling to enable i2c on the RPi2 running Ubuntu MATE 15.10. I just figured it out, and maybe this will work on the RPi3 too.
RPi is trying to move away from the manual loading and configuration of individual modules and toward a system that uses Device Trees, Overlays, and Parameters. The Device Tree catalogs all of the hardware in the system, and Overlays can be applied to a Device Tree to activate a particular functionality, like a camera or an add-on board for a real-time clock. Parameters can be passed into an Overlay to further configure its functionality. The system interprets the Device Tree in the context of the selected Overlays to load and configure the appropriate kernel modules and other resources. In contrast to the āon-unless-blacklistedā approach of manual module management, this system is āon-iff-requestedā and, in my mind, a good fit for the I/O customizability and resource-restricted environment of a single-board computer.
Just like in Raspbian, the base device tree blob (DTB) for the RPi that ships with MATE supports activating the I2C interface by adding a parameter to /boot/config.txt:
dtparam=i2c_arm=on
On reboot, the i2c-bcm2708 kernel moduleāthe driver for the serial controller on the Broadcom BCM2708āis successfully loaded, which you can confirm with lsmod | grep i2c
.
Unfortunately there appears to be a bug (maybe the DTB is bad?) that prevents loading of the i2c-dev
kernel module, which is required to create the /dev/i2c* entry that makes the interface usable. Manually loading that module with sudo modprobe --first-time i2c-dev
is enough to get /dev/i2c-1 to appear on the RPi2 B+. Install i2c-tools with sudo apt-get install i2c-tools
and run i2cdetect -l
and the i2c-1 bus should be listed; probe the i2c-1 bus with i2cdetect 1
with an i2c device installed and you should see the deviceās address on the i2c bus.
Let me know if it works for the RPi3!