Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

An AT command to inform me when a new SMS arrive,

Posted on 2003-12-20
13
Medium Priority
?
8,052 Views
Last Modified: 2016-10-04
i want a An AT command to inform me when a new SMS arrive,
0
Comment
Question by:NassClickMan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
13 Comments
 
LVL 4

Expert Comment

by:SimonTay
ID: 9980622
AT+CNMI=3,3,2 should do it for you.

Don't forget to set the SMS mode (PDU or text) using AT+CMGF=0 or AT+CMGF=1 respectively.

Anyway it's the CNMI command that should do it, there are AT command manuals available at www.tdc.co.uk/technical if you need them. (For Siemens modems, but should work for most others as well).

Simon
0
 
LVL 8

Expert Comment

by:Meff
ID: 9980709
It is difficult to give an answer without to know, what kind of operting system you use and what is the target.
- A message only that there is a new SMS?
Then AT+CNMI is way to get a message. I could not give a recommendation on the parameters of AT+CNMI without to know in which message class your SMS comes in. There are four message classes and one of them will always stick on your SIM card. Last not least your have to check your SIM card with AT+CMGR, because if you have 20 places for SMS on your SIM card with wrong message class and follow the recommendation of Simon, then after the 20th SMS in wrong message class you will not receive a SMS anymore. They all will stick on the SMSC.
May a look  http://www.gsm-modem.de/gsm-data.html helps you to find the important commands. Documentation (PDF files) on the GSM modem and modules you can dowload at www.roundsolutions.com . They ship worldwide with there offices in UK, Germany and Sweden.
As a customer of mine you will enjoy the huge community based on a closed user forum in the Internet with FAQ and a lot of postings. You will get factory support and you will see that users help users as well. You will stay in a community with more then 380 members around the world. A big "technical family" that grows each month.
Regards
Meff
0
 

Author Comment

by:NassClickMan
ID: 9981501
No i havent a gps modem.I have a siemens mobile which supports at commands and i can decode the pdu data.I just want a way to be informed whe a new message arrives because i dont want to use at+cmgl= to get then because i waste batery.
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
LVL 4

Expert Comment

by:SimonTay
ID: 9981505
Then the AT+CNMI=3,3,2 command ought to work for you.

Simon
0
 

Author Comment

by:NassClickMan
ID: 9981526
AT+CNMI=3,3,2

ERROR
i get an error
0
 
LVL 4

Expert Comment

by:SimonTay
ID: 9981530
Check what your modem supports by giving it AT+CNMI? and see what it is set to at the moment by AT+CNMI=?

Simon
0
 

Author Comment

by:NassClickMan
ID: 9981532
Write command
AT+CNMI=[<mode>[,<mt>[,<bm>[,<ds>[,<bfr>]]]]]
Parameter
<mode> See Test command
<mt> See Test command
<bm> See Test command
<ds> See Test command
<bfr> See Test command
Response
OK/ERROR/+CMS ERROR


maybe this will help you
0
 

Author Comment

by:NassClickMan
ID: 9981533
AT+CNMI=?

+CNMI: (0,1),(0,1),(0,2),(0,2),(1)

OK
0
 
LVL 4

Accepted Solution

by:
SimonTay earned 1000 total points
ID: 9981547
CNMI=1,1 should do it.
0
 
LVL 4

Expert Comment

by:SimonTay
ID: 9981554
 
AT+CNMI =
[<mode>]
[,<mt>][,<bm>]
[,<ds>][,<bfr>]  
The write command selects the procedure how the receipt of new SMS messages
from the network is indicated to the TE when TE is active, e.g. DTR signal is ON.
If TE is inactive (e.g. DTR signal is OFF), the reception of messages shall be per-
formed as specified in GSM 03.38.  
Note1:    If the DTR signal is not available or the state of the signal is ignored
(V.25ter command &D0), reliable message transfer can be ensured by us-
ing +CNMA acknowledgment procedure.
Note2:   The rules <mt>=2 and <mt>=3 for storing received SM are possible only if
phase 2+ compatibility is activated with +CSMS=1
Note3:   The parameter <ds>=1 is only available in phase 2+  
 
OK
If error is related to ME functionality:
+CMS ERROR: <err>
Parameter
<mode>  [0]  Buffer unsolicited result codes in the TA. If TA result code
buffer is full, indications can be buffered in some other place or
the oldest indications may be discarded and replaced with the
new received indications.
  1  Discard indication and reject new received message
unsolicited result codes when TA-TE link is reserved (e.g. in
on-line data mode). Otherwise forward them directly to the TE.
  2  Buffer unsolicited result codes in the TA when TA-TE link is re-
served (e.g. in on-line data mode) and flush them to the TE af-
ter reservation. Otherwise forward them directly to the TE.
  3  Forward unsolicited result codes directly to the TE. TA-TE link
specific inband technique is used to embed result codes and
data when TA is in online data mode.
<mt>  Rules for storing received SMS depend on the relevant data coding
method (refer to GSM 03.38 [2]), preferred memory storage (+CPMS)
setting and this value
Note: If AT command interface is acting as the only display device, the
ME must support storage of class 0 messages and messages in the
message waiting indication group (discard message)
  [0]  No SMS-DELIVER indications are routed to the TE.
  1  If SMS-DELIVER is stored in ME/TA, indication of the memory
location is routed to the TE using unsolicited result code:
+CMTI: <mem>,<index>
  2  SMS-DELIVERs, except class 2 messages and messages in
the message waiting indication group (store message) are
routed directly to the TE using unsolicited result code:  
 
+CMT: ,<length><CR><LF><pdu> (PDU mode enabled)  
+CMT: <oa>,, <scts> [,<tooa>, <fo>, <pid>, <dcs>, <sca>,
<tosca>, <length>] <CR> <LF> <data> (text mode enabled)
 
  3  Class 3 SMS-DELIVERs are routed directly to the TE using
unsolicited result codes defined in <mt>=2. Messages of other
data coding schemes result in indication as defined in <mt>=1.
 
<bm>  Rules for storing received CBMs depend on the relevant data coding
method (refer to GSM 03.38 [2]), the setting of Select CBM Types
(+CSCB) and this value:
  [0]   No CBM indications are routed to the TE.
  2   New CBMs are routed directly to the TE using unsolicited re-
sult code: +CBM: <length><CR><LF><pdu> (PDU mode en-
abled) or +CBM: <sn>,<mid>,<dcs>,<page>,<pages><CR>
<LF><data> (text mode enabled).
  3   Class 3 CBMs are routed directly to TE using unsolicited result
codes defined in <bm>=2.
 
<ds>  [0]  No SMS-STATUS-REPORTs are routed to the TE.
  1  SMS-STATUS-REPORTs are routed to the TE using unsolic-
ited result code: +CDS: <length><CR><LF><pdu> (PDU mode
enabled) or +CDS: <fo>,<mr>,[<ra>],[<tora>],<scts>,<dt>, <st>
(text mode enabled)
  2  If SMS-STATUS-REPORT is routed into ME/TA, indication of
the memory location is routed to the TE using unsolicited result
code: +CDSI: <mem>,<index>
 
<bfr>  [1]   TA buffer of unsolicited result codes defined within this com-
mand is cleared when <mode> 1...3 is entered

(Extract from the manual)
0
 
LVL 3

Expert Comment

by:manlimnag
ID: 10288069
Hi
One of the way is keep polling on port by using timer.
Use cmgl command to read the messges process the message if succesful delete the message so every time only new messages will be there after cmgl

Mandar  
0
 

Expert Comment

by:stex
ID: 11029666
Hi
I have a question.
I send this command AT+CNMI =1,2,0,0 trougt serial port  and I receive only the first sms in pdu mode. how can I do to resolve this ?

0
 

Expert Comment

by:kiran sw
ID: 41827849
I am using sim808 modem for gprs communication at the same time i want modem to inform the mcu about the new message arrival AT+CNMI=3,2,0,0,0 I am using able to receive only first msg
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hopefully this article will help someone who's had the same issues I had. I have a Dell Wireless 1390 WLAN Mini-Card and Windows 7, and for the past couple of days I was beyond frustrated because my wireless laptop was not able to access the Inte…
This subject  of securing wireless devices conjures up visions of your PC or mobile phone connecting to the Internet through some hotspot at Starbucks. But it is so much more than that. Let’s look at the facts: devices#sthash.eoFY7dic.
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…
Suggested Courses

618 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