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.

SIM900 command for send query "GET / HTTP/1.1" to a server

Status
Not open for further replies.

evildeejay

Newbie level 2
Joined
Apr 8, 2011
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,320
Hello everybody,
i'm new on this site, i've searched for another similar topic and i didn't found something good for my question.
I want to know how i can get the information from a server using the AT command on a SIM900.
I think the the needed passages are:
1) Start an GPRS connection
2) Start TCP connection to ip (like the ip of Google)
3) choose the port: 80 (http in this case)
4) send the command "GET / HTTP/1.1\n" to request the information
5) read the output of SIM900

i'm blocked on 4 point:
after choose the GPRS parameters
AT+CSTT="internet.wind" -> OK
after start connection
AT+CIICR -> OK
i've checked my ip and the output is real
AT+CIFSR -> 151.83.xxx.xxx
i started the connection with
AT+CIPSTART="TCP","[IP GOOGLE]","80" -> OK
and now i'm blocked...
someone can help me please?

Thank you so much!
 

perhaps you can follow this
Code:
This is how you send AT commands to SIM300 module to setup GPRS connection.

'->' indicates data sent to the SIM300 module from your MCU
'<-' indicates data returned from the SIM300 module.

to use this example you need to get the APN, user name and password for the network you are using SIM300 on. example shows how to connect to google home page.
Quote:First you need to open a PDP context.

-> AT+CGATT=1 //Attach to GPRS Service
<- OK

-> AT+CGDCONT=1,"IP","<Your APN Name>" //Define PDP Context (cid, PDP type, APN)
<- OK

-> AT+CDNSCFG="xxx.xxx.xxx.xxx","xxx.xxx.xxx.xxx" //Configure primary and secondary Domain Name Servers
<- OK

-> AT+CSTT="<Your APN Name>","<User ID>","<PASSWORD>" //Start Task & set APN, User ID, and password
<- OK

-> AT+CIICR //Bring up wireless connection with GPRS - THIS MAY TAKE A WHILE
<- OK

-> AT+CIFSR //Get Local IP address
<- xxx.xxx.xxx.xxx //returns IP address assigned to your module
<- OK

-> AT+CIPSTATUS //Get Connection Status
<- OK
<- STATE: IP STATUS //returns status of connection, needs to be 'IP STATUS' before you can connect to a server

-> AT+CIPHEAD=1 //Tells module to add an 'IP Header' to receive data
<- OK

-> AT+CDNSORIP=1 //Indicates whether connection request will be IP address (0), or domain name (1)
<- OK

-> AT+CIPSTART="TCP","www.google.com","80" //Start up TCP connection (mode, IP address/name, port)
<- OK
<- CONNECT OK //Indicates you've connected to the server - this command may take time to give this response

-> AT+CIPSEND //Issue Send Command
<- > //wait for module to return '>' prompt to indicate it's ready to receive data
-> GET / HTTP/1.1 //Send data - this example is an HTTP request for the google
-> Host: http://www.google.com
-> Connection: Keep-Alive
-> Accept: */*
-> Accept-Language: en-us
->
<- //data from server returned - Server will return data here
 
Thanks for the code...
I tested it, but when I send, I recieve nothing!
Would you please help me?
My deivce is Sim900!
 
Thanks for the code...
I tested it, but when I send, I recieve nothing!
Would you please help me?
My deivce is Sim900!

You must end the sent data with newline then CONTROL Z from keyboard
 
I've done it and revieced "SEND OK" but still no answer from the server!
 
Dear molisoft

if you want to go to the next line you should press CNTL + M and CNTL + J
at the last line you should press CNTL + M and CNTL + J twice.
and at the end press CNTL+Z

I did and got data from google website. but have another problem :
I got 404 Error not find !!!

does any one know the reason ?
 
Anybody help please,
I am work with SIM900 module, and i send commands with lpc1768 over UART but i see every i send command comeback to me,
for example,
I send,
"ATE0\r\n" it send me same string
"AT+CPIN?\r\n" it send me same string,
which command i send it send me back,

But when i send command on computer after i send ATE0 it dont send me the same commads it give me correct answer,
i dont understand what is problem,
Anybody have any idea how can i solve this problem,
thanks in advance,
 
Helo to all,
I am working on Simcom GSM/GPS Module SIM908....I am able to get GPS data from module....
but how can i find find particular location using gps data using GPRS..?

Can anybody help me?

Thanks in advance.
 

hi,

how can we check that is our gprs connection alive or not?

imagine i wanna check my gprs connection every 3 seconds, and if its not, I reconnect to the server again!

thx...
 

hi

dear saesaria
thanks for the code ,
when i recive ">" from module , i can write some string ,
in the other side , what happens? how to recive this string in server side ?
for example i send "heloo baby"
what is beeing recived in the server side??the same thing?
 

Hi sir,

Please tell me how can i get the APN, user name and password for the network, that I am using.

Thanks.
 

Re: SIM900 command for send query &quot;GET / HTTP/1.1&quot; to a server

you should contact your GSM-GPRS service provider , but mostly you can use "internet" in APN's place :)

- - - Updated - - -

behnam9856

at+cipstatus
 
Re: SIM900 command for send query &quot;GET / HTTP/1.1&quot; to a server

before running the gprs, i have tried to send a message through sim900.
but after command
AT+CMGS="mob no"
a loop is running continously.
i also have done steps
1) switch off the power.
2)tried with other sim
but every time i get this running loop.
loop is:
call ready
+creg: 1
IIII
rdy
cfun: 1
+cpin: ready
+creg: 0
+creg: 2
help me to get out of this loop.

Thanks for reply
 
  • Like
Reactions: acp27

    acp27

    Points: 2
    Helpful Answer Positive Rating
Hi sir,

Please tell me how can i get the APN, user name and password for the network, that I am using.

Thanks.
For your vodafone sim, apn is www. Username and password can be left blank.
So, use like this:
AT+CSTT="www",,
 

Re: SIM900 command for send query &quot;GET / HTTP/1.1&quot; to a server

Sir,
Can you please tell me.
Actually now my gprs is working.
But for checking its proper functionality, I need to connect it to another server and transfer data.
Plz tell me where can I get this temporary server( IP Address & port no), to transfer data with it.

Thanks a lot.

- - - Updated - - -

And if I want to send data to mobile phone.
plz tell wat will be the code
 

Re: SIM900 command for send query &quot;GET / HTTP/1.1&quot; to a server

Sir,

If I want to send data to my mobile phone using gprs, what will be the commands or code?

- - - Updated - - -

Sir,
everytime I am using this code, I am getting error at the command line AT+CDNSORIP=1
I have also tried to continue, but again at command
at+cipstart="TCP,"www.google.com","80"
ok
connect fail
please help me out.
 

Re: SIM900 command for send query &quot;GET / HTTP/1.1&quot; to a server

If I want to send data to my mobile phone using gprs, what will be the commands or code?
You can set the message path using AT+CGSMS command
AT+CGSMS=0 will select the path as gprs.
But, i think your service provider should activate this

everytime I am using this code, I am getting error at the command line AT+CDNSORIP=1
I have also tried to continue, but again at command
at+cipstart="TCP,"www.google.com","80"
ok
connect fail
please help me out.
If you are using SIM900, there is no AT+CDNSORIP command.
Also, confirm that you have enough balance in your sim and good signal level.
Check datasheet for more details about AT commands for your modem
 
  • Like
Reactions: acp27

    acp27

    Points: 2
    Helpful Answer Positive Rating
This is how you send AT commands to SIM300 module to setup GPRS connection.


>> AT+CGATT=1 - Attach to GPRS Service
<< OK

>> AT+CGDCONT=1,"IP","<apn>" - Define PDP Context (cid, PDP type, APN)
<< OK

>> AT+CSTT="<apn>","","" - Start Task & set APN, User ID, and password
<< OK

>> AT+CIICR - Bring up wireless connection with GSM or CDS
<< OK

>> AT+CIFSR - Get Local IP address
<< 10.190.245.172
<< OK

>>AT+CIPSTATUS - Query current connection status
<< OK
<< STATE: IP STATUS

>> AT+CIPHEAD=1 - to add an 'IP Header' to receive data
<< OK

>> AT+CDNSORIP=1 - query the IP address of the given domain name
<< OK

>> AT+CIPSTART="TCP","www.india.com","80" - Start up TCP connection
<< OK
<< CONNECT OK - Indicates you've connected to the server

>> AT+CIPSEND - Issue Send Command
<< >
>> GET /testdata.php?data=Prateek HTTP/1.1 (ctrl+m)(ctrl+j)
>>HOST: www.india.com (ctrl+m)(ctrl+j) (ctrl+j)(ctrl+z)
<< SEND OK

<< server send data back


can any one help me to execute this commands set on SIM908
command AT+CDNSORIP=1 is not working on sim908
 

Dear molisoft

if you want to go to the next line you should press CNTL + M and CNTL + J
at the last line you should press CNTL + M and CNTL + J twice.
and at the end press CNTL+Z

I did and got data from google website. but have another problem :
I got 404 Error not find !!!

does any one know the reason ?



HEY , I M GETTING ERROR 400
SEND OK
HTTP/1.0 400 Bad Request
Content-Type: text/html; charset=UTF-8
Content-Length: 925
Date: Mon, 04 Feb 2013 18:03:05 GMT .. i pressed the keys as instructed by u , plzz help
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top