Arduino GSM Shield / SIM in Finland help?

Hi All,

I’ve been working on a project in the UK. I’ve had it running for days there and it’s worked fine. I’ve brought it to Finland, tried two different local SIM cards in it and it keeps crashing. My set up is this:

Equipment:
Arduino Mega ADK board
Arduino GSM Shield with Quectel M10 chip

Here’s my full code:

#include <GSM.h>
#include <GSM3CircularBuffer.h>
#include <GSM3IO.h>
#include <GSM3MobileAccessProvider.h>
#include <GSM3MobileCellManagement.h>
#include <GSM3MobileClientProvider.h>
#include <GSM3MobileClientService.h>
#include <GSM3MobileDataNetworkProvider.h>
#include <GSM3MobileMockupProvider.h>
#include <GSM3MobileNetworkProvider.h>
#include <GSM3MobileNetworkRegistry.h>
#include <GSM3MobileServerProvider.h>
#include <GSM3MobileServerService.h>
#include <GSM3MobileSMSProvider.h>
#include <GSM3MobileVoiceProvider.h>
#include <GSM3ShieldV1.h>
#include <GSM3ShieldV1AccessProvider.h>
#include <GSM3ShieldV1BandManagement.h>
#include <GSM3ShieldV1BaseProvider.h>
#include <GSM3ShieldV1CellManagement.h>
#include <GSM3ShieldV1ClientProvider.h>
#include <GSM3ShieldV1DataNetworkProvider.h>
#include <GSM3ShieldV1DirectModemProvider.h>
#include <GSM3ShieldV1ModemCore.h>
#include <GSM3ShieldV1ModemVerification.h>
#include <GSM3ShieldV1MultiClientProvider.h>
#include <GSM3ShieldV1MultiServerProvider.h>
#include <GSM3ShieldV1PinManagement.h>
#include <GSM3ShieldV1ScanNetworks.h>
#include <GSM3ShieldV1ServerProvider.h>
#include <GSM3ShieldV1SMSProvider.h>
#include <GSM3ShieldV1VoiceProvider.h>
#include <GSM3SMSService.h>
#include <GSM3SoftSerial.h>
#include <GSM3VoiceCallService.h>

#define LED 13
#define PINNUMBER "2204"
GSM gsmAccess(true); //include a 'true' parameter for debug
GSM_SMS sms; //instance of sms object
char remoteNumber[20];
int simMemCount = 0;

//Strings
const char txt10[] = “String 1”;
const char txt11[] = "String 2”;
const char txt12[] =  "String 3”;
const char txt13[] = "String 4”;
const char txt14[] = "String 5”;
const char txt15[] = "String 6”;
const char txt16[] = "String 7”;
const char txt17[] = "String 8”;
const char txt18[] = "String 9”;
const char txt19[] = "String 10”;
const char txt20[] = "String 11”;
const char txt21[] = "String 12”;
const char txt22[] = "String 13”;
const char txt23[] = "String 14”;
const char txt24[] = "String 15”;
const char txt25[] = "String 16”;
const char txt26[] = "String 17”;
const char txt27[] = "String 18”;
const char txt28[] = "String 19”;
const char txt29[] = "String 20”;
const char txt30[] = "String 21”;
const char txt31[] = "String 22”;
const char txt32[] = "String 23”;
const char txt33[] = "String 24”;
const char txt34[] = "String 25”;
const char txt35[] = “String 26“;
const char txt36[] = "String 27”;
const char txt37[] = "String 28”;
const char txt38[] = "String 29”;
const char txt39[] = "String 30”;
const char txt40[] = "String 31”;
const char txt41[] = "String 32”;

const char * msgTable[] = { txt10, txt11, txt12, txt13, txt14, txt15, txt16, txt17, txt18, txt19, txt20, txt21, txt22, txt23, txt24, txt25, txt26, txt27, txt28, txt29, txt30, txt31, txt32, txt33, txt34, txt35, txt36, txt37, txt38, txt39, txt40, txt41 };


void setup()
{
  Serial.begin(9600);
  boolean notConnected = true;

  pinMode(LED, OUTPUT);
  digitalWrite(LED, HIGH);
  //Initialise Serial communicaion
  
  while (!Serial)
  {
    ; //wait for serial connection to
  }
  
  Serial.println("Init GSM");
  while (notConnected)
  {
    Serial.println("Not connected");
    if (gsmAccess.begin() == GSM_READY)
    {
      notConnected = false;
    }
    else
    {
      Serial.println("Failed");
      delay(1000);
    }
  }
  Serial.println("OK");
  Serial.println("Awaiting SMS");
 
  ledFlash(); //let me know setup() is finished
}



void loop()
{
  char c; 
  
  if (sms.available())
  {
    ledFlash();
    simMemCount++;
   
    //Serial.println("Message received from:");

    //get remote number
    sms.remoteNumber(remoteNumber, 20);
    //Serial.println(remoteNumber);

    c = sms.read();
    sms.flush();
    if (c == 'R' || c == 'r')
    {
      sendSMS();
    }
     else if (c == 'D' || c == 'd')
    {
      deleteSMS();
    }
    else
    {
      deleteSMSAuto();
    }
  }
  else
  {
    digitalWrite(LED, HIGH);
    delay(20);
    digitalWrite(LED, LOW);
    delay(2000);

    if(simMemCount > 3)
    {
      deleteSMSAuto();
      simMemCount = 0;
    }
  }
}

//function to send SMS
void sendSMS()
{
  int ran = random(0, 32);
  Serial.println("SENDING");
  sms.beginSMS(remoteNumber);
  sms.print(msgTable[ran]);
  sms.endSMS();
  Serial.println("\nCOMPLETE!\n");
  sms.flush(); 
}


void ledFlash()
{
  for(int i = 0; i<100; i++)
  {
    digitalWrite(LED, HIGH);
    delay(20);
    digitalWrite(LED, LOW);
    delay(20);
  }
}


void deleteSMS()
{
  Serial.println("AT+CMGDA=\"DEL ALL\"");
  sms.beginSMS(remoteNumber);
  sms.print("Stored messages on the SIM have been erased");
  sms.endSMS();
  sms.flush();
}

void deleteSMSAuto()
{
  Serial.println("AT+CMGDA=\"DEL ALL\"");
}

Running in the UK the program received text messages and sent text messages back in reply without crashing.

When I tried to run this in Helsinki today it kept crashing.

I tried to run the Arduino GSM examples and they kept crashing too.

I was using a DNA SIM so I swapped it for a Sunera SIM, which performed slightly more stably, but still kept crashing.

I’ve tried using the bandwidth manager tool to change this setting on the modem, but that doesn’t seem to have any effect.

Someone in this community in Finland must have come across this problem at someone point. Can you please tell me how to fix this?

This is typical of the error I get when I send it a text message and it responds by crashing. I have no idea what the question mark and square images are in the AT print out.

AT+CMGL="REC UNREAD",1%13%
76 82>%13%%10%OK%13%%10%
AT+CMGL="REC UNREAD",1%13%
82 88>%13%%10%OK%13%%10%
Init GSM
Not connected
�@�B 2f�

I really need to solve this fast so any help is appreciated.

Thanks for reading.