This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Interface a GSM Modem and 8051 and retrieve decoded SMS

Hi everyone,

Is there any way in which I can interface a GSM modem with a 8051 and retrieve the decoded SMS. The motivation behind this is that... even if i can get the encoded SMS from the GSM modeme using AT commands, the decoding complexity is very high for a 8051. And I think the GSM module should have some kind of decoding code (using this would be benificial and reduce code complexity for 8051)

Also please let me know exactly how to interface the GSM modem to 8051. I dont want a PC interface in between.

Please help me out..

Sambit
NIT ROURKELA

Parents
  • Dear Sir,
    I have given delay of 2 sec after every command sent to receive the response.
    I have changed the Baud rate to 9600 using AT+IPR=9600 command.
    Still i am getting the same Error.
    i saw the commands sent from the controller to GSM on the Hyperterminal and the commands what i send through the controller is exactly same as from the hyperterminal.

    Regards
    sapthagiri

Reply
  • Dear Sir,
    I have given delay of 2 sec after every command sent to receive the response.
    I have changed the Baud rate to 9600 using AT+IPR=9600 command.
    Still i am getting the same Error.
    i saw the commands sent from the controller to GSM on the Hyperterminal and the commands what i send through the controller is exactly same as from the hyperterminal.

    Regards
    sapthagiri

Children
  • what is wrong with this code plese

    unsigned char mmc_init(void)  {  unsigned int i;  unsigned char response;    MMC_CS_TRIS=0;   MMC_VCC_KEY_TRIS=0; //out  MMC_VCC_KEY=0; //MMC power ON MMC_DOUT_TRIS=1; //input MMC_DOUT_TRIS = 1; // dout as input. MMC_CS_TRIS = 0; // CS as output. MMC_CLK_TRIS = 0; // CLK as output. MMC_DI_TRIS = 0; // DI as output MMC_CLK = 1; mmc_powerup(); mmc_unselect(); for(i = 0; i < 10; ++i) mmc_read_write(0xFF); /* address card */ mmc_select(); /* reset card */ for(i = 0; ; ++i) { response = mmc_send_command_r1(CMD_GO_IDLE_STATE, 0); if(response == 1) break; if(i == 0x1ff) { mmc_unselect(); return 0; } } /* wait for card to get ready */ for(i = 0; ; ++i) { response = mmc_send_command_r1(CMD_SEND_OP_COND, 0); if(!(response & 1)) break; if(i == 0x7fff) { mmc_unselect(); return 0; } } /* set block size to 512 bytes */ if(mmc_send_command_r1(CMD_SET_BLOCKLEN, 512)) { mmc_unselect(); return 0; } /* deaddress card */ mmc_unselect(); raw_block_address = 0xffffffff; if(!mmc_read(0)) return 0; return 1; }
    

  • That it is a quite long line???

    Are you _really_ sure you didn't notice this problem in the preview?

  • Appology please
    here is bad code

    unsigned char mmc_init(void)
    {
      unsigned int i;
      unsigned char response;
    
            MMC_CS_TRIS=0;
            MMC_VCC_KEY_TRIS=0; //out
            MMC_VCC_KEY=0; //MMC power ON
            MMC_DOUT_TRIS=1; //input
    
            MMC_DOUT_TRIS = 1;      // dout as input.
            MMC_CS_TRIS = 0;        // CS as output.
            MMC_CLK_TRIS = 0;       // CLK as output.
            MMC_DI_TRIS = 0;   // DI as output
            MMC_CLK = 1;
    
      mmc_powerup();
      mmc_unselect();
    
      for(i = 0; i < 10; ++i)
        mmc_read_write(0xFF);
    
      /* address card */
      mmc_select();
    
      /* reset card */
      for(i = 0; ; ++i)
      {
        response = mmc_send_command_r1(CMD_GO_IDLE_STATE, 0);
        if(response == 1)
          break;
    
        if(i == 0x1ff)
        {
          mmc_unselect();
          return 0;
        }
      }
    
      /* wait for card to get ready */
      for(i = 0; ; ++i)
      {
        response = mmc_send_command_r1(CMD_SEND_OP_COND, 0);
        if(!(response & 1))
          break;
    
        if(i == 0x7fff)
        {
          mmc_unselect();
          return 0;
        }
      }
    
      /* set block size to 512 bytes */
      if(mmc_send_command_r1(CMD_SET_BLOCKLEN, 512))
      {
        mmc_unselect();
        return 0;
      }
    
      /* deaddress card */
      mmc_unselect();
    
      raw_block_address = 0xffffffff;
    
      if(!mmc_read(0))
        return 0;
    
      return 1;
    }
    

  • "I have given delay of 2 sec after every command sent to receive the response."

    Do you have a delay after receiving the response before you send the next command.

    How have you confirmed that what your software is sending is identical to what Hypoterminal sends?

  • Author: jamil rafar
    Posted: 12-Jun-2007 04:54
    "what is wrong with this code plese"

    Apart from the formatting, It appears to have nothing whatsoever with the topic of this thread!

    Please start a new thread for a new topic!

  • Dear sir,
    Yes I am waiting for 2 sec before and after sending the command so that i can see the received Response in the debugger.
    i am sending the identical commands and waiting for response.
    I had simulated on the hyperterminal before sending it to GSM module.

    Regards
    sapthagiri

  • "i am sending the identical commands and waiting for response.
    I had simulated on the hyperterminal before sending it to GSM module."

    You still haven't said how you are certain that what you sent from hypoterminal was absolutely identical to what your code sends!

    How have you proved this?

    In particular, are you certain that the line endings are the same - CR, or CRLF?

  • dear Sir,
    These are the following steps i have followed to debug and simulate the Commands sent from the Microcontroller.

    1)First i confirmed that commands sent from the hyperterminal to GSM are working perfectly and received the response from the GSM.

    2)Later i checked the SMS from the hyperterminal and it was also working.

    3)Then i sent commands from the controller to the hyperterminal before sending to GSM module.
    I came to know that what i am sending from the controller
    to the hyperterminal was same as the commands sent from the hyperterminal to GSM.

    4) Later i started sendin the commands one by one and received response for all the commands except for SMS.
    For SMS After sending the Text Message i sent CTRLZ ascii value(26) from the controller and simulated the same by sending it to hyperterminal.
    I am getting the same ERROR response.
    Till now i am facing the same problem.

    Regards
    sapthagiri

  • Create the minimum complete application that just attempts to send an SMS.
    If this works, then build on it, adding-in your other functionality one step at a time.
    Test throughly after each step.
    Save a backup of each step.

    If it doesn't work, post it here - taking care to read & follow the instructions for posting source code.
    Also be sure to use copy-and-paste (don't manually re-type), no TABs (spaces only).

  • You do know that 26 is the decimal value, don't you?

  • i am not sure abt ur problem... but what i guess is that u are not getting any response from the GSM modem... rt?

    trying sending the command serially... followed by linefeed and carriage return. This will actually execute the command in the GSM Modem.

    wait for some time for the command to execute...

    u can check the response in the CRO... u will find blocks of data being transmitted and received..

    do check that.. one more thing that u need to look into is the handshaking part.. check if that is working fine or not. IN case of a normal microcontroller... the RTS pin is NOT CONNECTED.. that is a very important pin for handshaking.. I think that should be active LOW.. u need to make a manual connection for that.

    do mail me ur actual problem at sambit.nitrkl@gmail.com

    would be glad if ucan help u... we had similar problems.. :)

  • "i am not sure abt ur problem"

    Your post is almost unintelligible!

    Please use full words - "about", "your" etc.

    You're not on a cell phone now - there's no need for it, and it just makes it really hard to understand your message!

    The language barrier can be hard enough as it is, without needlessly adding to the problem like this!

    "i guess is that u are not getting any response from the GSM modem... rt?"

    No: he has specifically said that he is getting a response - but that response is "ERROR"

    "trying sending the command serially"

    He says he's already done that with hypoterminal

    Do please read the foregoing discussion carefully!

    "followed by linefeed and carriage return"

    No!
    AT commands should be terminated with CR only.

    When CR and LF are used together, it should be CR first, then LF - hence the common abbreviation "CRLF"

    "wait for some time for the command to execute..."

    Delays have already been discussed.

  • Yes I have send it 0x1a which hex value of 26