sam452
Posts: 9
Joined: Sat Apr 26, 2014 8:55 pm

Could not open file `/dev/i2c-1'

Mon Nov 09, 2015 2:17 am

I'm another person struggling to get past this error as I have added a board for my future weather station using this device on my A+ running Raspian.

http://www.switchdoc.com/weatherpiarduino-bare-board

I've been told that I've set up the hardware correctly but I'm getting the error and have spent the weekend researching this board and others on getting past this error.
I can say I've enabled i2c because it's set in raspi-connect, have successfully added a ds321 module and the following can be found in my /boot/config.txt

Code: Select all

dtparam=spi=on
dtparam=i2c_arm=on
Among other things, running lsmod yields:
i2c_bcm2708 6252 0
spi_bcm2835 7948 0
bcm2835_gpiomem 3703 0

uname -a
Linux weather3 4.1.12+ #825 PREEMPT Fri Nov 6 17:53:21 GMT 2015 armv6l GNU/Linux

Reading up on device-tree, it was suggested that I add the below to /boot/config.txt

Code: Select all

device_tree=bcm2708-rpi-b-plus.dtb
device_tree_param=i2c1=on
device_tree_param=spi=on
Here is the contents of my /boot/cmdline.txt

Code: Select all

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait bcm2708.vc_i2c_override=1
/etc/modprobe.d/raspi-blacklist.conf
is an empty file
I've done a bunch of restarting, testing, isolating but clearly am overlooking something. Pls help me see what I'm not seeing, thx, sam

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

Re: Could not open file `/dev/i2c-1'

Mon Nov 09, 2015 9:27 am

Does lsmod show i2c-dev?

If it doesn't enter the command "sudo modprobe i2c-dev" and then retry your I2C commands.

For a permanent fix add the line i2c-dev to /etc/modules.

sam452
Posts: 9
Joined: Sat Apr 26, 2014 8:55 pm

Re: Could not open file `/dev/i2c-1' [SOLVED]

Mon Nov 09, 2015 2:30 pm

Yes, thank you Joan that's the magic key. And thanks for posting on how to make it permanent!

Return to “Troubleshooting”