script to read serial data