0

I'm trying to verify that I2C is enabled on my Pi 3 B.

Here's what I've done so far.

Any help would be greatly appreciated.

$ uname -a
Linux rpi3b2 4.4.38-v7+ #938 SMP Thu Dec 15 15:22:21 GMT 2016 armv7l armv7l armv7l GNU/Linux

$ ls /dev
no i2c devices listed...

$ cat /etc/modules
Linux rpi3b2 4.4.38-v7+ #938 SMP Thu Dec 15 15:22:21 GMT 2016 armv7l armv7l armv7l GNU/Linux

$ cat /boot/config.txt | grep i2c
## i2c_arm
##     Enable the ARM's i2c interface
#dtparam=i2c_arm=on
## i2c_vc
##     Enable the i2c interface
#dtparam=i2c_vc=on
## i2c_arm_baudrate
##     Set the baudrate of the ARM's i2c interface
#dtparam=i2c_arm_baudrate=100000
## i2c_vc_baudrate
##     Set the baudrate of the VideoCore i2c interface

$ lsmod
Module                  Size  Used by
cmac                    2939  2
ecb                     2127  1
rfcomm                 33778  2
bnep                   10340  2
hci_uart               17943  1
btbcm                   5929  1 hci_uart
bluetooth             326105  27 bnep,btbcm,hci_uart,rfcomm
fuse                   84037  3
brcmfmac              186403  0
brcmutil                5661  1 brcmfmac
cfg80211              428431  1 brcmfmac
rfkill                 16037  4 cfg80211,bluetooth
bcm2835_gpiomem         3040  0
bcm2835_wdt             3225  0
uio_pdrv_genirq         3164  0
uio                     8000  1 uio_pdrv_genirq
joydev                  9024  0
evdev                  11396  4
hid_logitech_hidpp     10382  0
hid_logitech_dj        10016  0
snd_bcm2835            20447  1
snd_pcm_oss            37649  0
snd_mixer_oss          14119  1 snd_pcm_oss
snd_seq_dummy           1269  0
snd_pcm                75762  2 snd_bcm2835,snd_pcm_oss
snd_seq_oss            30670  0
snd_seq_midi            4503  0
snd_rawmidi            18516  1 snd_seq_midi
snd_seq_midi_event      5546  2 snd_seq_oss,snd_seq_midi
snd_seq                53119  6 snd_seq_midi_event,snd_seq_oss,snd_seq_dummy,snd_seq_midi
snd_seq_device          3621  4 snd_seq,snd_rawmidi,snd_seq_oss,snd_seq_midi
snd_timer              19288  2 snd_pcm,snd_seq
snd                    51908  11 snd_bcm2835,snd_pcm_oss,snd_timer,snd_pcm,snd_seq,snd_rawmidi,snd_seq_oss,snd_seq_device,snd_mixer_oss
bcm2835_v4l2           38812  0
videobuf2_vmalloc       5187  1 bcm2835_v4l2
videobuf2_memops        1268  1 videobuf2_vmalloc
videobuf2_v4l2         16535  1 bcm2835_v4l2
videobuf2_core         20861  2 bcm2835_v4l2,videobuf2_v4l2
v4l2_common             3929  2 bcm2835_v4l2,videobuf2_v4l2
videodev              132913  4 bcm2835_v4l2,v4l2_common,videobuf2_core,videobuf2_v4l2
media                  11573  1 videodev
-------------------------------
i2c_dev                 5859  0
-------------------------------
ipv6                  347594  58

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

$ i2cdetect -y 5
Error: Could not open file `/dev/i2c-5' or `/dev/i2c/5': No such file or directory
1
  • Don't know why it didn't show in the listing but lsmod does show i2c_dev 5859 0. – Farad'n Apr 22 '18 at 14:36
1

All the I2C entries in /boot/config.txt are commented out (with a # at the start of the line).

Uncomment #dtparam=i2c_arm=on. I.e. change #dtparam=i2c_arm=on to dtparam=i2c_arm=on and then reboot.

1
  • Again, I thank you Joan. A comment is a commentcomment. – Farad'n Apr 22 '18 at 17:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.