i have a problem to combine my coding. here's i provide my full coding.

#include "SIM900.h"
#include <TinyGPS++.h>
#include <SoftwareSerial.h>
#include "inetGSM.h"
#include "sms.h"

static const int RXPin = 4, TXPin = 5;
static const uint32_t GPSBaud = 9600;
TinyGPSPlus gps;
SoftwareSerial ss(RXPin, TXPin);

InetGSM inet;
SMSGSM sms;

char msg[50];
boolean started=false;
char imei[17];
char res;

void setup()
{
     Serial.begin(115200);
     ss.begin(GPSBaud);
     smartDelay(1000);
}

void loop()
{
   if(gps.location.lat()&&gps.location.lng()!=0){
     Serial.println("value found");
     sendLocation(gps.location.lat(),gps.location.lng());
     //checkSms(gps.location.lat(),gps.location.lng());
    }
    else{
     Serial.println("no value");
    }
    smartDelay(1000);
}

void sendLocation(float a,float b){
     if(gsm.begin(9600)){
          Serial.println("\nstatus=READY");
          gsm.getIMEI(imei);
          started=true;
     } 
     else Serial.println("\nstatus=IDLE");
     if(started){
          if(inet.attachGPRS("celcom3g", "", ""))
               Serial.println("status=ATTACHED");
          else 
               Serial.println("status=ERROR");
          smartDelay(3000);
          char lati[15];
          char longit[15];
          dtostrf(a,11,9,lati);
          dtostrf(b,12,9,longit);
          char data[100];
          data[0]=0;
          strcat(data,"/arduinoGetLocation.php?device_id=");
          strcat(data,imei);
          strcat(data,"&latitude=");
          strcat(data,lati);
          strcat(data,"&longitude=");
          strcat(data,longit);
          Serial.print(lati);
          Serial.print(' ');
          Serial.print(longit);
          Serial.println();
          Serial.println(data);
          inet.httpGET("www.vtracksys.com", 80, data, msg, 50); //send gps value to database server
          char number[15];
          char message[180];
          char pos;
          char *p;
          pos=sms.IsSMSPresent(SMS_UNREAD); //check if sms is present
          if((int)pos>0&&(int)pos<=20){
            Serial.println((int)pos);
            message[0]='\0';
            sms.GetSMS((int)pos,number,message,180);
            char check[100];
            check[0]=0;
            strcat(check,"/arduinoCheckHpNo.php?device_id=");
            strcat(check,imei);
            strcat(check,"&contactNo=");
            strcat(check,number);
            Serial.println(check);
            inet.httpGET("www.vtracksys.com", 80, check, msg, 50); //check if  the number registered
            gsm.SimpleRead(res);
            p=strstr(message,"Track"); //if number is registered and message equals to "Track"
            if(p&&res == '#'){
              char link[100];
              link[0]=0;
              char latit[15];
              char longitu[15];
              dtostrf(a,11,9,lati);
              dtostrf(b,12,9,longit);
              strcat(link,"Hi, your vehicle's location is :  www.google.com/maps/?q=");
              strcat(link,lati);
              strcat(link,",");
              strcat(link,longit);
              Serial.println(link);
              sms.SendSMS(number, link); //send the link to user to view the location via google maps
            }
            else {
              Serial.print("wrong command!");
            }
            smartDelay(1000);
            sms.DeleteSMS((int)pos);// delete the message
          };
      }
}

static void smartDelay(unsigned long ms)
{
  unsigned long start = millis();
  do 
  {
    while (ss.available())
      gps.encode(ss.read());
  } while (millis() - start < ms);
}

anyone know what is the problem? please…

You need to tell us what the problem is and then maybe we can suggest a solution?

If you get error messages when you try to compile the code, post the messages

If the program works, but not as you want it to, tell us what it actually does and what it should do.

Also tell us what Arduino you are using and exactly what extra hardware you are using - links to datasheets for the hardware would be good.

...R

I'm going to guess you've run out of RAM.

Hi,Robin2 sorry for that. ok the coding is running well but is not running the way i want it. the coding should always update the gps location to the database server.Then, it will check if there's sms present in the inbox message. Thus,if sms is present it will verify the phone number from the message received if the number has been registered or not and whether the user sending a correct command(the default command is "Track"). If the phone number registered and the command used is correct, it should reply the message in the form of link to google maps and passing the gps value into it. So, when the user click the link received they will able to view the location.

the hardware i'm using are : 1. DCCDuino Arduino Nano

  1. SIM900A gsm Module

  2. GY-GPS6MV2 gps module

Hi, AWOL if that really the problem. what should i do to solve it? actually i'm a beginner to arduino playground.

You should start by using the F() macro to make sure strings in Serial.prints stay in flash memory, and rather than use "strcpy", strcat" etc, you should use the AVR-specific "strcpy_P" "strcat_P" versions instead.

Alright thanks AWOL,will do it later. How about the spacing between the code does it takes up any memory? and any idea how to store the global variable into flash(or EEPROM mybe) instead of sram?

Elvin_Malih: Hi,Robin2 sorry for that. ok the coding is running well but is not running the way i want it. the coding should always update the gps location to the database server.Then, it will check if there's sms present in the inbox message. Thus,if sms is present it will verify the phone number from the message received if the number has been registered or not and whether the user sending a correct command(the default command is "Track"). If the phone number registered and the command used is correct, it should reply the message in the form of link to google maps and passing the gps value into it. So, when the user click the link received they will able to view the location.

As far as I can see you have described what SHOULD happen but I can't see any description of what ACTUALLY happens - apart from "not running the way i want"

You need to provide some guidance to help pinpoint the problem.

What tests have you carried out yourself?

...R

Robin2: As far as I can see you have described what SHOULD happen but I can't see any description of what ACTUALLY happens - apart from "not running the way i want"

You need to provide some guidance to help pinpoint the problem.

What tests have you carried out yourself?

...R

from the code i provide earlier,when i upload it and try to run it. The process stop at the middle of the "gsm.begin(9600);" in the sendLocation function. The process stay right there and won't continue with the rest of the code. i dont have any idea what is the problem actually. its my first time to work with arduino hardware and coding. This program is for my final year project.

How about the spacing between the code does it takes up any memory?

I'm not sure if I understand you, but if you're asking if the whitespace in your sketch takes up any memory in your compiled code, the answer is no, it takes neither RAM nor flash.

any idea how to store the global variable into flash(or EEPROM mybe) instead of sram?

EEPROM has a finite number of erase/write cycles (though reads are effectively infinite), so you need to pick the values you want to store very carefully.

AWOL: I'm not sure if I understand you, but if you're asking if the whitespace in your sketch takes up any memory in your compiled code, the answer is no, it takes neither RAM nor flash. EEPROM has a finite number of erase/write cycles (though reads are effectively infinite), so you need to pick the values you want to store very carefully.

yes i mean the whitespace. for your information i'm using the DCCDuino arduino nano which has smaller memory. will the problem of running out of sram solved when i change the board to mega 2560 arduino board?

Elvin_Malih: from the code i provide earlier,when i upload it and try to run it. The process stop at the middle of the "gsm.begin(9600);" in the sendLocation function.

That is a useful pointer.

I am not familiar with the libraries you are using but I wonder if your gsm.begin() should really be inet.begin() and similar changes wherever you use gsm.

I don't see anything in your code declared with a name gsm but you do have a declaration InetGSM inet;

...R