windell747
Posts: 8
Joined: Fri Nov 13, 2015 3:21 am

setting up i2c on raspberry pi B+

Wed Jan 13, 2016 2:13 am

I followed the instructions here

https://www.youtube.com/watch?v=FloRfIeuEoE

and when I run

sudo i2cdetect -y 0

I get

Error: Could not open file '/dev/i2c-0' or 'dev.i2c/0': No such file or directory

I get the same thing when I run
sudo i2cdetect -y 1

I'm not sure what I could be doing wrong. Any hints?


windell747
Posts: 8
Joined: Fri Nov 13, 2015 3:21 am

Re: setting up i2c on raspberry pi B+

Fri Jan 15, 2016 2:45 am

I ran through all the steps on that page including the double-check step and i2cdetect still doesn't work. Is there anything else that I can do to troubleshoot?

W. H. Heydt
Posts: 12784
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: setting up i2c on raspberry pi B+

Fri Jan 15, 2016 3:06 am

Did you go into raspi-config and enable I2C? Under Jessie, you can use the graphical wrapper to do so.

windell747
Posts: 8
Joined: Fri Nov 13, 2015 3:21 am

Re: setting up i2c on raspberry pi B+

Fri Jan 15, 2016 3:44 am

Yup have done all those steps. I even reinstalled the os to try it again.

User avatar
joan
Posts: 14960
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: setting up i2c on raspberry pi B+

Fri Jan 15, 2016 11:46 am

Could you give the result of the following commands?

Code: Select all

uname -a

cat /etc/os-release

grep i2c /boot/config.txt

grep i2c /etc/modules

windell747
Posts: 8
Joined: Fri Nov 13, 2015 3:21 am

Re: setting up i2c on raspberry pi B+

Fri Jan 15, 2016 6:53 pm

Thanks fellow RPiers. Here you go!

Code: Select all

pi@raspberrypi ~ $ uname -a
Linux raspberrypi 3.18.7+ #755 PREEMPT Thu Feb 12 17:14:31 GMT 2015 armv6l GNU/Linux
pi@raspberrypi ~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 7 (wheezy)"
NAME="Raspbian GNU/Linux"
VERSION_ID="7"
VERSION="7 (wheezy)"
ID=raspbian
ID_LIKE=debian
ANSI_COLOR="1;31"
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
pi@raspberrypi ~ $ grep i2c /boot/config.txt
dtparam=i2c1=on
dtparam=i2c_arm=on
pi@raspberrypi ~ $ grep i2c /etc/modules
i2c-bcm2708
i2c-dev
pi@raspberrypi ~ $

User avatar
joan
Posts: 14960
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: setting up i2c on raspberry pi B+

Fri Jan 15, 2016 8:32 pm

Remove i2c-bcm2708 from /etc/modules.

User avatar
DougieLawson
Posts: 39301
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: setting up i2c on raspberry pi B+

Fri Jan 15, 2016 8:51 pm

Can you post your whole /boot/config.txt (drop any comment # lines)?
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

windell747
Posts: 8
Joined: Fri Nov 13, 2015 3:21 am

Re: setting up i2c on raspberry pi B+

Sat Jan 16, 2016 2:04 am

I commented out the i2c-bcm2708 from /etc/modules, but still doesn't work.

Here is my /boot/config.txt ...

Code: Select all

dtparam=i2c1=on
dtparam=i2c_arm=on

User avatar
DougieLawson
Posts: 39301
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: setting up i2c on raspberry pi B+

Sat Jan 16, 2016 9:51 am

Is that the complete config.txt or is there anything else in it? Are you sure that's the one your system is using (if you're using NOOBS it may not be)?

Remove

Code: Select all

dtparam=i2c1=on
you don't need that.

What does an lsmod # that's ell, ess, emm, oh, dee command show?
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

windell747
Posts: 8
Joined: Fri Nov 13, 2015 3:21 am

Re: setting up i2c on raspberry pi B+

Tue Jan 19, 2016 10:24 pm

Thanks a lot for helping!

Responding inline:

Is that the complete config.txt or is there anything else in it?
Just went to the file in nano and it looks like that is the complete file.

Are you sure that's the one your system is using (if you're using NOOBS it may not be)?
I'm not sure how to check to make sure that the OS is using this file.

Remove
CODE: SELECT ALL
dtparam=i2c1=on
you don't need that.

Just did this and rebooted. Same behavior.


What does an lsmod # that's ell, ess, emm, oh, dee command show?

Here you go:

Code: Select all

pi@raspberrypi ~ $ lsmod
Module                  Size  Used by
i2c_dev                 6709  0 
evdev                  11000  6 
uio_pdrv_genirq         3666  0 
uio                     9897  1 uio_pdrv_genirq

User avatar
joan
Posts: 14960
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: setting up i2c on raspberry pi B+

Tue Jan 19, 2016 10:59 pm

You are running an old kernel (3.18.7). This was around the time device tree was introduced. Unless you have a reason not to I'd update to a more recent (4.x) kernel with sudo rpi-update.

Return to “Beginners”