m-rtijn / mpu6050

A Python module for accessing the MPU-6050 digital accelerometer and gyroscope on a Raspberry Pi.
MIT License
296 stars 145 forks source link

OSError: 121 #40

Closed Roojigger closed 8 months ago

Roojigger commented 8 months ago

I just got a this libary installed and pluged in and when I run any thing that retruns a map it reads this error: Traceback (most recent call last): File "/home/pi/Desktop/IMU_MPU6050.py", line 7, in <module> accelerometer_data = IMU.get_gyro_data() File "/home/pi/.local/lib.python3.9/site-packages/mpu6050/mpu6050.py, line 235, in get_gyro_data z = self.read_i2c_word(self.GYRO_ZOUT0) File "/home/pi/.local/lib.python3.9/site-packages/mpu6050/mpu6050.py, line 87, in read_i2c_word low = self.bus.read_byte_data(self.address, register + 1) File "/home/pi/.local/lib/python3.9/site-packages/smbus/util.py", line 59, in validator return fn(*args, **kwdefults) File "/hoome/pi/.locallib/python3.9/site-packages/smbus/smbus.py", line 132, in read_byte_data raise IOError(ffi.errno) OSError: 121

Roojigger commented 8 months ago

Changed wires so thay connect straight to my pi an it works now (check sudo i2cdetect -y 1 twice).