Read and save IMEI from serial port

Suppose that, in your for loop, you only incremented i when you actually read a character. How many times would the loop iterate, then?

How do you KNOW that you will get exactly 64 characters back?