question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OSError: [Errno 121] Remote I/O error

See original GitHub issue
  File "/home/pi/.local/lib/python3.7/site-packages/mpu6050/mpu6050.py", line 60, in __init__
    self.bus.write_byte_data(self.address, self.PWR_MGMT_1, 0x00)
OSError: [Errno 121] Remote I/O error

I2C is enabled

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
toonijncommented, Apr 5, 2020

The raspberry has two I²C busses.

bus 0: pins 27, 28 bus 1: pins 3,5 (default)

If you connected the mpu6050 to 27 and 28 you will have to specify bus=0:

from mpu6050 import mpu6050
sensor = mpu6050(0x68, bus=0)
accelerometer_data = sensor.get_accel_data()

If you’re using the wrong bus you’ll also get the OP’s error.

For more info about the pins see: https://pinout.xyz/pinout/i2c

0reactions
kodecreercommented, Aug 20, 2022

Alright so the answer was super simple. It was cheap and faulty due to my soldering. Since it’s pretty cheap I just bought a new set and soldered it worked perfectly fine.

Lesson of the story is, there might be a slight chance you just have a fault accelerometer. It’s cheap for a reason.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting IOError: [Errno 121] Remote I/O error with smbus on ...
Getting IOError: [Errno 121] Remote I/O error with smbus on python (raspberry) while trying to get data over I2C from Arduino - Stack...
Read more >
OSError : [Errno 121] Remote I/O error - AB Electronics UK
A remote I/O error means that the python library is having trouble communicating with the IO Pi. Please can you try running the...
Read more >
Errno 121 : Remote I/O error · Issue #86 · geeekpi/upsplus
I have been trying everything to get my RPi4B to communicate with the USP Plus but I continually get this error pi@ImpactRemote:~/upsplus ...
Read more >
i2c and IOError: [Errno 121] Remote I/O error
That error is invariably poor or wrong wiring. A photo clearly showing the connections may help. 3 posts • Page 1 of 1....
Read more >
Errno 121 Remote I/O error happening too often on Raspberry ...
Error 121 is I2C newbie's favourite. For trouleshooting, try (1) use only one sensor, (2) shorten all wires to less than 30cm, (3)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found