dear support comunity
I did visit dozens of sites and searched to forum, but I am stuck.
I'm using the telefonica GSM shield, which seems to be hanging randomly when calling the gsm begin() function. As found on other sites, I am using an external 12V power supply with 1A, I did bend and bridge the pin 2 to 10 (as using a MEGA board).
When I turn on the gsm debug function, the last thing that I can see is
AT%13%
After changing this code quite a few times and testing, I am using this code to connect to the GSM / GPRS network:
In setup:
while(notConnected)
{
if(!gsm_connect()) {
Serial.println(F("SYSTEM - Could not connect to GSM Network -> Retry in 10 Seconds"));
delay(10000);
} else {
notConnected = false;
}
}
and the function:
boolean gsm_connect() {
unsigned long myTimeout = 20000; // Connection timeout in milliseconds
int connected = 0;
unsigned long timeConnect = millis();
while(!connected && (millis()-timeConnect < myTimeout)) {
Serial.println(F("SYSTEM - Connecting to GSM Network..."));
delay(1000);
if(gsmAccess.begin(PINNUMBER, false)==GSM_READY) {
Serial.println(F("SYSTEM - Successfully connected to GSM Network"));
delay(1000);
if(gprs.attachGPRS(GPRS_APN, GPRS_LOGIN, GPRS_PASSWORD)==GPRS_READY) {
Serial.println(F("SYSTEM - Successfully connected to GPRS Data Network"));
connected=1;
}
}
}
if(connected == 1) {
return true;
} else {
return false;
}
}
I do get a connection quite 3/4 of the connection attempts and then it holds for a few minutes. If I got a lot of traffic, it loses connection and hangs on reconnect...
if (client.connect(server, 80)) {
...
} else {
notConnected=true;
gsmAccess.shutdown();
Serial.println(F("SYSTEM: Reconnecting to GSM Network..."));
while(notConnected)
{
if(!gsm_connect()) {
Serial.println(F("SYSTEM - Could not connect to GSM Network -> Retry in 10 Seconds"));
delay(10000);
} else {
notConnected = false;
}
}
}
Any ideas what could cause this?
I just replaced the 12V 1A power supply with one offering 12V 3A. Still the same problem. It just hangs on almost 50% of the begin(). :~