added the serial communication compatibility for Raspberry pi