GSM Shield get stuck on AT%13%

Hi,

I am using arduino ide 1.5.7 with Leonardo.
I connected pins as described here: http://arduino.cc/en/Guide/GSMShieldLeonardoMega, but I go error:

/home/nenadalm/arduino-1.5.7/libraries/GSM/src/GSM3MobileMockupProvider.cpp: In member function 'int GSM3MobileMockupProvider::begin(char*)':
/home/nenadalm/arduino-1.5.7/libraries/GSM/src/GSM3MobileMockupProvider.cpp:49:2: error: 'Serial' was not declared in this scope
  Serial.println("GSM3MobileMockupProvider::begin()");

then I found: Arduino GSM Shield + Yun - Arduino GSM Shield - Arduino Forum so I downloaded posted version of GSM library and now my program shows on serial console:

scanning...
AT%13%

and that's it. it get stuck here. I tried even with 12V, 1.5A adapter.

my code:

#include <GSM.h>

#define PIN_NUMBER "here_is_my_pin" 
#define CALL_NUMBER "here_is_some_number"

GSM gsmAccess(true);

void setup() {
  Serial.begin(9600);
  while(!Serial) {};
  Serial.println("scanning...");
  gsmAccess.begin(PIN_NUMBER);
  Serial.println("pin accepted");
}

void loop() {
}

Sim normally works with my mobile. Any suggestions?

i had the same problem....

i followed THIS and magically everything start to work :slight_smile:

Thanks for Your response.

I modified the code as suggested:

GSM3_NetworkStatus_t GSM3ShieldV1AccessProvider::begin(char* pin, bool restart, bool synchronous)
{	
	pinMode(__RESETPIN__, OUTPUT);

	// If asked for modem restart, restart
	if (restart) 
		HWrestart();
	else 
		HWstart();

    unsigned loopCnt = 2;

	theGSM3ShieldV1ModemCore.gss.begin(9600);
	// Launch modem configuration commands
	ModemConfiguration(pin);
	// If synchronous, wait till ModemConfiguration is over
	if(synchronous)
	{
		// if we shorten this delay, the command fails
		while(ready()==0 && loopCnt--) 
			delay(1000); 
	}
	return getStatus();
}

but it's still the same (the code run for over 8 minutes)

That's weird. Last printed words are "inside loop" (just once). Even if delay should take 1 second, it takes forever.

GSM3_NetworkStatus_t GSM3ShieldV1AccessProvider::begin(char* pin, bool restart, bool synchronous)
{	
    Serial.println("method begin");
	pinMode(__RESETPIN__, OUTPUT);

	// If asked for modem restart, restart
	if (restart) 
		HWrestart();
	else 
		HWstart();

    unsigned loopCnt = 2;

	theGSM3ShieldV1ModemCore.gss.begin(9600);
	// Launch modem configuration commands
	ModemConfiguration(pin);
	// If synchronous, wait till ModemConfiguration is over
	if(synchronous)
	{
        Serial.println("before loop");
		// if we shorten this delay, the command fails
		while(ready()==0 && loopCnt--) { 
            Serial.println("inside loop");
			delay(1000); 
        }
        Serial.println("after loop");
	}
	return getStatus();
}

delayMicroseconds seems to have an opposite problem: "inside loop" is printed 5 times in a row (even if there should be 1000s delay between these prints).

GSM3_NetworkStatus_t GSM3ShieldV1AccessProvider::begin(char* pin, bool restart, bool synchronous)
{	
    Serial.println("method begin");
	pinMode(__RESETPIN__, OUTPUT);

	// If asked for modem restart, restart
	if (restart) 
		HWrestart();
	else 
		HWstart();

    unsigned loopCnt = 5;

	theGSM3ShieldV1ModemCore.gss.begin(9600);
	// Launch modem configuration commands
	ModemConfiguration(pin);
	// If synchronous, wait till ModemConfiguration is over
	if(synchronous)
	{
        Serial.println("before loop");
		// if we shorten this delay, the command fails
		while(ready()==0 && loopCnt--) { 
            Serial.println("inside loop");
			delayMicroseconds(1000000000); 
        }
        Serial.println("after loop");
	}
	return getStatus();
}

but when I create new sketch, it works as expected (one print per second):

void setup() {
}

void loop() {
  delay(1000);
  Serial.println("Hello World!");
}

http://arduino.cc/en/Reference/DelayMicroseconds

"Currently, the largest value that will produce an accurate delay is 16383. This could change in future Arduino releases. For delays longer than a few thousand microseconds, you should use delay() instead."

thanks for information. but delay gets stuck for unknow reason