GSM sending data in interval is not working .

I am trying to keep sending data in interval of 20 seconds , but instead of sending one record per 20 seconds, two records together getting sent at once in 40 seconds.please suggest if this is usual behaviour with the GPRS or we are missing something.

GSM i am using is GL865 and arduino uno.

Please share your feedback.

~Som

or we are missing something.

We certainly are.

Please share your feedback.

Read this before posting a programming question

Please share your code

Please find the code snippet of my program :

mySerial.println("AT&K=0");
        smart_delay(2000);
        mySerial.println("AT+CGDCONT=1,\"IP\",\"www\",\"0.0.0.0\",0,0");
        smart_delay(3000);
        mySerial.println("AT#GPRS=1");
        smart_delay(3000);
        mySerial.println("AT+CGPADDR=1");
        smart_delay(3000);
        mySerial.println("AT#SCFG=1,1,300,90,600,250");
	    smart_delay(5000);
	
	
	
	while(1)
	{
		    mySerial.println("AT+CREG?");
				
			mySerial.println("AT#CGPADDR=1");
			smart_delay(4000);
			
			mySerial.println("AT#SGACT=1,1");                         
			mySerial.println("AT#SD=1,0,80,\"XXXXXXXX.com\"");
			
                 
		        req = "\r\nGET /?func=updateDeviceLoc&params=";               
                req.print(1);
				req+=":"; 
				req.print(flat,6);           
                req+=":";           
                req.print(flon,6);           
                req+=" HTTP/1.1\r\nHost: XXXXXXXXXXXXX.com\r\nConnection:keep-alive\r\n";
		        mySerial.println(req);
                smart_delay(20000);
			
	} 
	
	
	
	
	// smart_delay() function .
	static void smart_delay(unsigned long ms)
   {
	
	int x=0;
	char c;
	unsigned long start = millis();
	do 
	{
		while (mySerial.available())
		{
			c=mySerial.read();
			
		}
	} while (millis() - start < ms);
	
}

UKHeliBob: Read this before posting a programming question

Please share your code

Let me know if you find any error.

It's work fine.the only issue is sending 2 data in 40 seconds

Did you actually read this before posting a programming question ?

Did it suggest posting a code snippet ?

This site may be able to help with code snippets