When I run waitForNetwork(), I expect that it will and keep trying until a connection is made. But it seems to be making one attempt to get the network status and then just returning false. In the code, I think the for loop of waitForNetwork() should actually be a while loop instead. Am I doing something wrong?
Serial.println(F("Waiting for network...")); // For debugging
if (!_modem->waitForNetwork()){
Serial.println("... Connection failed"); // For debugging
} else {
_modem->gprsConnect(_APN, "", "");
}
When I run waitForNetwork(), I expect that it will and keep trying until a connection is made. But it seems to be making one attempt to get the network status and then just returning false. In the code, I think the for loop of waitForNetwork() should actually be a while loop instead. Am I doing something wrong?