simsam:
i have corrected the code and changed it to esp.read(). I ran it again but still the same results.
You need to post the complete revised program in your next Reply.
You should not be reading data from esp anywhere except in recvWithStartEndMarkers()
...R