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!
For your vodafone sim, apn is www. Username and password can be left blank.Hi sir,
Please tell me how can i get the APN, user name and password for the network, that I am using.
Thanks.
You can set the message path using AT+CGSMS commandIf I want to send data to my mobile phone using gprs, what will be the commands or code?
If you are using SIM900, there is no AT+CDNSORIP command.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.
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 ?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?