Hi,
I have a problem with the GSM.begin function about 50% of the time it hangs. I have a electric sheep (atmega 2560) from sparkfun with the gsmshield on top. I feed it 12V 1A externally.
It appears if the communication with the GSM just stops most of the time. On a few occasions I see a few garbage bytes over the serial line.
I have included a snippet of the code where I added a small delay and almost stock example code. I have also included a successfull and a failed start attempt. Does this problem sound familiar?
boolean notConnected = true;
for(byte i=0; i< 5; i++)
{
Serial.println(i, DEC);
delay(1000);
}
while(notConnected)
{
if(gsmAccess.begin(PINNUMBER)==GSM_READY)
notConnected = false;
else
{
Serial.println("Not connected");
//wdt_reset(); // Reset the WDT
delay(1000);
}
}
Success
AT%13%
0 9>AT%13%%13%%10%OK%13%%10%
AT+CPIN=7130%13%
9 44>AT+CPIN=7130%13%%13%%10%+CPIN: READY%13%%10%%13%%10%OK%13%%10%
AT+CGREG?%13%
44 75>AT+CGREG?%13%%13%%10%+CGREG: 0,2%13%%10%%13%%10%OK%13%%10%
AT+CGREG?%13%
75 120>AT+CGREG?%13%%13%%10%+CGREG: 0,2%13%%10%%13%%10%OK%13%%10%%13%%10%Call Ready%13%%10%
AT+CGREG?%13%
120 23>AT+CGREG?%13%%13%%10%+CGREG: 0,2%13%%10%%13%%10%OK%13%%10%
AT+CGREG?%13%
23 54>AT+CGREG?%13%%13%%10%+CGREG: 0,2%13%%10%%13%%10%OK%13%%10%
AT+CGREG?%13%
54 85>AT+CGREG?%13%%13%%10%+CGREG: 0,1%13%%10%%13%%10%OK%13%%10%
AT+IFC=1,1%13%
85 102>AT+IFC=1,1%13%%13%%10%OK%13%%10%
AT+CMGF=1%13%
102 118>AT+CMGF=1%13%%13%%10%OK%13%%10%
AT+CLIP=1%13%
118 6>AT+CLIP=1%13%%13%%10%OK%13%%10%
ATE0%13%
6 17>ATE0%13%%13%%10%OK%13%%10%
AT+COLP=1%13%
17 23>%13%%10%OK%13%%10%
GSM initialized
Number: +316********
Message:
Arduino test SMS
AT+CMGS="+316********"%13%
23 27>%13%%10%>
Arduino test SMS%26%%13%
23 46>%13%%10%> %13%%10%+CMGS: 11%13%%10%%13%%10%OK%13%%10%
Send 16bytes Return endSMS()1
COMPLETE!
Fail
AT%13%
0 9>AT%13%%13%%10%OK%13%%10%
AT+CPIN=7130%13%
9 44>AT+CPIN=7130%13%%13%%10%+CPIN: READY%13%%10%%13%%10%OK%13%%10%
AT+CGREG?%13%
44 75>AT+CGREG?%13%%13%%10%+CGREG: 0,2%13%%10%%13%%10%OK%13%%10%
AT+CGREG?%13%