SIM900 GPRS HTTP AT Commands

Before you begin make sure your SIM900 GSM module has acquired the network and it is ringing when you make a call to it. Then test the basic AT commands and then proceed further.

Once you are ready, you can start by first setting up the GPRS connection as follows, 


Text in RED is typed by me and text in GREEN is the response from SIM900 module.

 Setting up GPRS connection

Set the connection type to GPRS

AT+SAPBR=3,1,”Contype”,”GPRS”

OK

 

Set the APN to to “www” since i am using a Vodafone SIM card, It might be different for you, and depends on the network

AT+SAPBR=3,1,”APN”,”www”

OK

 

Enable the GPRS

AT+SAPBR =1,1

OK

 

Query if the connection is setup properly, if we get back a IP address then we can proceed

AT+SAPBR=2,1

+SAPBR: 1,1,”100.120.204.132″

OK

 


Getting the contents of a webpage from the server

We will get the content of the webpage from my old website at the url http://www.marsinnovations.in/testout.php, which is a simple web page that puts out some dummy text as shown below. You can retrieve any webpage you want. 

We were allocated a IP address and now we can proceed by enabling the HTTP mode

AT+HTTPINIT

OK

 


OPTIONAL,  ONLY IF URL is HTTPS or SSL enabled: Also Remove the http:// part in the HTTPPARA=”URL”,xxxx command

AT+HTTPSSL=1

OK


 

Start by setting up the HTTP bearer profile identifier

AT+HTTPPARA=”CID”,1

OK

 

Set the url  to the address of the webpage you want to access

AT+HTTPPARA=“URL”,”http://marsinnovations.in/testout.php”

OK

 

Start the HTTP GET session, by giving this command

AT+HTTPACTION=0

OK

 

The below output from module indicates it  has read 654 bytes of data and the response of the HTTP GET request is 200, which means success

+HTTPACTION:0,200,654

 

The below command tells the module that we want to read the received data

AT+HTTPREAD

The below is the data read from the webpage

+HTTPREAD:654

Logged Meter Readings:<br>Date Time: Current Voltage Temp.<br>

<br>Mon May 19 23:56:12 2014 :485683465429634

<br> :485683465429634

<br>Tue May 20 00:00:13 2014 :948598437599980

<br>Tue May 20 00:04:41 2014 :948598437599980

<br>Tue May 20 00:24:39 2014 :9485

<br>Tue May 20 00:25:37 2014 :9485

<br>Tue May 20 00:40:50 2014 :23423

<br>Wed May 21 00:07:19 2014 :948598437599980

<br>Wed May 21 00:43:20 2014 :34234324

<br>Wed May 21 00:47:15 2014 :34234324

<br>Wed May 21 11:12:10 2014 :34234324

<br>Wed May 21 15:23:22 2014 :34234324

<br>Wed May 21 15:28:07 2014 :564575676

<br>Wed May 21 15:38:06 2014 :564575676

<br>Wed May 21 15:43:53 2014 :564575676<br>

OK 

The contents above are the contents of the webpage shown before. 

 

See next page for the HTTP post request >>

11 thoughts on “SIM900 GPRS HTTP AT Commands”

    1. Check my post and video on Learn how to save MQTT messages to a MYSQL database, the video should show the server setup which enables HTTP REST API to post data to server.

  1. Hello Ravi,

    I’m using a SIM900 GPRS/GSM shield and the firmware is the following:

    AT+CGMR

    Revision:1137B01SIM900M64_ST_AM

    It seems with this firmware, you can’t use AT+HTTPSSL.

    When I type for instance AT+HTTPSSL=?, I get an ERROR.

    Do you know of a firmware version for the SIM900, which let’s me use URLS with https? I’ve sent simcom an E-Mail today. I hope they can eventually also give me an answer.

      1. Okay, I’ve found the solution for my problem. With the SIM900 it’s really important to check the firmware. My firmware was not up to date.

        I’ve used the following guide to install the firmware for my GPRS/GSM SIM900 Shield:

        It seems, that only the enhanced firmware versions for the SIM900 provide the AT Command HTTPSSL.

        The (latest?) version 1137B15SIM900M64_ST didn’t provide HTTPSSL, while the version Revision:1137B06SIM900M64_ST_ENHANCE did.

        It hopes this information helps more people.

        Kind regards, Paul

Leave a Comment

Your email address will not be published. Required fields are marked *