i2c ioerror 5 - can't communicate

I have an MPU6050 on a GY-521 breakout board http://playground.arduino.cc/Main/MPU-6050 that I want to use I2C as the communications path using Python. Everything I try to read or write fails with

pi@tm1000 ~/theTech/tm1000 $ sudo python3 gyro.py bus = smbus.SMBus(1) x = bus.write_byte_data(0x68, 0x1A, 0x80) # reset all registers IOError: [Errno 5] Input/output error

Connected to an RPI 2 running raspbian 3.18.13-v7+ #785, i2C-dev 3.1.1+SVN and python 3.2.3 (also tried 2.7.3)

Although I don't have AD0 grounded, the i2cdetect shows it is connected. pi@tm1000 ~/theTech/tm1000 $ 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: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- --

pi@tm1000 ~/theTech/tm1000 $ i2cdump -y 1 0x68 No size specified (using byte-data access) 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef 00: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX 10: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX 20: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX 30: XX XX XX XX XX XX XX XX XX XX XX XX 1f XX XX XX XXXXXXXXXXXX?XXX 40: XX 0f 0f 1f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f X??????????????? 50: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f ???????????????? 60: 0f 0f 0f 0f 0f 0f 07 XX 0f 1f 0f 47 0f 0f 0f 0f ???????X???G???? 70: 07 XX 0f 0f XX 6b 1f 1f 1f 1f 1f 1f 0f 1f 1f 1f ?X??Xk?????????? 80: XX 0f 0f 3e be d1 f9 2d f9 1b 0f 0f 2b 6e 6c 95 X??>???-????+nl? 90: d8 0f 0f 0f 0f XX 0f 1f 0f 0f 0f 0f 1f 0f 1f 1f ?????X?????????? a0: 07 0f 0f 0f 07 0f 0f XX 07 0f 0f 0f 0f 0f 0f 1f ???????X???????? b0: 0f 0f 0f 0f 0f 0f 0f 1f 0f 0f 0f 0f 0f 1f 1f XX ???????????????X c0: XX 0f 0f 0f 0f 0f 0f XX 07 0f 0f 0f 0f 0f 0f 1f X??????X???????? d0: XX 1f XX 0f XX 0f 0f 1f XX 0f 0f 1f XX 0f 1f 1f X?X?X???X???X??? e0: XX XX 0f 0f XX 0f 1f XX 0f 0f 0f 4f 0f XX 0f 1f XX??X??X???O?X?? f0: XX 1f 0f 1f 0f XX 0f XX 0f 1f 1f XX 0f 1f 1f XX X????X?X???X???X

pi@tm1000 ~ $ sudo i2cget -y 1 0x68 0xa0 Error: Read failed

pi@tm1000 ~ $ sudo i2cset -y 1 0x68 0x1A 0x80 Error: Write failed

Any suggestions or idea's about what I am doing wrong?

TIA, Jon.

Hi, welcome to the forum.

Do you use a sketch ? or Processing ? Is is connected to an Arduino or directly to a Raspberry Pi ? If an Arduino board is used, which board ? This is a forum for Arduino.

I have the MPU6050 connected directly to the RPi2 where RPi2 is the master. I'll ask this question on the Raspberry group.

Thanks.

Problem solved. Grounding AD0 fixed the problem. I should have realized it was bouncing when the i2cdump was showing some data and XX.

Thanks for the help.