MPU6050 not working when Arduino is connected to RPi

Hello everyone,

I came across a problem that I cannot solve for about 3 days:

I have connected an MPU6050 to my Arduino Uno and uploaded the test program "MPU6050_DMP6.ino" (i2cdevlib) via Arduino IDE (Version 2.0.1) on my Mac and it works just like it is supposed to be.

Example Code for MPU6050

For the project I need the MPU for, the Arduino UNO is connected to a RaspberryPi 4 Model B via USB. Uploading the exact same program via the Raspberry Pi results in the following error message:

DMP Initialization failed (code 1)

Which according to the legend means "initial memory load failed".
I do not understand why it makes a difference for the Arduino wether it is connected to my Mac or the RPi.

Can someone help out?

Do you compile and upload the sketch from the Rasperry Pi or do you connect the Arduino to it after uploading the sketch? Does it make a difference?

Do you have the same version of the IDE and of the library installed on the Raspberry Pi?

Please post schematic diagrams showing how you wired the module in both cases.

The MPU-6050 is a 3.3V device, while the Uno runs on 5V.