Connect with us

http connection using AT commands

Discussion in 'Microcontrollers, Programming and IoT' started by sid2286, Apr 18, 2014.

Scroll to continue with content
  1. sid2286

    sid2286

    102
    1
    Aug 24, 2011
    Hi,

    I am trying to figure out http connection using AT command for sim900 model with LPC2148.

    I did a small program for sms using AT commands and its working fine.

    then i moved on to have a http connection but its not working.,
    I tried the following website using sim900 and its working yo post http connection.

    http://m2msupport.net/m2msupport/module-tester/

    my code is as follows:

    #include <lpc214x.h>


    unsigned char CREG[]= "AT+CREG?";
    unsigned char SAPBR[]="AT+SAPBR=2,1";
    unsigned char HTTPINIT[]="AT+HTTPINIT";
    unsigned char HTTPPARA[]="AT+HTTPPARA=\"URL\",\"http://abcxxxx.php?name=fromMuC\"";
    unsigned char HCID[]="AT+HTTPPARA=\"CID\",1";
    unsigned char HDATA[]="AT+HTTPDATA=1,10000";
    unsigned char HACTION[]="AT+HTTPACTION=1";
    const unsigned char SEND_STRING[] = "AT";

    void enterr()
    {
    unsigned char i ;
    for(i=0;i<2;i++)
    {
    U1THR= enter;
    while(!(U1LSR & 0X20)) ;
    }
    }
    int main()
    {
    UART1_SendStr(SEND_STRING); // SEND AT
    enterr();
    Delay_Ticks(500);

    UART1_SendStr(CREG);
    enterr();
    Delay_Ticks(500);

    UART1_SendStr(SAPBR);
    enterr();
    Delay_Ticks(500);

    UART1_SendStr(HTTPINIT);
    enterr();
    Delay_Ticks(500);

    UART1_SendStr(HTTPPARA);
    enterr();
    Delay_Ticks(500);

    UART1_SendStr(HCID);
    enterr();
    Delay_Ticks(500);

    UART1_SendStr(HDATA);
    enterr();
    Delay_Ticks(500);

    UART1_SendStr(HACTION);
    enterr();
    Delay_Ticks(500);

    while();
    return(0);
    }


    please suggest what is it that I am making a mistake.
    Thanks,
    Sid
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-