Powerup the Sim900 module
connect it to the system through serial to USB or through FTDI cable.The TTl pins for FTDI is available near to the DB9 connector.
Open any serial Terminal porogram. In Linux i use GtkTerm. Select the correct port and set
Baudrate = 9600
parity = None
Bits = 8
Stop bits = 1
Flow Control = None
The AT Commands
I am posting the commands and its reply for better understanding. I am using an Airtel postpaid sim card.
Make sure you have enough balance on Sim card.
First Command
AT
OK If your response contains this, This string should tell you all is well
This is to check if SIM is unlocked.
AT+CPIN?
+CPIN: READY If your response contains this, then it means SIM is unlocked and ready
This checks if SIM is registered or not
AT+CREG?
+CREG: 0,1 This string in the response indicates SIM is registered
Check if GPRS is attached or not
AT+CGATT?
+CGATT: 1 A response containing this string indicates GPRS is attached
Reset the IP session if any
AT+CIPSHUT
SHUT OK This string in the response represents all IP sessions shutdown.
Check if the IP stack is initialized
AT+CIPSTATUS
STATE: IP INITIAL This string in the response indicates IP stack is initialized
single connection mode,if AT+CIPMUX=1 multi connection mode
AT+CIPMUX=0
OK This string indicates single connection mode set successfully at SIM 900
This sets the PDP context parameters such as PDP type (IP, IPV6, PPP, X.25 etc), APN, data compression, header compression etc.
AT+CGDCONT=1,"IP","airtelgprs.com"
OK If your response contains this, This string should tell you all is well
you need to know the APN, username and password for your service provider
AT+CSTT= “APN”, “UNAME”, “PWD”
For Airtel
AT+CSTT="airtelgprs.com"
OK If your response contains this, This string should tell you all is well
Bring up the wireless. The response to this might take some time
AT+CIICR
OK indicates wireless is up
Get the local IP address
AT+CIFSR
aa.bb.xx.yy If previous command is successful, you should an IP address in the response
comamnd returns the current connection status
AT+CIPSTATUS
STATE:IP STATUS if not this, some thing is wrong
Start the connection, TCP, domain name, port
AT+CIPSTART= "TCP","flaskprint.herokuapp.com","80"
CONNECT OK This string in the response indicates TCP connection established
Request initiation of data sending
AT+CIPSEND
The response should be the string “>” to indicate, type your data to send
Type anything after the prompt
>This is the Test Data
Now use Ctrl+Z key combination to indicate end of data sending
You should get some response back from the server. Normally some error message. But you have established the connection
To close the connection
AT+CIPSHUT
SHUT OK Indicates shutdown successful
For the ease of Copy Pasting retyping AT commands in sequence
AT
AT+CPIN?
AT+CREG?
AT+CGATT?
AT+CIPSHUT
AT+CIPSTATUS
AT+CIPMUX=0
AT+CGDCONT=1,"IP","airtelgprs.com"
AT+CSTT="airtelgprs.com"
AT+CIICR
AT+CIFSR
AT+CIPSTATUS
AT+CIPSTART= "TCP","flaskprint.herokuapp.com","80"
AT+CIPSEND
Happy Hacking 🙂