I’ve been trying to connect the GPRS shield to the Arduino Mega 2560. I’ve stacked the shield on top of the mega where the analog pins 0-5 on the shield line up with the analog pins 0-5 on the mega. I pulled pin 7 aside when stacking so this pin would not be connected to the mega. I have jumper cables from pin 7 to 10 on the shield, and 8 to 11 on the shield. I’ve tried a go phone sim card from AT & T and my Verizon sim card. Nothing seems to do the trick, and I dont have any Pin lock on either sim card. I’ve tried using a sample code from someone who said they’ve got it to work as seen below.
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 1);
String SIM_PIN_CODE = String(“0703”);
void setup()
{
mySerial.begin(19200); // the GPRS baud rate
Serial.begin(19200); // the GPRS baud rate
delay(500);
}
void loop()
{
//after start up the program, you can using terminal to connect the serial of gprs shield,
//if you input ‘t’ in the terminal, the program will execute SendTextMessage(), it will show how to send a sms message,
//if input ‘d’ in the terminal, it will execute DialVoiceCall(), etc.
if (Serial.available())
switch(Serial.read())
{
case ‘t’:
Serial.println(“press ‘t’”);
SendTextMessage();
Serial.println(“done.”);
break;
case 'a' :
Serial.println("press 'a'");
mySerial.println("ATZ");
delay(100);
ShowSerialData();
mySerial.println("AT+CSMINS=?");
delay(100);
ShowSerialData();
mySerial.println("AT+CSMINS=<");
delay(100);
ShowSerialData();
mySerial.println("AT");
delay(100);
ShowSerialData();
mySerial.println("AT+IPR=19200");
delay(100);
ShowSerialData();
mySerial.print("AT+CPIN=");
mySerial.println(SIM_PIN_CODE);
delay(1000);
ShowSerialData();
Serial.println("done.");
break;
}
if (mySerial.available())
Serial.write(mySerial.read());
}
///SendTextMessage()
///this function is to send a sms message
void SendTextMessage()
{
Serial.println(“call SendTextMessage”);
mySerial.print(“AT+CMGF=1\r”); //Because we want to send the SMS in text mode
delay(100);
ShowSerialData();
mySerial.println("AT + CMGS = “+1664******1"”);//send sms message, be careful need to add a country code before the cellphone number
delay(100);
ShowSerialData();
mySerial.println(“Hello World!”);//the content of the message
delay(100);
ShowSerialData();
mySerial.println((char)26);//the ASCII code of the ctrl+z is 26
delay(100);
mySerial.println();
Serial.println(“SMS is ‘send’”);
}
void ShowSerialData()
{
while(mySerial.available()!=0)
Serial.write(mySerial.read());
}
I end up getting this from start to pressing “t”
RDY
+CFUN: 1
+CPIN: READY
+PACSP: 0
Call Ready
press ‘t’
call SendTextMessage
SMS is ‘send’
done.
The green power light is on, the red light is on, and the other green light flashes on for a sec and is off for 800ms or more. Hard to tell how much since this is my first time dealing with this.
If anyone can help me figure out if I have a problem with the type of sim card im using or the wiring that would be awesome!
Thanks so much.