I have a Telit HE910 cellular modem communicating over UART to AVR. I am issuing the AT command for HTTP GET to a server. According to the modem datasheet, I should get three carrots (<<<) and then the data stream from the server. I get the three carrots but no data. The HTTP response code is 200 (ok) with a content length of 0. On the server side, I am logging the request so I can verify the GET request is hitting the server. So on both the server and the modem, I get OK's but no data. I can perform a GET request to the server from another web page and it works fine. Does anyone have any ideas of what could cause this?
PHP page is just echoing strings out on the request. For example
<php?
header('Content-type: text/plain');
echo 'Test';
?>
AVR / Modem code
sprintf(buf, "#HTTPCFG=0,\"%s\",80,0,,,0,120,1", host);
AT_ASSERT(AT_OK == AT_SendCommand(buf, response));
sprintf(buf, "#HTTPQRY=%d,%d,%s%c",
get_profile(),
0,
page,
CR);
AT_ASSERT(AT_OK == AT_SendCommand(buf, response));
sprintf(buf, "AT#HTTPRCV=0%c", CR);
UART0_TxString(buf);
c = UART0_RxChar();
response[0]=c;
i=0;
while((c=UART0_RxChar()) != CR)
{
response[i++]=c;
}
UART1_Flush();
UART1_Printf("received: %s\n", response);
Response in Terminal
received:
<<<
HTTP POST Complete
There should be data behind the <<< according to datasheet
Okay, it turns out that nothing was wrong with the C code on the AVR. I found a test server for HTTP GET request and tested the module successfully on a that site. So the underlying issue is with the PHP file in responding to the HTTP GET request.