Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting Tracebacks on calling get_accel_data() #21

Closed
shreyasbapat opened this issue May 14, 2018 · 4 comments
Closed

Getting Tracebacks on calling get_accel_data() #21

shreyasbapat opened this issue May 14, 2018 · 4 comments

Comments

@shreyasbapat
Copy link

shreyasbapat commented May 14, 2018

We are testing mpu6050 and are currently getting such tracebacks :
``
Traceback (most recent call last):

File "balance.py", line 72, in

accel_data = sensor.get_accel_data()

File "/usr/local/lib/python3.5/dist-packages/mpu6050/mpu6050.py", line 141, in get_accel_data

z = self.read_i2c_word(self.ACCEL_ZOUT0)

File "/usr/local/lib/python3.5/dist-packages/mpu6050/mpu6050.py", line 71, in read_i2c_word

high = self.bus.read_byte_data(self.address, register)

OSError: [Errno 121] Remote I/O error
``

What can be the reason for these tracebacks?
cc @Manvi07

@m-rtijn
Copy link
Owner

m-rtijn commented May 14, 2018

Since you're getting an Remote I/O error, the first thing I would check is the connection with the sensor. Is i2c enabled on your device? Are you running as a user that has access to the i2c bus (try to run with sudo if you're not sure)? Are the physical connections with the sensors correct? Check the wires and solder joints.

@akshat157
Copy link

akshat157 commented May 14, 2018

@shreyasbapat Thanks for posting the issue here and Thanks @Tijndagamer for the suggestions. I resolved those tracebacks by I think re-enabling the interfaces and reconnecting the sensor and the wires. Though we're still facing some problem. new tracebacks are --
screenshot from 2018-05-14 22-28-16

Where code mpu.py can be found here -http://www.electronicwings.com/raspberry-pi/mpu6050-accelerometergyroscope-interfacing-with-raspberry-pi

and that for balance.py - https://github.com/shivaay1/Equsant-Self-Balancing-Robot-Python/blob/master/equsant.py

EDIT: We fixed the error by replacing the jumper wires. Thanks for the help! :)
@shreyasbapat , you can close the issue now.

@shreyasbapat
Copy link
Author

Thanks a lot! @Tijndagamer for a Great library!

@m-rtijn
Copy link
Owner

m-rtijn commented May 17, 2018

Good to hear that it works now. I'm glad you like the library!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants