Okay - so maybe not so solved yet .....
I modified the GSM3ShieldV1AccessProvider.cpp (in the GSM library) as suggested in another thread (Code hangs in interrupt when there is poor GSM signal - Arduino GSM Shield - Arduino Forum and JaanH earlier post)
// SVJ - modified to introduce a timeout in the access loop (loopCnt)
GSM3_NetworkStatus_t GSM3ShieldV1AccessProvider::begin(char* pin, bool restart, bool synchronous)
{
//Serial.println("gsm.begin()");
pinMode(__RESETPIN__, OUTPUT);
// If asked for modem restart, restart
if (restart)
{
HWrestart();
}
else
{
HWstart();
}
unsigned loopCnt = 15; // SVJ = Modified from suggested 30
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);
//Serial.println("gsm.begin() waiting for ready");
}
}
return getStatus();
}
This was better but did not solve the constant data disconnect after 3 or 4 minutes once GPRS had been established and a connection to my server was made. I then also added this retry count into the GPRS provider (GSM3ShieldV1DataNetworkProvider.cpp) as well and this now at least it reconnects after my comms check routing restarts the board (previously the system would hang on trying to reconnect after a comms lost restart);
//Attach GPRS main function.
// SVJ - limit loop count below to stop locking up in a constant attach loop
GSM3_NetworkStatus_t GSM3ShieldV1DataNetworkProvider::attachGPRS(char* apn, char* user_name, char* password, bool synchronous)
{
user = user_name;
passwd = password;
// A sad use of byte reuse
theGSM3ShieldV1ModemCore.setPhoneNumber(apn);
theGSM3ShieldV1ModemCore.openCommand(this,ATTACHGPRS);
theGSM3ShieldV1ModemCore.setStatus(CONNECTING);
attachGPRSContinue();
unsigned loopCnt = 15; // SVJ retry counter added
// If synchronous, wait till attach is over, or not.
if(synchronous)
{
// if we shorten this delay, the command fails
while(ready()==0 && loopCnt--) // SVJ retry counter added
delay(100);
}
return theGSM3ShieldV1ModemCore.getStatus();
}
It now looks a lot better ... I seem to now have something else causing an unexpected restart just after sending my 1st 5min data block........