What is this bit of code for
for (i;i<1;i++)
{
Serial2.println("+++");
delay(5000);
while (Serial2.available() > 0) {
Serial2.read();
}
}
I'm not sure which is worse, the huge delay or the fact that is is eating some of the characters that should be left for recvWithStartEndMarkers()
The function recvWithStartEndMarkers() MUST be called often enough to empty the Serial Input Buffer before it overflows.
...R