piotrbocian
Newbie level 2
Hello everyone,
Currently I'm working on electronic circuit Atmega128<->SIM300<->Internet. I want to download data via gsm modem from the website. Everything goes fine, I get html content, but suddenly (and always at the same moment) at the end of transmission, sim300 breaks the TCP connection by sending to Atmega: CLOSED.
Below my log of http request and received data (ECHO on SIM300 is ON).
HTTP request:
(each line ends with \r\n, and one empty line at the end)
SIM300 response:
Although there are 600 lines, sim300 closes connection and switch to command mode.
A few observations:
1. Some of the servers works fine and some of them closes connection as before.
2. I suppose, that sim300 in some way parses "Connection: close" from http header. But eg firefox, wget, ethernut on atmega and other programs sending http request also get "Connection: close" and they receive whole html content.
3. I am not able to trace the tcp traffic because server is not mine.
Does anyone encountered similar problems or have an idea of what it can be caused by? Will appreciate any reply
PS. website mentioned above (html content and addresses) are for tests, so feel free if you would like to test it.
Piotr
Currently I'm working on electronic circuit Atmega128<->SIM300<->Internet. I want to download data via gsm modem from the website. Everything goes fine, I get html content, but suddenly (and always at the same moment) at the end of transmission, sim300 breaks the TCP connection by sending to Atmega: CLOSED.
Below my log of http request and received data (ECHO on SIM300 is ON).
HTTP request:
Code:
GET /martifer/baza_czyt.php HTTP/1.1
Host: ercp.home.pl:80
Connection: Keep-Alive
Accept: */*
SIM300 response:
Code:
Call Ready
at+cops?
+COPS: 0,0,"06"
OK
AT+CIPMODE?
+CIPMODE: 0
OK
AT+CIPMODE=1
OK
AT+CIPCCFG=3,4,256,1
OK
at+cipstatus
OK
STATE: IP INITIAL
at+cstt="INTERNET","",""
OK
at+cgdcont=1,"IP","INTERNET"
OK
AT+CDNSCFG="153.19.0.50"
OK
at+cipstatus
OK
STATE: IP START
at+ciicr
OK
at+cifsr
109.243.36.248
at+cipstatus
OK
STATE: IP STATUS
AT+CDNSORIP=1
OK
at+cipstart="TCP","ercp.home.pl","80"
OK
CONNECT
HTTP/1.1 200 OK
Connection: close
Content-Type: text/html
Date: Tue, 13 Apr 2010 16:07:00 GMT
Server: IdeaWebServer/v0.70
X-Powered-By: PHP/5.2.6
1;Marek Homeowski;00
2;Marek Homeowski;00
3;Marek Homeowski;00
4;Marek Homeowski;00
5;Marek Homeowski;00
6;Marek Homeowski;00
7;Marek Homeowski;00
8;Marek Homeowski;00
9;Marek Homeowski;00
10;Marek Homeowski;00
11;Marek Homeowski;00
12;Marek Homeowski;00
13;Marek Homeowski;00
(...) // here go all the same rows with incremented index
533;Marek Homeowski;00
534;Marek Homeowski;00
535;Marek Homeowski;00
536;Marek Homeowski;00
537;Marek Homeowski;00
538;Marek Homeowski;00
539;Marek Homeowski;00
540;Marek Homeowski;00
541;Marek Homeowski;00
542;Marek Homeowski;00
543;Marek Homeowski;00
544;Marek Homeowski;00
5 // '5' as the first byte of new line is the last received byre
CLOSED
Although there are 600 lines, sim300 closes connection and switch to command mode.
A few observations:
1. Some of the servers works fine and some of them closes connection as before.
2. I suppose, that sim300 in some way parses "Connection: close" from http header. But eg firefox, wget, ethernut on atmega and other programs sending http request also get "Connection: close" and they receive whole html content.
3. I am not able to trace the tcp traffic because server is not mine.
Does anyone encountered similar problems or have an idea of what it can be caused by? Will appreciate any reply
PS. website mentioned above (html content and addresses) are for tests, so feel free if you would like to test it.
Piotr