richardghirst / PiBits

819 stars 565 forks source link

MPU6050 Remote I/O error on RasberryPI 4 #117

Open paolov opened 4 years ago

paolov commented 4 years ago

I compiled the MPU6050-Pi-Demo code after changing to /dev/i2c-1 (otherwise I was getting "Failed to open device: Is a directory") and now I'm getting the error "Failed to write reg: Remote I/O error". Here is the log:

Initializing I2C devices...
Failed to write reg: Remote I/O error
Failed to write device(-1): Remote I/O error
Failed to write reg: Remote I/O error
Failed to write device(-1): Remote I/O error
Failed to write reg: Remote I/O error
Failed to write device(-1): Remote I/O error
Failed to write reg: Remote I/O error
Failed to write device(-1): Remote I/O error
Testing device connections...
Failed to write reg: Remote I/O error
MPU6050 connection failed
Failed to write reg: Remote I/O error
a/g:   6912      0      0        0      0      0

I can access the mpu with c# without problem at address 69 instead of 68 so I tried to initialize the mpu to address MPU6050_ADDRESS_AD0_HIGH but I'm getting the same error. Here the result of 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: -- -- -- -- -- -- -- -- -- 69 -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
paolov commented 4 years ago

Just to confirm that at the end it works perfectly initializing to address 69. It was me making a mistake. To recap, to make it working on RPi4 you have to change the folder to /dev/i2c-1 and use address accordingly to i2cdetect (69 in my case)

richardghirst commented 4 years ago

That's good to know, thanks for debugging the problem!

On Sun, Oct 13, 2019 at 10:13 PM Paolo Vigori notifications@github.com wrote:

Just to confirm that at the end if works perfectly initializing to address

  1. It was me making a mistake. To recap, to make it working on RPi4 you have to change the folder to /dev/i2c-1 and use address accordingly to i2cdetect (69 in my case)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/richardghirst/PiBits/issues/117?email_source=notifications&email_token=AAN5RMMMO6AYBUHT2RJDWHTQOOFPVA5CNFSM4JAIT3P2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBDAO5Q#issuecomment-541460342, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN5RMKLZIM5ZXBOROTUBTLQOOFPVANCNFSM4JAIT3PQ .