I2c-dev module not found when enabling I2C on Raspberry Pi 3B (kernel 5.15.87-v7+)

Hi all, I’m trying to enable I2C on my Pi 3B using raspi-config but I keep getting this error:

modprobe: FATAL: Module i2c-dev not found in directory /lib/modules/5.15.87-v7+

Has anyone seen this before? I’m not sure what I’m doing wrong.

That error usually means the i2c-dev module isn’t available for the kernel version modprobe is looking at. Can you tell me a bit more about your setup? Which Pi model, what OS, kernel version, and what you have connected to the Pi?

Sure. It’s a Raspberry Pi 3B running OS 11 (bullseye), Python 3.9.2. Kernel is 5.15.84-v7+. I have 5x Arducam Multi Cam board V2.2 with 5MP OV5647 cameras attached.

When I ran:
sudo raspi-config
Interfacing Options
P5 I2C
YES

That’s when I got the modprobe FATAL error.

One thing stands out from your error: it says /lib/modules/5.15.87-v7+ but you mentioned your kernel is 5.15.84-v7+. Those don’t match. Can you run uname -r and also ls /lib/modules so we can see what’s actually there?

Good catch. uname -r shows 5.15.84-v7+. And ls /lib/modules shows a 5.15.87-v7+ directory. So the running kernel is 5.15.84-v7+ but the modules directory is for 5.15.87-v7+. That would explain why modprobe can’t find i2c-dev in the directory it’s checking.

Right, that mismatch is likely a big part of it. But also, since you have the Arducam Multi-Camera board V2.2 attached, that board can interfere with enabling I2C. The first thing I’d try is to remove the camera / Multi-Camera board V2.2 from the Pi, then enable I2C again through raspi-config and see if the error still shows.

I haven’t removed the camera board yet, but I re-ran raspi-config the same way and the exact same FATAL error comes up every time. So the board being attached could be messing with it? The camera board itself seems to be detected fine otherwise.

Yes, the V2.2 board can interfere with the I2C enable process, so the recommended step is to physically detach it first. Then:

sudo raspi-config
Interfacing Options
P5 I2C
YES

Try that with the board removed. If you still get the same modprobe FATAL error after that, I’d suggest contacting Raspberry Pi official support, since the kernel/module directory mismatch (5.15.84-v7+ vs /lib/modules/5.15.87-v7+) may need their input. For getting the Multi-Camera board V2.2 with the OV5647 cameras working, you can also follow the Arducam documentation here: Quick Start Guide for Multi-Camera Adapter Board - Arducam Wiki

To summarize where things stand: the i2c-dev module wasn’t found when enabling I2C via raspi-config, and there’s a kernel version discrepancy between your running kernel (5.15.84-v7+) and the modules directory referenced in the error (/lib/modules/5.15.87-v7+). Both of these could contribute to the modprobe FATAL error. The immediate workaround is to remove the Multi-Camera board V2.2 and re-enable I2C; if the error persists, follow up with Raspberry Pi official support. For the camera setup itself, the Arducam documentation link above is the place to start.