Request Helps of SIM900A (Send MMS).

I am doing a school Project of sending a Picture (jpg) MMS to my phone number. The pic is from the SD Card module and SIM900A and SD card Module are connected to the Arduino Mega Board. I am wondering whether the pic cannot be send from the SD card Module to the SIM900A or my Program Problems or others? I am appreciate if anyone can offer helps!

The Program i am using. When i download the program to the Arduino Mega Board.
I will open the Serial Monitor and Type “s” to run the void sendMMS()
/////////////////////////////////////////
#include <SD.h>

//#define PWR 47
#define CS 53

File dataFile;
int i;
unsigned char data=0;

void setup()
{
//pinMode(PWR,OUTPUT);
pinMode(CS,OUTPUT);
Serial.begin(9600);
Serial2.begin(19200);
//digitalWrite(PWR,LOW);
//delay(10);
//digitalWrite(PWR,HIGH);
//delay(10);

if (!SD.begin(CS)) Serial.println(“initialization failed!”);
else Serial.println(“initialization done.”);
}

void loop()
{
if(Serial2.available())
{
while(Serial2.available())
{
data=Serial2.read();
Serial.write(data);
}
data=0;
}

if(Serial.available())
{
data=Serial.read();
}

if(data==‘1’)
{
Serial2.print(“AT+CGMI\r”); //Manufacturer identification
}
if(data==‘2’)
{
Serial2.print(“AT+CGMM\r”); //Model identification
}

if(data==‘3’)
{
Serial2.print(“AT+CGMR\r”); //Software version
}

if(data==‘4’)
{
Serial2.print(“AT+CGSN\r”); //IMEI number
}

if(data==‘5’)
{
Serial2.print(“ATD+85298725687;\r”); //Calling
}

if(data==‘6’)
{
Serial2.print(“ATH\r”); //Hang Up
}

if(data==‘7’)
{
Serial2.print(“AT+CMGF=1\r”); //Set text mode
delay(100);
Serial2.print(“AT+CMGS=”); //Send message
Serial2.write((byte)0x22); //"
Serial2.print("+85262808722"); //Phone no
Serial2.write((byte)0x22); //"
Serial2.write((byte)0x0D); //Enter
Serial2.print(“Hai, I’m Arduino”);//Text message
Serial2.write((byte)0x0D); //Enter
Serial2.print(“Reply, if you receive this message”);//Text message
Serial2.write((byte)0x1A); //Ctrl+Z
}

if(data==‘8’)
{
Serial2.print(“AT+CMGR=1\r”); //Read message
}

if(data==‘9’)
{
Serial2.print(“AT+CMGD=1,0\r”); //Delete message
}

if(data==‘s’) sendMMS();
data=0;
}

void sendMMS()
{
Serial2.print(“AT+CMMSINIT\r”);
delay(100);
if(Serial2.available())
{
while(Serial2.available()) Serial.write(Serial2.read());
}

Serial2.print(“AT+CMEE=2\r”);
delay(100);
if(Serial2.available())
{
while(Serial2.available()) Serial.write(Serial2.read());
}

Serial2.print(“AT+CMMSCURL=“10.30.15.51:10021/mmsc”\r”);
delay(100);
if(Serial2.available())
{
while(Serial2.available()) Serial.write(Serial2.read());
}
Serial2.print(“AT+CMMSCID=1\r”);
delay(100);
if(Serial2.available())
{
while(Serial2.available()) Serial.write(Serial2.read());
}
Serial2.print(“AT+CMMSPROTO=“10.30.15.53”,8080\r”);
delay(100);
if(Serial2.available())
{
while(Serial2.available()) Serial.write(Serial2.read());
}
Serial2.print(“AT+CMMSSENDCFG=6,3,0,0,2,4\r”);
delay(100);
if(Serial2.available())
{
while(Serial2.available()) Serial.write(Serial2.read());
}
Serial2.print(“AT+SAPBR=3,1,“Contype”,“GPRS”\r”);
delay(100);
if(Serial2.available())
{
while(Serial2.available()) Serial.write(Serial2.read());
}
Serial2.print(“AT+SAPBR=3,1,“APN”,“mms-g.three.com.hk”\r”);
delay(100);
if(Serial2.available())
{
while(Serial2.available()) Serial.write(Serial2.read());
}
Serial2.print(“AT+SAPBR=5,3\r”);
delay(4000);
if(Serial2.available())
{
while(Serial2.available()) Serial.write(Serial2.read());
}
Serial2.print(“AT+SAPBR=2,1\r”);
delay(1000);
if(Serial2.available())
{
while(Serial2.available()) Serial.write(Serial2.read());
}
Serial2.print(“AT+CMMSEDIT=1\r”);
delay(100);
if(Serial2.available())
{
while(Serial2.available()) Serial.write(Serial2.read());
}
Serial2.print(“AT+CMMSDOWN=“PIC”,3000,2000000,“test.jpg”\r”);
delay(1000);
if(Serial2.available())
{
while(Serial2.available()) Serial.write(Serial2.read());
}

dataFile=SD.open(“test.jpg”);
i=0;
if(dataFile)
{
while(dataFile.available())
{
data=dataFile.read();
if(data<0x10) Serial.print(“0”);
Serial.print(data,HEX);
i++;
if((i%40)==0) Serial.println();
Serial2.write(data);
}
dataFile.close();
}
else
{
Serial.println(“error opening test.jpg”);
}

delay(1000);
Serial2.print(“AT+CMMSRECP=”+85298725687"\r");
delay(100);
if(Serial2.available())
{
while(Serial2.available()) Serial.write(Serial2.read());
}
Serial2.print(“AT+CMMSVIEW\r”);
delay(2000);
if(Serial2.available())
{
while(Serial2.available()) Serial.write(Serial2.read());
}
Serial2.print(“AT+CMMSSEND\r”);
delay(2000);
if(Serial2.available())
{
while(Serial2.available()) Serial.write(Serial2.read());
}
Serial2.print(“AT+CMMSEDIT=0\r”);
delay(2000);
if(Serial2.available())
{
while(Serial2.available()) Serial.write(Serial2.read());
}
Serial2.print(“AT+CMMSTERM\r”);
delay(2000);
if(Serial2.available())
{
while(Serial2.available()) Serial.write(Serial2.read());
}
}

////////////////////////////////////////////////

& this is the feedback i have on Serial Monitor on the attactment

SIM900 TEST ERROR.txt (10.8 KB)