mono_girl
Newbie level 5
- Joined
- Feb 3, 2014
- Messages
- 8
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 50
Hi Everyone
I am working on a project sim900(simcom) GPRS and i am using atmega324p micro controller
I am sending AT commands through micro-controller to web-server and i am watching the response of AT commands through UART on a terminal
I was able to send data to the remote server using Get Method
NOW,I want to send data to remote server using HTTP protocol POST Method
But i have "500 Internal server error" response and i don't know what's the problem
can you help me please ?
Here is the code
>> means command from micro-controller to GPRS
<<means response from GPRS on terminal
what i am doing wrong ? !
I am working on a project sim900(simcom) GPRS and i am using atmega324p micro controller
I am sending AT commands through micro-controller to web-server and i am watching the response of AT commands through UART on a terminal
I was able to send data to the remote server using Get Method
NOW,I want to send data to remote server using HTTP protocol POST Method
But i have "500 Internal server error" response and i don't know what's the problem
can you help me please ?
Here is the code
>> means command from micro-controller to GPRS
<<means response from GPRS on terminal
Code:
>> AT
>> CR LF //carriage return and line feed
<<CR LF OK CR LF
>> AT+CPIN?
>> CR LF //carriage return and line feed
<< CR LF +CPIN READY CR LF
<<CR LF ok CR LF
>>AT+CGATT=1
>> CR LF //carriage return and line feed
<<CR LF OK CR LF
>>AT+CREG?
>> CR LF //carriage return and line feed
<<CR LF OK CR LF
<< CR LF +CREG :0,1 CR LF
>> AT+SAPBR=3,1,"CONTYPE","GPRS"
>> CR LF //carriage return and line feed
<<CR LF OK CR LF
>> AT+SAPBR=3,1,"APN","mobinilweb"
>> CR LF //carriage return and line feed
<<CR LF OK CR LF
>>AT+SAPBR=1,1;
>> CR LF //carriage return and line feed
<<CR LF OK CR LF
>>AT+HTTPINIT
>> CR LF //carriage return and line feed
<<CR LF OK CR LF
>>AT+HTTPPARA="CID",1
>> CR LF //carriage return and line feed
<<CR LF OK CR LF
>> AT+HTTPPARA="URL","http://myserver.com:80/Gprs2/Gprs_3/Service1.asmx/HelloWorld"
>> CR LF //carriage return and line feed
<<CR LF OK CR LF
>>AT+HTTPDATA= 100,10000
>> CR LF //carriage return and line feed
<<CR LF DOWNLOAD CR LF
>>POST /Gprs2/Gprs_3/Service1.asmx/HelloWorld HTTP/1.1
>> CR LF //carriage return and line feed
>>Host: myserver.com:80
>> CR LF //carriage return and line feed
>> u=123 //data to be sent
>> CR LF //carriage return and line feed
>> CR LF //carriage return and line feed
>>ctrl-Z
>>AT+HTTPREAD
>> CR LF //carriage return and line feed
<< CR LF +HTTPREAD :100 CR LF
<< POST /Gprs2/Gprs_3/Service1.asmx/HelloWorld HTTP/1.1
<<Host: myserver.com:80
<<Content-Type: a CR LF
<<CR LF OK CR LF
>>AT+HTTPACTION=1
>> CR LF //carriage return and line feed
<<CR LF OK CR LF
<<CR LF +HTTPACTION:0,500,30 CR LF
//here is 500 internal sever error,,the response should be +HTTPACTION:0,200,30
>> AT+HTTPTERM
>> CR LF //carriage return and line feed
<<CR LF OK CR LF
what i am doing wrong ? !
Last edited: