I've been trying to understand a hang that happens unpredictably after many hours/days/weeks of communication with the Pachube server.
This is the code where it occurs:
while (!ReadTimer.Expired()) {
StatusAvailableSet(HIGH);
if (LocalClient.available() > 0) {
ProcessInput();
}
StatusAvailableSet(LOW);
StatusConnectedSet(HIGH);
if (!LocalClient.connected()) {
break;
}
StatusConnectedSet(LOW);
}
When the hang occurs the "Status Connected" LED remains ON (and this is the only place where the LEDpin is set to HIGH).
The ReadTimer expires after 60seconds, yet the board is stuck there with the Connected LED on.
This is telling me that it hangs in the LocalClient.connected() call ?
I can probably write the loop without using LocalClient.connected()... i.e. if there is data available read it and reset the ReadTimer, else if the ReadTimer expires, bail out...
It'll slow down my communication (it is not very frequent anyway) but better than getting stuck there for ever.
Does anybody know of any issues with the connected() call ?
Thanks !