GPRS+GPS communication

Hi! My project is using GPRS and GPS shield. My board has 2 UART ports so there will be no problem when I use the 2 shields. My codes for both shields works fine alone, but when I already integrated the two in one board, the code for the GPS doesnt continue (GPRS works), its like stuck in this command ptr = strstr(GPS_data, "$GPGGA"); //search GPGGA String but this command runs perfectly if I only use the GPS shield alone with the board. Im using 2 baud rates, 57600 for GPRS and 9600 for the GPS. What could possibly be the problem for this? Thank you!

By the way, this is the command for the GPS.

void SEND_data()
{
  digitalWrite(gpsPin, HIGH);
  
  Serial1.begin(9600); //GPS shield communication
  pinMode(TX1, OUTPUT);
  digitalWrite(TX1, HIGH);
  
  Serial1.write(Serial1.read()); 
  while(!ptr)
  {
    while(Serial1.available())
    delay(10);
    {
      GPS_data[i]=Serial1.read(); //output of the GPS
      i++;
      j=0;
      delay(10);
    }
    ptr = strstr(GPS_data,"$GPGGA"); //search GPGGA String

  }

By the way, this is the command for the GPS.

Not enough. Post all of your code.

Which Arduino are you using? Have you investigated how much free memory you have? http://playground.arduino.cc/Code/AvailableMemory#.UwshMhAZ65Q

Edit: Actually it was enough. A stupid mistake:

    while(Serial1.available())
    delay(10);

As soon as there is serial data, go into an endless loop. Not a bright idea.

There is NO reason for the delay(). Get rid of it.

Not enough. Post all of your code.

void setup()
{
  pinMode(gpsPin, OUTPUT);
  pinMode(gogoPin, OUTPUT);
  pinMode(sendPin, OUTPUT);
  
  digitalWrite(gpsPin, LOW);
  digitalWrite(gogoPin, LOW);
  digitalWrite(sendPin, LOW);
  
  Serial.begin(57600);
  initGPRS(); //initialize GPRS
  SEND_data();
}

void loop()
{}

void initGPRS()
{}

void SEND_data()
{
  digitalWrite(gpsPin, HIGH);
  Serial1.begin(9600); //GPS shield communication
  pinMode(tx1, OUTPUT);
  digitalWrite(tx1, HIGH);
  
  Serial1.write(Serial1.read()); 
  while(!ptr)
  {
    while(Serial1.available())
    {
      GPS_data[i]=Serial1.read(); //output of the GPS
      i++;
      j=0;
      delay(10);
    }
    ptr = strstr(GPS_data,"$GPGGA"); //search GPGGA String
digitalWrite(gogoPin, HIGH);
  } 
digitalWrite(sendPin, HIGH);

Which Arduino are you using? Have you investigated how much free memory you have?

Im using this arduino compatible board, Gizduino+ and a memory of 644K. http://www.e-gizmo.com/KIT/gizduino+%20164,324,644.html.

Size of my program.

Binary sketch size: 13,758 bytes (of a 64,512 byte maximum)

my problem is that "digitalWrite(sendPin, HIGH)" above doesnt light anymore, so basically the running code stops in the part of the "digitalWrite(gogoPin, HIGH);" just above the bracket ({).

Im using this arduino compatible board, Gizduino+ and a memory of 644K.

It really seems unlikely that a device with 64K of flash memory would have 644K of SRAM.

  Serial1.write(Serial1.read());

Regardless of whether there is serial data to read, or not, read some input from the GPS and send it back to the GPS. Why?

      delay(10);

Why? Artificially delay()ing reading serial data, in the hopes that the next byte arrives before you get back to reading it is...How shall I put this?...stupid.

      GPS_data[i]=Serial1.read(); //output of the GPS
      i++;

I don't suppose that it matters whether there is room in the array, or not. Actually, it matters a great deal.

    ptr = strstr(GPS_data,"$GPGGA"); //search GPGGA String

Assuming that GPS_data is defined correctly (an assumption I'm not willing to make), it is NOT a NULL terminated array of chars. As such, it should NOT be passed to a function that expects a NULL terminated array of chars. At least, not if you expect that function to actually do anything useful.

This time, post ALL of your code, or I'm going to pass on reading it.