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
  • If it works on Hypoterminal, but not from your code, you need to examine the differences!

    One obvious difference will be timing - a microcontroller can send commands much faster than you can type them!
    As a first step, try adding some delays.

    Also, be sure that your code is sending exactly the same as Hypoterminal - especially things like line-endings (CR or CRLF?)...

Reply
  • If it works on Hypoterminal, but not from your code, you need to examine the differences!

    One obvious difference will be timing - a microcontroller can send commands much faster than you can type them!
    As a first step, try adding some delays.

    Also, be sure that your code is sending exactly the same as Hypoterminal - especially things like line-endings (CR or CRLF?)...

Children
  • AS FAR AS I AM AWARE, REFERENCES TO <BOLD><ITALIC>HYPOTERMINAL</ITALIC></BOLD> SHOULD BE READ AS <BOLD><ITALIC>HYPERTERMINAL</ITALIC></BOLD>

  • You're doing it again!

    You really do need to pay attention to the 'Preview' - your Bold & Italic formatting didn't work either, did they?!

    Yes, "Hypoterminal" (sic) is a malapropism - a deliberate error for humourous effect:
    "
    Presumably, they called it "Hyper-terminal" to give the impression that it's "so much more" than a plain old terminal.
    en.wiktionary.org/.../Hyper-

    But many would agree that "Hyperterminal" is a rather poor terminal - it has too many quirks, limitations, and annoyances.
    Hence I call it "Hypo-terminal" to indicate its deficiencies:
    en.wikipedia.org/.../Hypo

    I don't know if you're the first to notice this, but you're certainly the first to comment!

  • Andy isn't the only one to write Hypoterminal on this forum. I think it's the most common name used.

    I tend to use the correct M$ (see, I also like to change some names (: ) name, just to make sure that there is no single way of understanding what program to use.

  • "Andy isn't the only one to write Hypoterminal on this forum."

    And there was me thinking I was being original!
    Foiled again! :-(

    In fact, I did a quick search, and found that "Hypoterminal" is quite widely used on many other forums...

  • 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

  • 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?