Using the GSM library I get erratic response from the GSM shield.
Here is the code:
#include <GSM.h>
// initialize the library instance
GSM gsmAccess(true); // include a 'true' parameter for debug enabled
void setup()
{
// initialize serial communications
Serial.begin(9600);
Serial.print("Start ");
Serial.println(freeRam());
gsmAccess.begin();
Serial.print("GSM initialized ");
Serial.println(freeRam());
}
void loop()
{
}
//from http://playground.arduino.cc/Code/AvailableMemory
int freeRam()
{
extern int __heap_start, *__brkval;
int v;
return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval);
}
and this is the response
Start 1182
AT%13%
0 9>AT%13%%13%%10%OK%13%%10%
AT+CGREG?%13%
9 40>AT+CGREG?%13%%13%%10%+CGREG: 0,2%13%%10RR¦¦*??êÒjªR`Í?*??*jTüAT+CGREG?%13%
40 85>AT+CGREG?%13%%13%%10%+CGREG: 0,2%13%%10%PRÓ¦?Å?*z-?Å?**??**??**??*
±±I???å?Å?**??*jPüAT+CGREG?%13%
85 116>AT+CGREG?%13%%13%%10%+CGREG: 0,2%13%%10%%13%%10%OK%13%%10%
AT+CGREG?%13%
116 19>AT+CGREG?%13%%13%%10%+CGREG: 0,1%13%%10%%13%%10%OK%13%%10%
AT+IFC=1,1%13%
19 36>AT+IFC=1,1%13%%13%%10%OK%13%%10%
AT+CMGF=1%13%
36 54>%19%%17%AT+CMGF=1%13%%13%%10%OK%13%%10%
AT+CLIP=1%13%
54 70>AT+CLIP=1%13%%13%%10%OK%13%%10%
ATE0%13%
70 81>ATE0%13%%13%%10%OK%13%%10%
AT+COLP=1%13%
81 87>%13%%10%OK%13%%10%
GSM initialized 1182
Especially the erratic part
AT+CGREG?%13%%13%%10%+CGREG: 0,2%13%%10RR¦¦*??êÒjªR`Í?*??*jTüAT+CGREG?%13%
40 85>AT+CGREG?%13%%13%%10%+CGREG: 0,2%13%%10%PRÓ¦?Å?*z-?Å?**??**??**??*
±±I???å?Å?**??*jPüAT+CGREG?%13%
should not be there.
What can be the cause? And is there a solution available?
See also my other topic on this http://forum.arduino.cc/index.php?topic=241754.msg1734545#msg1734545