Skip to content
This repository has been archived by the owner on Sep 30, 2019. It is now read-only.

IO Error when trying to get i2c device on Raspberry Pi B+ #34

Closed
cjbuchmann opened this issue Dec 9, 2015 · 1 comment
Closed

IO Error when trying to get i2c device on Raspberry Pi B+ #34

cjbuchmann opened this issue Dec 9, 2015 · 1 comment

Comments

@cjbuchmann
Copy link

I'm having some difficulty connecting to my MCP9808 temperature sensor while using this library.

I had attempted to use the python mcp9808 library https://github.com/adafruit/Adafruit_Python_MCP9808, but kept receiving an IOError from this library. Using the default address specified in that library (https://github.com/adafruit/Adafruit_Python_MCP9808/blob/master/Adafruit_MCP9808/MCP9808.py#L27), I can reproduce these steps in the python console as shown below :

pi@raspberrypi ~ $ python
Python 2.7.3 (default, Mar 18 2014, 05:13:23) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Adafruit_GPIO.I2C as I2C
>>> address=0x18
>>> I2C.get_i2c_device(address)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build/bdist.linux-armv6l/egg/Adafruit_GPIO/I2C.py", line 66, in get_i2c_device
  File "build/bdist.linux-armv6l/egg/Adafruit_GPIO/I2C.py", line 95, in __init__
IOError: [Errno 2] No such file or directory

My platform info is shown as below :

pi@raspberrypi ~/servos $ python
Python 2.7.3 (default, Mar 18 2014, 05:13:23) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Adafruit_GPIO.Platform as Platform
>>> Platform.platform_detect()
1
>>> Platform.pi_revision()
2
>>> 

my pi version is

Linux 4.1.7+ armv6l GNU/Linux

My hardware setup is shown below :

20151208_233919
20151208_233908
20151208_233858
20151208_233844

In my boot/config.txt I have added

dtparam=i2c_arm=on

and enabled I2C via raspi-config.

Is there anything that I'm missing, or could it just be faulty hardware?

@tdicola
Copy link
Contributor

tdicola commented Feb 27, 2018

I'm cleaning up old issues and for troubleshooting connection and other issues like this be sure to post in the forums: http://forums.adafruit.com/ That's where you can get the best response--GitHub issues are intended for defects and problems with the code. In general a file not found error indicates the /dev/i2c-* devices don't exist which likely means raspi-config needs to be run to enable the I2C interface.

@tdicola tdicola closed this as completed Feb 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants