Don't stomp the device with excess data.  Clear the buffer before new commands.  Fix the timeouts.