Go Down

Topic: Arduino GSM SHIELD 2 CGREG: 0,0 (Read 265 times) previous topic - next topic

andyandy26

Hey guys,
For the past few days I've been racking my brain trying to get my GSM shield (GSM SHIELD 2) to connect and send a simple SMS.
No luck.
Just to list out the setup:
- Arduino 1.8.5
- Arduino GSM Shield 2 w/ int. antenna
- Arduino Mega 2560
- Optus prepaid SIM (activated and works in my mobile, sends sms, calls etc)

I successfully can communicate to the modem in the Band management example and have selected all the bands (6).

The programs requiring a network connection however fail across the board.

- Pin management (BTW there is no pin on the SIM) fails with a PUK issue or something :P

- send SMS hangs at the gsmAccess.begin("") with the debug response of:
Code: [Select]
SMS Messages Sender
AT%13%
0 9>AT%13%%13%%10%OK%13%%10%
AT+CGREG?%13%
9 40>AT+CGREG?%13%%13%%10%+CGREG: 0,2%13%%10%%13%%10%OK%13%%10%
AT+CGREG?%13%
40 71>AT+CGREG?%13%%13%%10%+CGREG: 0,2%13%%10%%13%%10%OK%13%%10%
AT+CGREG?%13%
71 102>AT+CGREG?%13%%13%%10%+CGREG: 0,2%13%%10%%13%%10%OK%13%%10%
AT+CGREG?%13%
102 5>AT+CGREG?%13%%13%%10%+CGREG: 0,2%13%%10%%13%%10%OK%13%%10%
AT+CGREG?%13%
5 36>AT+CGREG?%13%%13%%10%+CGREG: 0,2%13%%10%%13%%10%OK%13%%10%
AT+CGREG?%13%
36 67>AT+CGREG?%13%%13%%10%+CGREG: 0,0%13%%10%%13%%10%OK%13%%10%
AT+CGREG?%13%
67 98>AT+CGREG?%13%%13%%10%+CGREG: 0,0%13%%10%%13%%10%OK%13%%10%
AT+CGREG?%13%
98 1>AT+CGREG?%13%%13%%10%+CGREG: 0,0%13%%10%%13%%10%OK%13%%10%
AT+CGREG?%13%
1 32>AT+CGREG?%13%%13%%10%+CGREG: 0,0%13%%10%%13%%10%OK%13%%10%
AT+CGREG?%13%
32 63>AT+CGREG?%13%%13%%10%+CGREG: 0,0%13%%10%%13%%10%OK%13%%10%
AT+CGREG?%13%
63 94>AT+CGREG?%13%%13%%10%+CGREG: 0,0%13%%10%%13%%10%OK%13%%10%
AT+CGREG?%13%
94 125>AT+CGREG?%13%%13%%10%+CGREG: 0,0%13%%10%%13%%10%OK%13%%10%
AT+CGREG?%13%
125 28>AT+CGREG?%13%%13%%10%+CGREG: 0,0%13%%10%%13%%10%OK%13%%10%
AT+CGREG?%13%
28 59>AT+CGREG?%13%%13%%10%+CGREG: 0,0%13%%10%%13%%10%OK%13%%10%


The CGREG: 0,0 continues indefinitely :/

From this it's my understanding that the network is perhaps rejecting the connection and the card attempts to reconnect (0,2) but eventually gives up (0,0).

What is the issue here?

Any help would be greatly appreciated as this is mean't to serve as my gps->arduino->gsm->my phone for tracking my car.

Below is the program code I'm currently trying:
Code: [Select]
#include <GSM.h>

#define PINNUMBER ""

// initialize the library instance
GSM gsmAccess(true); // include a 'true' parameter for debug enabled
GSM_SMS sms;

// char array of the telephone number to send SMS
// change the number 1-212-555-1212 to a number
// you have access to
char remoteNumber[20]= "helpMePlease"; 

// char array of the message
char txtMsg[200]="Test";

void setup()
{
  // initialize serial communications
  Serial.begin(9600);

  Serial.println("SMS Messages Sender");

  // connection state
  boolean notConnected = true;

  // Start GSM shield
  // If your SIM has PIN, pass it as a parameter of begin() in quotes
  while(notConnected)
  {
    if(gsmAccess.begin(PINNUMBER)==GSM_READY)
      notConnected = false;
    else
    {
      Serial.println("Not connected");
      delay(1000);
    }
  }
  Serial.println("GSM initialized");
  sendSMS();
}

void loop()
{
// nothing to see here
}

void sendSMS(){

  Serial.print("Message to mobile number: ");
  Serial.println(remoteNumber);

  // sms text
  Serial.println("SENDING");
  Serial.println();
  Serial.println("Message:");
  Serial.println(txtMsg);

  // send the message
  sms.beginSMS(remoteNumber);
  sms.print(txtMsg);
  sms.endSMS();
  Serial.println("\nCOMPLETE!\n"); 
}


I removed my phone number though :P

Go Up