Can't close responses from my sim900 on webserver mode

Hello All,

I’m developing a webserver on Arduino with the sim900 chip.
The thing is that I can see requests coming from the internet to the arduino board; then write some response with the AT+CIPSEND command; but the problem comes when closing that connection, it never does, or very late. That browsers from internet notify a timeout error. I’m pretty sure there must be a way to close connection after sending response content.

Have you ever seen to this problem?

I’m using the GSM-GPRS-GPS-Shield libraries from http://www.gsmlib.org.

// ... receiveing characters from a web request ...
char iChar = gsm.read();
if(iChar == "$")
  sendResponse();

void sendResponse(){
  char end_c[2];
  end_c[0]=0x1a;
  end_c[1]='\0';

  gsm.SimpleWriteln("AT+CIPSEND");
  gsm.WaitResp(5000, 200, ">");
  delay(4000);

  gsm.SimpleWrite("HTTP/1.1 200 OK");
  gsm.SimpleWrite("\n");
  gsm.SimpleWrite("Content-Type: application/json");
  gsm.SimpleWrite("\n");
  gsm.SimpleWriteln("{'status':'ok'}");
  gsm.SimpleWrite(end_c);  
}

Thanks a lot for your help :wink:
Aritz

You do not check for an error or timeout from gsm.WaitResp(). The example code shows RX_TMOUT_ERR and RX_FINISHED_STR_NOT_RECV possible error returns. Is either of those coming back and you're not catching it?