Solved

AT+CMGI Explanation

Posted on 2004-10-05
7
551 Views
Last Modified: 2013-12-09
Hi

Could someone please explain the parameters (or arguments) that the AT+CMGI command takes? I'm trying to send and receive SMSes from a GSM modem (Falcom Tango) and that works fine using the AT+CMGI=1,1 to set notification on and AT+CNMI=3,2 to set the modem to text mode. But when I try to receive SMSes from my Nokia 6230 cellphone, I can read SMSes sent to it from itself, but not from another GSM modem. What my application does is scan through all the SMSes on the modem looking for any unread SMSes. It doesn't rely on events triggered by the serial port or anything like that. If I knew what the parameters for the AT+CMGI command are, I could maybe fix the problem. Basically, I don't need the modem to let me know when an SMS is received. I constantly read all SMS memory locations looking for unread SMSes. It must just store the SMS on either the phone's memory or on the SIM card. On that topic, how do I control that? And how can I determine how many SMSes the phone and the SIM card can store? If I'm going to go through all the SMSes, I have to know the upper limit... To read the SMSes at the moment Im using AT+CMGR=x where x is the SMS number. Is this reading the SMSes stored on the phone/modem or on the SIM card? How do I control that?

Any help will be greatly appreciated.
Regards
Fabricio Rodriguez
South Africa
0
Comment
Question by:SETP
  • 4
  • 2
7 Comments
 
LVL 13

Expert Comment

by:imarshad
ID: 12236864
In which mode are you operating?

If you are operating in Text Mode then this command will output all the SMS that are present in the Modem......
AT+CMGL="ALL"

Similarly If you are operating in PDU Mode(AT+CMGF=0) then try

AT+CMGL=4

I will come back to this question a little later......I have to leave now....
Imran
0
 
LVL 8

Expert Comment

by:Meff
ID: 12238258
>Basically, I don't need the modem to let me know when an SMS is received. I constantly read all >SMS memory locations looking for unread SMSes. It must just store the SMS on either the >phone's memory or on the SIM card. On that topic, how do I control that?
Meff: With the command AT+NMI you can control the handling of incoming SMS.

>And how can I determine how many SMSes the phone and the SIM card can store?
Meff: If you read once a time in a loop all SMS places from 1 to X then you will get an error if you try to read a SMS on a place (number) that is nonexistent.

>If I'm going to go through all the SMSes, I have to know the upper limit... To read the SMSes at >the moment Im using AT+CMGR=x where x is the SMS number. Is this reading the SMSes stored >on the phone/modem or on the SIM card? How do I control that?
Meff: On the SIM card.
Regards
Meff
www.gsm-modem.de

0
 
LVL 13

Expert Comment

by:imarshad
ID: 12247945
OK now coming back to your question...........there are some points in your Question that are not clear to me.....
I have infered from your Question that you need to develop a software to Send/Receive messages from a GSM Modem.....and when you send the SMS's to your 6230 from the modem the SMS are not received at the Nokia 6230 ? or I am missing something? Similarly when you send messages from Nokia 6230 they are not received at the Modem ???
Is this the case?

Imran
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 13

Expert Comment

by:imarshad
ID: 12252472
You can use Hyper Terminal to check if the messages have reached or not(Later you can embedd that into your code)........Just set the correct Baud rate and com port and then type the following......

AT+CMGF=0 <Press Enter> Modem should return OK
AT+CMGL=4 <Press Enter> Modem should return all messages in the SIM followed by an OK

or alternatively

AT+CMGF=1 <Press Enter> Modem should return OK
AT+CMGL="ALL" <Press Enter> Modem should return all messages in the SIM followed by an OK

If your modem supports standard AT Commands then it should work on either/both commands......

With my little knowledge I have never heard of AT+CMGI command earlier.......It might not be a standard AT command ?
Where have you read about it ? AT+CMGL is a very good option when you are just polling the Modem at Regular interval....


>>It must just store the SMS on either the phone's memory or on the SIM card. On that topic, how do I control that? And
>>how can I determine how many SMSes the phone and the SIM card can store?

By default in most of the Modern Mobile Phones/PDA's /Smart Phones the messages are not kept in the SIM. They are copied into the memory of the Mobile Phone and then deleted from the SIM ......But this is not the case with most of GSM Modems......They actually keep the messages stored in the SIM and you manually have to delete them......

Reason::

For most of the GSM Providers there is a limit of Max. no. of SMS that can be stored in the SIM......Over here in Pakistan all the GSM Providers give SIMS that can store only 30 SMSes....After that they will be filled and no more SMS can be read before deleting the old ones.......The SMS are actually send back to the SMSC where they are kept for some time and then retransmitted.......Since Modern Mobile Phones /PDA's have enough memory to store hundreds of SMSes so they delete the SMS as it arrives and store them into their own memory......

But in modems the SMS are stored in the SIM and after 30 SMS no more can be received.......and you have to manually delete them......

How you can check what is the limit of max. SMS in the sim......Well one method is to keep sending the SMS from another Phone to your modem......and count the max. no. of SMS that you have received.....Most probably it will be 30 for you too......and Max. no. of SMS in the phone......maybe consulting your Mobile Phone documentation will explain better.


>>To read the SMSes at the moment Im using AT+CMGR=x where x is the SMS number            

The preffered method is the one that I have suggested and that is using AT+CMGL=4 in the PDU mode and AT+CMGL="ALL"
in Text mode......Manually reading each message at the memory location is not too good if you are not keeping track of the incoming SMS.......

Hope this info will give you some insight about the system......

Imran Arshad
0
 

Author Comment

by:SETP
ID: 12274723
Hi. Thanks for the replies. Just a few points to answer some of the questions raised above:

1. The application has been written already and works perfectly on the GSM modems (I've tried it on the Falcom Tango and the Siemens TC45)
2. The applications isn't working properly when I use it with my Nokia 6230 cellphone
3. The AT+CMGR=x command, where x is an integer, is used to read a specific SMS. I loop from 1 to 30 looking for any unread SMSes on the SIM card.
4. When using the cellphone connected to the PC, if I send it an SMS from another cellphone, I can easily read this SMS by using the command in the step above.
5. When I send my cellphone an SMS from a GSM modem, the SMS is received by the cellphone (i.e. it is displayed on the cellphone's screen) but I can't see it from my application. I.e., when I loop through the 30 possible SMS locations, that SMS is not there. I think as soon as the phone receives an SMS from a GSM modem, it automatically removes the SMS from the SIM card. I think it might be moving it to the phone's memory.
6. Therefore, how can I read an SMS from the phone's memory instead of the SIM card?
7. Any ideas why the cellphone is moving SMSes received from a GSM modem to the phone's memory and not SMS'es received from another cellphone?

Thanks guys.
0
 
LVL 13

Expert Comment

by:imarshad
ID: 12281838
>>I.e., when I loop through the 30 possible SMS locations, that SMS is not there. I think as soon as the phone receives an
>>SMS from a GSM modem, it automatically removes the SMS from the SIM card. I think it might be moving it to the
>>phone's memory.

Yes this is true and as I have already posted that most of the sophisticated Mobiles/PDA usually delete these messages as they are arrived and store them in their memory......(for Nokia 6230 the max limit is 150 SMS)

Have you tried to use the the complete PC suite for your modem from Nokia......Here is the link......?

http://www.nokia.com/nokia/0,8764,54000,00.html

Imran

0
 
LVL 8

Accepted Solution

by:
Meff earned 500 total points
ID: 12294980
>5. When I send my cellphone an SMS from a GSM modem, the SMS is received by the cellphone (i.e. it is displayed on the cellphone's screen) but I can't see it from my application. I.e., when I loop through the 30 possible SMS locations, that SMS is not there. I think as soon as the phone receives an SMS from a GSM modem, it automatically removes the SMS from the SIM card. I think it might be moving it to the phone's memory.

Please have a look on the parameters of the command AT+CNMI in your Nokia and in your Tanga / TC45. The handling of a SMS depends on the message class you send with your mobile phone and command AT+CNMI. With AT+CNMI? you will get the parameters of your receiving Nokia. With a little luck your the Tango / TC45 will accept same paramters and the handling in all of your GSM devices will be the same.
Regards
Meff
www.gsm-modem.de
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Need WiFi? Often, there are perfectly good networks that don't have WiFi capability - and there's a need to add it.  - Perhaps you have an Ethernet port into a network but no WiFi nearby. - Perhaps you have a powerline extender and no WiFi at the…
Multi-source agreements are important because they set standards that all manufacturers should follow to ensure that devices are compatible with multiple vendors. The multi-source agreement (MSA) is an agreement that establishes how multiple vendors…
This Micro Tutorial will show you how to maximize your wireless card to its maximum capability. This will be demonstrated using Intel(R) Centrino(R) Wireless-N 2230 wireless card on Windows 8 operating system.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…

708 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

17 Experts available now in Live!

Get 1:1 Help Now