The suggested code for starting the GSM looks like:
// Start GSM shield
// If your SIM has PIN, pass it as a parameter of begin() in quotes
while(notConnected)
{
if(gsmAccess.begin(PINNUMBER)==GSM_READY)
notConnected = false;
else
{
Serial.println("Not connected");
delay(1000);
}
The error lies in the use of the begin()
function. Under the above conditions, gsmAccess.begin(PINNUMBER)
is solely required. For asynchronous operation, use:
while(notConnected)
{
if(gsmAccess.begin(PINNUMBER, true, false)== GSM_READY)
notConnected = false;
else
{
Serial.println("Not connected");
delay(1000);
}
And add timeout checking according to your taste
HTH