Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Sim 340c HTTP Request

Status
Not open for further replies.

Mohamed.Metwally

Newbie level 4
Joined
Jun 22, 2011
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,325
hi ,
I am using Sim 340c to make an HTTP request, but i can't find any specific command to do this, what i reach from searching the internet is -->after making connection, we can issue send by at+cipsend and waite for > prompt and then send this strings

->GET / HTTP/1.1 //Send data - this example is an HTTP request for the google
-> Host: Google
-> Connection: Keep-Alive
-> Accept: */*
-> Accept-Language: en-us

but how i could send this ?
 

"i can't find any specific command to do this"
AT+CIPSEND is a command specific sending tcp data through gprs.

"how i could send this"
Just like you send the command. Write these http commands to UART of your module.
 

Hi.
I have some problem with CIPSEND
Here are what I have on terminal:

//send CPIN?:
+CPIN: READY

OK

//send CREG?:
+CREG: 0,1

OK

//send CSQ?:
+CSQ: 27,0

OK

//send "AT+CIPSHUT\r":
SHUT OK

//send "AT+CGATT=1\r":
OK

//send "AT+CGDCONT=1,\"IP\",\"v-internet\"\r":
OK

//send"AT+CSTT=\"v-internet\"\r:
OK

//send"AT+CIICR\r":
OK

//send "AT+CIFSR\r":
171.232.62.59

//send "AT+CIPSTATUS\r":
OK

STATE: IP STATUS

//send "AT+CIPSTART=\"TCP\",\"google.com\",\"80\"\r":
OK

CONNECT OK

//send "AT+CIPSEND\r":
> DataSend\x1A


The command CIPSEND respond ">" then I enter data and ends with "\x1A" (Ctrl + Z).
Then it does not respond anything.
As I know, it respond "SEND OK", "CLOSED" or something like that.
Please help me to solve this.
Tks..
 

Hi, after some tries I figured out what i did wrong?
it was a syntax error, to make an HTTP request GET/POST you must leave the first line empty (blinked line), then write the HTTP Request field, and leave the last 2 lines empty blinked then but your termination character .

Hi ThiVU,
check if you really concatenate this termination character with the data, watch the buffer that you send,and make sure that the termination character is the last thing in the buffer.
if you are using strcat(), strcat make the concatenation to the first argument, and if the length of this argument aren't enough to hold the length of first argument + the second argument , it will over write on the next var in the memory and this may lead to wrong var and wrong code behavior .
if you check those things, and the problem still their, you may have a Connection problem with this server as send OK means TCP ACK.
 
Last edited:

it respond "SEND OK", "CLOSED" or something like that.
Please help me to solve this.
Tks..

If the module does not respond any thing, it means it is still waiting for data input termination character (ctrl+z) in this case.
Make sure that the module receives that 0x1A.
Try connecting the module directly with PC and send the commands from Hyper Terminal. It will clear all doubts of string concatenation and buffer overflow.
 

The buffer is OK. I checked it.
I also use "0x1A" to send sms successfully.
After command CIPSEND, I use CIPSTATUS to query status and the modem respond :
OK

STATE: IP STATUS

Any idea??
 

I tried it and you can see the responses:
-----------------------------------------------------
>>at+cipstart="TCP","www.Google.com","80"
<<OK

<<CONNECT OK

>>at+cipsend
> TEST
<<SEND OK

at+cipstatus
OK

STATE: CONNECT OK

--------------------------------------------
so the state is CONNECT OK

try at+cipclose
if it gives you error, that's mean you aren't connected to the server.

I believe STATE: IP STATUS , this mean your device is not Connected, or lose the Connection after a while, you could check the latency between AT+CIPSTART and AT+CIPSEND, another thing,but i am not sure of it, the size of the data you are sending is very big and take time bigger than the server time out, you could try another site with a big time out i mean less security than google and it might work.
 

Thank you.
May be problem from my server.
I 've tested with server of SIMCOM. The support has received my data then reply to me. They are very kindly.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top