Added timeout to serial connection.