reading serial data with timeouts