Saturday, 20 May 2017

BM280, Raspberry PI, I2C, "i2cdetect -y 1": No such file or directory

When following this article to set up a temperature sensor on my Raspbery Pi, I had to do a couple of additional steps:

1. Configure I2C on the Pi. I did this by following this article and using raspbi-config and the advanced settings to enable I2C.

2. When running the command to check the I2C interface, I executed
i2cdetect -y 1

This returned "No such file or directory".

This required the following to be added to /etc/modules and reboot

i2c-bcm2708
i2c-dev

3. After this "i2cdetect -y 1" was working, but not detecting any hardware. (It show 77 in the list somewhere).

The next step was because the boot needed to configure some hardware pins.

https://learn.adafruit.com/adafruits-raspberry-pi-lesson-4-gpio-setup/configuring-i2c

If you are running a recent Raspberry Pi (3.18 kernel or higher) you will also need to update the /boot/config.txt file. Edit it with sudo nano /boot/config.txt and add the text
dtparam=i2c1=on
dtparam=i2c_arm=on
at the bottom. note that the "1" in "i2c1" is a one not an L!

4. This still didn't fix it.

I was running on kernel 3.18.

I did a
apt-get dist-upgrade

https://raspberrypi.stackexchange.com/questions/27073/firmware-3-18-x-breaks-i%C2%B2c-spi-audio-lirc-1-wire-e-g-dev-i2c-1-no-such-f

and then went back into raspi-config and disabled "Device Tree".

This time I got UU when running i2cdetect.

No comments:

Post a comment