Send data from Arduino to raspberry pi through USB cable (Solved)

Hi,

just an assumption: you re-open the serial port in every iteration of you while loop. Try to move the initialization of the serial port outside the loop amd only do the reading inside.

Besides: try to check the data transmitted with a logic analyzer or by simply attaching it to a serial port on your computer and display the data to verify what is actually send.