User avatar
cause4concern
Posts: 27
Joined: Fri Jan 03, 2014 2:27 am
Location: EU

"i2cdetect -y 1": No such file or directory

Tue Apr 15, 2014 10:26 pm

WOW I just finished soldering the adafruit LCD RGB display and mounted it on my little darling pi. I'm 34 years old and haven't soldered one single thing in my life, but I think it wen't well. Would appreciate if i2cdetect worked so I can confirm this though LOL

I have followed the instructions on this page: https://learn.adafruit.com/adafruit-16x ... y-pi/usage
On my card I have raspbian installed and running, everything seems to be working, keyboard, network, ssh (which I'm using right now), etc. But, the instructions say:

Add this to /etc/modules and reboot

Code: Select all

i2c-bcm2708
i2c-dev
These commands went ok, no errors. I also did a sudo apt-get update first, I don't really want to run apt-get upgrade right now, really sh*tty internet connection here and I want to make this work NOW

Code: Select all

sudo apt-get install python-smbus
sudo apt-get install i2c-tools
Then it says, run;

Code: Select all

sudo i2cdetect -y 1
...and I get "Error: Could not open file `/dev/i2c-1' or `/dev/i2c/1': No such file or directory"


Please, why? What am I missing here?


UPDATE WITH ADDED CONFUSION: hehe......

Please follow what is happening:

Code: Select all

root@blackbox:~# sudo i2cdetect
Error: No i2c-bus specified!
Usage: i2cdetect [-y] [-a] [-q|-r] I2CBUS [FIRST LAST]
       i2cdetect -F I2CBUS
       i2cdetect -l
  I2CBUS is an integer or an I2C bus name
  If provided, FIRST and LAST limit the probing range.

Code: Select all

root@blackbox:~# sudo i2cdetect -y 1
Error: Could not open file `/dev/i2c-1' or `/dev/i2c/1': No such file or directory
it seems i2cdetect is installed, but "-y 1" doesn't work!

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: "i2cdetect -y 1": No such file or directory

Tue Apr 15, 2014 10:33 pm

Have you edited /etc/modprobe.d/raspi-blacklist.conf yet??

Richard S.

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5592
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: i2cdetect: No such file or directory

Tue Apr 15, 2014 10:34 pm

cause4concern wrote:WOW I just finished soldering the adafruit LCD RGB display and mounted it on my little darling pi. I'm 34 years old and haven't soldered one single thing in my life, but I think it wen't well. Would appreciate if i2cdetect worked so I can confirm this though LOL
I have followed the instructions on this page: https://learn.adafruit.com/adafruit-16x ... y-pi/usage
On my card I have raspbian installed and running, everything seems to be working, keyboard, network, ssh (which I'm using right now), etc. But, the instructions say:
Add this to /etc/modules and reboot

Code: Select all

i2c-bcm2708
i2c-dev
These commands went ok, no errors. I also did a sudo apt-get update first, I don't really want to run apt-get upgrade right now, really sh*tty internet connection here and I want to make this work NOW

Code: Select all

sudo apt-get install python-smbus
sudo apt-get install i2c-tools
Then it says, run;

Code: Select all

sudo i2cdetect -y 1
...and I get "Error: Could not open file `/dev/i2c-1' or `/dev/i2c/1': No such file or directory"
Please, why? What am I missing here?
Have you removed (# commented out) i2c-bcm2708 from /etc/modprobe.d/raspi-blacklist.conf ?
(As shown here: http://www.cpmspectrepi.webspace.virgin ... _Basic_Kit , after the photo's )
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

User avatar
cause4concern
Posts: 27
Joined: Fri Jan 03, 2014 2:27 am
Location: EU

Re: "i2cdetect -y 1": No such file or directory

Tue Apr 15, 2014 10:35 pm

redhawk wrote:Have you edited /etc/modprobe.d/raspi-blacklist.conf yet??

Richard S.
Good evening Richard, thanks for assisting!

Unfortunately, I don't understand what you mean, at all. The guide didn't mention that one so I don't know what to add! :)

User avatar
cause4concern
Posts: 27
Joined: Fri Jan 03, 2014 2:27 am
Location: EU

Re: i2cdetect: No such file or directory

Tue Apr 15, 2014 10:36 pm

FTrevorGowen wrote: Have you removed (# commented out) i2c-bcm2708 from /etc/modprobe.d/raspi-blacklist.conf ?
(As shown here: http://www.cpmspectrepi.webspace.virgin ... _Basic_Kit , after the photo's )
Trev.
Hi Trev! Ok I haven't removed that, had no idea about that. Will try and I come back and report the results!! :)

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: "i2cdetect -y 1": No such file or directory

Tue Apr 15, 2014 10:37 pm

Edit the file (i.e. sudo nano) and remove the # from both lines, after rebooting i2c should work.

Richard S.

User avatar
cause4concern
Posts: 27
Joined: Fri Jan 03, 2014 2:27 am
Location: EU

Re: "i2cdetect -y 1": No such file or directory

Tue Apr 15, 2014 10:47 pm

Got things going now thanks to you guys, the LCD was detected, we'll see if it actually works .... :D



...I'll be damned, it works. I haven't really used the raspberry pi, it's been collecting alot of dust, but I think we clicked now...

SpectrumX
Posts: 9
Joined: Tue Feb 10, 2015 3:33 pm
Location: Africa

Re: "i2cdetect -y 1": No such file or directory

Fri Mar 20, 2015 8:10 pm

I have the exact error as the original question.

I have edited the black list and tried a lot of other thing but no luck :(

Any ideas?
*Something Cheesy*

DirkS
Posts: 10348
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: "i2cdetect -y 1": No such file or directory

Fri Mar 20, 2015 8:34 pm

SpectrumX wrote:I have the exact error as the original question.

I have edited the black list and tried a lot of other thing but no luck :(

Any ideas?
If you're running on kernel 3.18 (check with command 'uname -a') then you have to activate i2c in config.txt
See http://www.raspberrypi.org/forums/viewt ... 28&t=97314
You can activate i2c in raspi-config.

MonkeymanStones
Posts: 27
Joined: Mon Nov 10, 2014 8:53 pm
Location: Holyoke, MA USA
Contact: Website

Re: "i2cdetect -y 1": No such file or directory

Sat Mar 21, 2015 3:16 am

You may also have an older pi, if so then at the step where the failure occurred instead of a 1 enter a zero:
sudo i2cdetect -y 0

benit2
Posts: 2
Joined: Tue Apr 21, 2015 3:26 am

Re: "i2cdetect -y 1": No such file or directory

Tue Apr 21, 2015 3:40 am

Hi there,
I get the same error as OP, but in my case the file /etc/modprobe.d/raspi-blacklist.conf turned out to be already empty..
This pi is a clean install so everything should still be at default settings.
I'm using a raspberry pi 2, and I've make sure to activate i2c in raspi-config..
I've looked on other forums and the command:

Code: Select all

lsmod | grep i2c
should be returning both i2c-dev and i2c_bcm2708 but I'm only getting i2c_bcm2708. It seems that i2c is not loading at all..
Last edited by benit2 on Tue Apr 21, 2015 4:53 pm, edited 1 time in total.

benit2
Posts: 2
Joined: Tue Apr 21, 2015 3:26 am

Re: "i2cdetect -y 1": No such file or directory

Tue Apr 21, 2015 6:37 am

Actually I came out with the solution visiting this site. What needed to be done after setting raspi-config was to manually edit the modules file:

Code: Select all

sudo nano /etc/modules
then adding the lines:

Code: Select all

i2c-bcm2708
i2c-dev
I'm posting in case others might get the same issue.

5treetmanyx
Posts: 1
Joined: Sat Jun 13, 2015 6:33 am

Re: "i2cdetect -y 1": No such file or directory

Sat Jun 13, 2015 6:43 am

Hello my rpi brothers, i have rpi model 2 and this problem i issue with run "/etc/raspi-config" in "advanced" you must enabled I2C and reboot. now command "sudo modprobe i2c-dev" and finish :). "sudo i2cdetect -y 1" run

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

Re: "i2cdetect -y 1": No such file or directory

Sat Jun 13, 2015 10:07 am

You can avoid the need to use modprobe by adding a line to /etc/modules
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.

ZeroZanzibar
Posts: 22
Joined: Sat Feb 13, 2016 6:13 am

Re: "i2cdetect -y 1": No such file or directory

Sat Feb 13, 2016 6:22 am

OK, I'm new here, but I'm enjoying the Pi overall. Got lots of neat stuff working, Samba, Lighttpd, all good.

But now I'm looking towards having an I2C device or two and I'm struggling with the software side of i2c so far. Have the identical problem at the top of this forum.

I seem to have the drivers, but I have no actual devices yet. I would have thought the P-side "master" would be a bit of a "null" device and would show up without anything attached. But, maybe not.

In any case, here's what I get when I follow the little tutorial:

sudo i2cdetect -y 1
Error: Could not open file `/dev/i2c-1' or `/dev/i2c/1': No such file or directory

and here's what lsmod says:

Code: Select all

Module                  Size  Used by
cfg80211              419759  0
rfkill                 16659  1 cfg80211
snd_bcm2835            19739  0
snd_pcm                74833  1 snd_bcm2835
snd_timer              18164  1 snd_pcm
bcm2835_gpiomem         3023  0
snd                    52116  3 snd_bcm2835,snd_timer,snd_pcm
uio_pdrv_genirq         2966  0
uio                     8228  1 uio_pdrv_genirq
i2c_bcm2708             5014  0
i2c_dev                 6040  0
fuse                   81721  3
ipv6                  341380  42
. . .so it all seems to be there as far as drivers go.

But, as far as /dev goes, not so much:

Code: Select all

ls -l /dev/i*
lrwxrwxrwx 1 root root 25 Dec 31  1969 /dev/initctl -> /run/systemd/initctl/fifo

/dev/input:
total 0

So, apparently, the devices aren't there. Do I have to supply them or is there something more.

The "blacklist" file is empty/nonexistent.

uname -a says:

Code: Select all

Linux mySysName 4.1.13-v7+ #826 SMP PREEMPT Fri Nov 13 20:19:03 GMT 2015 armv7l GNU/Linux
Any ideas as to what to do next?

ZeroZanzibar
Posts: 22
Joined: Sat Feb 13, 2016 6:13 am

Re: "i2cdetect -y 1": No such file or directory

Sat Feb 13, 2016 6:27 am

Answered my own question. Found my way to:

I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

. . .and made sure the i2 stuff was enabled using raspi-config.

Now I get:

Code: Select all

sudo i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
. . . which was something like what I would have expected.

cool_spot
Posts: 1
Joined: Sun Oct 08, 2017 7:41 pm

Re: "i2cdetect -y 1": No such file or directory

Sun Oct 08, 2017 7:43 pm

DirkS wrote:
Fri Mar 20, 2015 8:34 pm
SpectrumX wrote:I have the exact error as the original question.

I have edited the black list and tried a lot of other thing but no luck :(

Any ideas?
If you're running on kernel 3.18 (check with command 'uname -a') then you have to activate i2c in config.txt
See http://www.raspberrypi.org/forums/viewt ... 28&t=97314
You can activate i2c in raspi-config.
this worked for me -- thank you

larboyer
Posts: 1
Joined: Thu Apr 04, 2019 3:19 am

Re: "i2cdetect -y 1": No such file or directory

Thu Apr 04, 2019 3:26 am

I got it working. I'm using a Raspberry Pi 3 B+ 2017 and raspbian stretch.
'uname -a'
yields raspberrypi 4.14.50-v7

I didn't need to edit any blacklist file anymore.

But I did need to enable the i2c interface using raspi-config
'sudo raspi-config'

It's under '5 Interfacing Options'
Then '5 I2C'

Enabled that, and now it works great.
Thanks everyone.

Return to “Beginners”