Seeedstudio GPRS SIM900 v1.4 Sheild Baud/SMS issue.

#include <SoftwareSerial.h>

 
SoftwareSerial mySerial(7, 8);
 
void setup()
{
  mySerial.begin(2400);               // the GPRS baud rate   
  Serial.begin(19200);    // the GPRS baud rate 
   Serial.write(mySerial.read());
  delay(500);
  mySerial.print("AT+IPR?\r"); 
  delay(1000);
  //mySerial.print("AT+IPR=19200\r");
}
 
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':
       SendTextMessage();
       break;
     case 'r':
       ReadSMS();
       break;
   } 
  if (mySerial.available())
    Serial.write(mySerial.read());
}

 
///SendTextMessage()
///this function is to send a sms message
void SendTextMessage()
{
  mySerial.print("AT+CMGF=1\r");    //Because we want to send the SMS in text mode
  delay(100);
  mySerial.println("AT + CMGS = \"+1440#######\"");//send sms message, be careful need to add a country code before the cellphone number
  delay(100);
  mySerial.println("A test message from My Arduino!");//the content of the message
  delay(100);
  mySerial.println((char)26);//the ASCII code of the ctrl+z is 26
  delay(100);
  mySerial.println();
}

void ReadSMS()
{
  mySerial.print("AT+CMGL=\"ALL\"\r");    //Because we want to send the SMS in text mode
 
  mySerial.println();
}
 


 
void ShowSerialData()
{
  while(mySerial.available()!=0)
    Serial.write(mySerial.read());
}

If i set the SoftwareSerial baud rate to 2400 and have the AT+IPR set at 0 (auto baud) i can view the message text when i read a text message (in this code, pressing 'r') the output is such.

ÿAT+IPR?

+IPR: 0

OK
AT+CMGL="ALL"


+CMGL: 1,"REC READ","+1440#######","","14/04/03,12:52:33-16"
Pooo

+CMGL: 2,"REC READ","+1440#######","","14/04/03,12:57:08-16"
Pooopib

+CMGL: 3,"REC READ","+1440#######","","14/04/03,12:57:59-16"
Pooopey

OK

Further, I CANNOT SEND a text message pressing the 't' , the output is such:

AT+CMGF=1
AT + CMGS = "+1440#######"
A test message from My Arduino!



OK

Nothing is sent.

When i augment the SoftwareSerial baud to 19200 (i know the code is redundant but want to be verbose):

#include <SoftwareSerial.h>

 
SoftwareSerial mySerial(7, 8);
 
void setup()
{
  mySerial.begin(19200);               // the GPRS baud rate   
  Serial.begin(19200);    // the GPRS baud rate 
   Serial.write(mySerial.read());
  delay(500);
  mySerial.print("AT+IPR?\r"); 
  delay(1000);
  //mySerial.print("AT+IPR=19200\r");
}
 
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':
       SendTextMessage();
       break;
     case 'r':
       ReadSMS();
       break;
   } 
  if (mySerial.available())
    Serial.write(mySerial.read());
}

 
///SendTextMessage()
///this function is to send a sms message
void SendTextMessage()
{
  mySerial.print("AT+CMGF=1\r");    //Because we want to send the SMS in text mode
  delay(100);
  mySerial.println("AT + CMGS = \"+14408585040\"");//send sms message, be careful need to add a country code before the cellphone number
  delay(100);
  mySerial.println("A test message from My Arduino!");//the content of the message
  delay(100);
  mySerial.println((char)26);//the ASCII code of the ctrl+z is 26
  delay(100);
  mySerial.println();
}

void ReadSMS()
{
  mySerial.print("AT+CMGL=\"ALL\"\r");    //Because we want to send the SMS in text mode
 
  mySerial.println();
}
 

///SubmitHttpRequest()
///this function is submit a http request
///attention:the time of delay is very important, it must be set enough 

 
void ShowSerialData()
{
  while(mySerial.available()!=0)
    Serial.write(mySerial.read());
}

Trying to read text messages with 'r' produces

ÿAT+IPR?

+IPR: 0

OK
AT+CMGL="ALL"


+CMGL: 1,"REC READ","+1440#######","","14/04/03,12:52:33-16"

+CMGL: 2,"REC READ","+1440#######","","14/04/03,12:57:08-16"

+CMGL: 3,"REC READ","+1440#######

and respectively pressing t produces:

AT+CMGF=1

OK
AT + CMGS = "+1440#######"

> A test message 
+CMGS: 122

OK

The text message sends.

TL;DR: @ 2400 baud i can read text messages but not send
@ 19,200 baud i send text messages but not fully read.

I am not sure what issue i have at hand here? Any ideas?
I've tried connecting an external 5v 2a power supply with no change in results.
I've tried crating a buffer for softwareSerial.read @64 bytes, but that seeming did not help.
I also tried explicitly setting the baud on the SIM900 to both 2400 and 19,200.

It's not an answer to your question as such, but check the link in my sig below for some example sketches that may help you.

Thank you for your response. I see your SMS commands are quite small in character length. I would surmise, they might be shorter than 13 characters. I say this because that's where my SMS messages get chomped. In a later test i proved that SoftwareSerial doesn't have any more data for me by putting a Serial.println after while statement checks for SoftwareSerial.available and it says no more data exists.

I went to the SeeedStudio site and copied their exampled code:

//Serial Relay - Arduino will patch a 
//serial link between the computer and the GPRS Shield
//at 19200 bps 8-N-1
//Computer is connected to Hardware UART
//GPRS Shield is connected to the Software UART 
 
#include <SoftwareSerial.h>
 
SoftwareSerial GPRS(7, 8);
unsigned char buffer[64]; // buffer array for data recieve over serial port
int count=0;     // counter for buffer array 
void setup()
{
  GPRS.begin(19200);               // the GPRS baud rate   
  Serial.begin(19200);             // the Serial port of Arduino baud rate.
 
  Serial.write("Power On\n\n");

  GPRS.print("AT\r");    //Because we want to send the SMS in text mode
  delay(100);
  
  GPRS.print("AT+IFC=1,1\r");    //Because we want to send the SMS in text mode
  delay(100);
  AT+IFC=1, 1
    

  GPRS.print("SIMAT+CNMI=2,2,0,0,0\r");  // Read Messages immediatley upon receipt
  delay(100);
  
  GPRS.println((char)26);//the ASCII code of the ctrl+z is 26<
  delay(100);
 
 
}
 
void loop()
{
  if (GPRS.available())              // if date is comming from softwareserial port ==> data is comming from gprs shield
  {
    while(GPRS.available())          // reading data into char array 
    {
      buffer[count++]=GPRS.read();     // writing data into array
      if(count == 64)break;
  }
    Serial.write(buffer,count);            // if no data transmission ends, write buffer to hardware serial port
    clearBufferArray();              // call clearBufferArray function to clear the storaged data from the array
    count = 0;                       // set counter of while loop to zero
 
 
  }
  if (Serial.available())            // if data is available on hardwareserial port ==> data is comming from PC or notebook
    GPRS.write(Serial.read());       // write it to the GPRS shield
}
void clearBufferArray()              // function to clear buffer array
{
  for (int i=0; i<count;i++)
    { buffer[i]=NULL;}                  // clear all index of array with command NULL
}

This code produces the same chomped result when i send a text message to it.

That code won't even compile.

You don't (appear to) delete the messages from the sim card so try putting it in a phone and see what the look like on there?

Load the version of SerialRelay from the web page in my sig link.

Once the modem has locked on to a signal, issue the command AT&F - please note that this restores the factory default settings.

Issue the command AT+CMGF=1 to put it into text mode.

Now issue the command AT+CNMI=2,2,0,0,0 which will send all sms / texts received to the Serial Monitor.

Now send a message to the device and it should repeat on the Serial Monitor. I have tried 26 characters and all appear.

+CMT: "+44xxxxxxxxxx","","14/04/06,19:26:40+04"
Abcdefghijklmnopqrstuvwxyz

Edit: Changed the reset code and added the AT+CMGF=1 line. It doesn't affect the functionality but the result wouldn't be as shown.

Hey,

I'm new to the forum, but I have that same shield working on mine by increasing the SoftwareSerial buffer to 128. 64 bytes did get consumed by all the characters used by the responses from the GPRS shield. It might not be what you need but in my case I got it working changing it in the SoftwareSerial.h file.