SMS AT commands - how can i identify when a new SMS message is received, and which index number the message is stored under.

Posted on 2004-11-22
Last Modified: 2013-12-27
I know that "AT+CPMS" checks the message storage space, so i can use this to determine when a new message has arrived - but i do not know which index number the SMS is stored at.

I have to use "AT+CMGR=x" (where x is the index number) to check every possible message index.

"AT+CMGF" will list all messages - but takes far to long (typically about 20 seconds).

How can i identify which index number a new SMS message is stored at.
Question by:mnewett
    1 Comment
    LVL 4

    Accepted Solution

    Firstly the exact behaviour depends on the hardware you are using. Which modem are you using?

    The easiest way is to enable incoming message notifications bys using AT+CNMI=?,? you should have a look at the specifications to determine which parameters you need. I use AT+CNMI=3,(1-3) depending what I need [(1-3) meaning 1, 2 or 3].

    This will give you a unsolicited responce +CMTI <mem>,<index> for new messages.

    The only other way is to get the list of messages AT+CMGL (I assume this is what you meant by CMGF in your question as CMGF sets the message format). You would use AT+CMGL=<type>

    There are no other short ways to get the new messages which are standard GSM 07.07 commands. There may be proprietary commands from your modem manufacturer but since the SIM processor is not very fast at finding messages it will always be slow.

    Have you tried playing around with the message storage location? If you store messages on the modem instead of on the SIM it should perform much better. You can do this using AT+CPMS

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Broadband over Power Lines Broadband over Power Lines is the technology of transmitting computer data through power lines. This method of connectivity allows the user to have access to the internet without having to rely on additional cables, suc…
    #Citrix #Citrix Netscaler #HTTP Compression #Load Balance
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now