Sei sulla pagina 1di 5

This is how you send AT commands to SIM300 module to setup GPRS connecti on.

'->' 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 networ 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 ty pe, APN) <- OK -> AT+CDNSCFG="xxx.xxx.xxx.xxx","xxx.xxx.xxx.xxx" //Configure primary an d secondary Domain Name Servers <- OK

-> AT+CIICR //Bring up wireless connection with GPRS - THIS MAY TAKE A W HILE <- OK -> AT+CIFSR //Get Local IP address <- xxx.xxx.xxx.xxx //returns IP address assigned to your module <- OK -> <<US' before AT+CIPSTATUS //Get Connection Status OK STATE: IP STATUS //returns status of connection, needs to be 'IP STAT 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 addre ss (0), or domain name (1) <- OK -> AT+CIPSTART="TCP","www.google.com","80" //Start up TCP connection (mo de, IP address/name, port) <- OK <- CONNECT OK //Indicates you've connected to the server - this command may ta e time to give this response -> AT+CIPSEND //Issue Send Command <- > //wait for module to return '>' prompt to indicate it's ready to re ceive 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: */*

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

& set

-> Accept-Language: en-us -> <- //data from server returned - Server will return data here To be honest I am worst in coding, but trying hard to level up. Reply With Quote Reply With Quote Alt Advertising advertising

17-09-11, 19:36 #3 molisoft molisoft is offline Newbie level 2 Points: 19, Level: 1 Join Date Sep 2011 Posts 2 Helped 0 / 0 Points 19 Level 1 Re: SIM900 command for send query "GET / HTTP/1.1" to a server Than s for the code... I tested it, but when I send, I recieve nothing! Would you please help me? My deivce is Sim900! Reply With Quote Reply With Quote Alt Advertising advertising

25-09-11, 10:07 #4 andycowley andycowley is offline Newbie level 1 Points: 13, Level: 1 Join Date Sep 2011

Posts 1 Helped 0 / 0 Points 13 Level 1 Re: SIM900 command for send query "GET / HTTP/1.1" to a server Quote Originally Posted by molisoft View Post Than s 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 eyboard Reply With Quote Reply With Quote 25-09-11, 19:13 #5 molisoft molisoft is offline Newbie level 2 Points: 19, Level: 1 Join Date Sep 2011 Posts 2 Helped 0 / 0 Points 19 Level 1 Re: SIM900 command for send query "GET / HTTP/1.1" to a server I've done it and revieced "SEND OK" but still no answer from the server!

Reply With Quote Reply With Quote 15-10-11, 13:51 #6 ma arbasi ma arbasi is offline Newbie level 2 Points: 220, Level: 2 Join Date Sep 2010 Posts 2 Helped 0 / 0 Points 220 Level 2

Re: SIM900 command for send query "GET / HTTP/1.1" to a 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 !!!

Reply With Quote Reply With Quote Alt Advertising advertising

15-10-11, 19:17 #7 bigBrotherX bigBrotherX is offline Newbie level 3 Points: 27, Level: 1 Join Date Oct 2011 Posts 4 Helped 0 / 0 Points 27 Level 1 Re: SIM900 command for send query "GET / HTTP/1.1" to a server Anybody help please, I am wor with SIM900 module, and i send commands with lpc1768 over UART but i see every i send command comebac 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 bac , But when i send command on computer after i send ATE0 it dont send me th e same commads it give me correct answer, i dont understand what is problem, Anybody have any idea how can i solve this problem, than s in advance,

does any one

now the reason ?

Reply With Quote Reply With Quote 02-11-11, 13:17 #8 bugme bugme is offline Newbie level 5 Points: 106, Level: 1 Join Date Jun 2011 Posts 8 Helped 0 / 0 Points 106 Level 1 Re: SIM900 command for send query "GET / HTTP/1.1" to a server Helo to all, I am wor ing on Simcom GSM/GPS Module SIM908....I am able to get GPS dat a from module.... but how can i find find particular location using gps data using GPRS..? Can anybody help me? Than s in advance. Reply With Quote Reply With Quote

Potrebbero piacerti anche