Robin2:
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
Actually, recvWithStartEndMarkers() isn't the correct function to use. There is no specific start marker.