Go Down

Topic: GSM Shield get stuck on AT%13% (Read 7970 times) previous topic - next topic

nenadalm

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:

Code: [Select]

/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: http://forum.arduino.cc/index.php?topic=229141.0 so I downloaded posted version of GSM library and now my program shows on serial console:

Code: [Select]

scanning...
AT%13%


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

my code:
Code: [Select]

#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?

PierluigiRovere

i had the same problem....

i followed THIS and magically everything start to work :)

nenadalm

Thanks for Your response.

I modified the code as suggested:
Code: [Select]

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)

nenadalm

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

Code: [Select]

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();
}

nenadalm

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).

Code: [Select]

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();
}


nenadalm

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

void setup() {
}

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

matthewsg


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."

nenadalm

thanks for information. but delay gets stuck for unknow  reason

Go Up