How to handle delivery report in GSM Modem? - sms

i want to use GSM Modem in an application for some purpose.
what i want is handling SMS delivery report for list of sent sms.
GSM Modem inbox & outbox are limited to 15 items. every time i read the inbox the gsm modem return a list an clear the list.
how to check delivery status of sms that had been deleted from GSM Modem inbox ?
i need something unique that enables me to identify each message.

every time i read the inbox the gsm modem return a list an clear the list.
Messages that are stored in modem's memory will not be removed after you read them. You just read message with at+cmgl={message id in storage} command and then remove it using at+cmgd={message id in storage} command (or not, as you wish. You can clear all modem's storages using at+cmgd=1,4 command).
Back to the question: after sending SMS, you'll get a response from modem, smth like this: +cmgs: {sms id, 0 to 255} OK. In case, if Service Center has delivered the SMS successfully, modem will return this response: +cds: {some id which does not matter} {PDU status report}. You need just decode this PDU to obtain status report, id of original SMS and other useful data. If sent sms's ID and ID from status report are equal, you have status report exactly for your message. Note, if you remove message from modem's storage before receiving of delivery report, you'll get report which will be containing all usual information, but status of delivery will be most likely 71 instead of 0.

Related

How to store receiving SMS in GSM Module memory (SM or ME)?

I am using AI Thinker A7 GSM/GPRS/GPS Module demo v7.1.
I am trying to send and receive SMS through AI-Thinker Serial Tools V1.2.3.0
This module is working fine with making a call and receiving a call, sending and receiving an SMS. They work exactly fine.
The problem is that it does not store SMS in the memory?
I have done a lot of things to make it work, but there is no progress.
For instance, my AT commands and their responses are here,
AT+CPMS=?
+CPMS: ("ME","SM"),("ME","SM"),("ME","SM")
and
AT+CPMS="SM"
+CPMS: 0,35,0,35,0,25
and
AT+CPMS="ME"
+CPMS: 0,25,0,35,0,25
And I have tried CNMI settings like these,
AT+CNMI=1,1,0,0,0
OK
After these, I send msgs, and then tried to check through AT+CPMS and AT+CMGL, but there are no messages stored.
then I tried
AT +CNMI = 2,1,0,0,0
OK
and the same with
AT +CNMI = 2,2,0,0,0
OK
similarly
AT +CNMI = 0,1,0,0,0
OK
But still, I have not succeeded in getting message stored in memories.
Please help, if there are any other settings I need to do or my commands are wrong or my module doesn't support storing SMS (i highly doubt it since it has memory spaces which are showing that 25 SMS in SM, 35 in ME can be stored)??
If I understand your problem correctly, you are trying to read incoming SMS but can't list them.
Well, you need to understand that your GSM module doesn't store any incoming SMS by default. You have to command your GSM Module to store it. As you mentioned, you were very close to command for that. you need to command it this way:
AT+CPMS=mem1,mem2,mem3
AT+CPMS="SM","SM","SM"
As per documentation, you can mention three memories as the parameter for different operations like:
mem1 (in this example SM) - a memory from which messages are read and delete
mem2 (in this example SM; but could be ME) - a memory from which writing and sending operations are made
mem3 (in this example SM; but could be ME) - memory to which received messages are preferred to be stored
Now your GSM module will store all incoming messages into the SIM card and you'll be able to list all the messages with AT+CMGL=ALL
This way it worked for me.

Can't read or count messages on GSM Modem

I am using a Huawei E303 modem and I am not seeing new messages via AT commands. Huawei's application "Mobile Partner" is able to read these messages but I don't understand how.
I have set AT+CMGF=1 and when I try AT+CPMS? I get +CPMS:"SM",0,30,"SM",0,30,"SM",0,30
When a new message arrives I get a +CTMI: "SM", 0 every single time. That value never increments. AT+CMGL="ALL" returns response OK but no messages.
I am now out of ideas. How can I read a message if counting them always returns zero?
What is amazing is that the Huawei application can read incoming messages, can send messages without any problems.

Concatenated PDU Flash message

I'm trying to send concatenated flash messages using a sim900 gsm module. Both messages are sent successfully, but I can see only one on my cell phone.
These are the PDUs I'm using:
AT+CMGS=140
pdu part 1 =
0051000B916998775706F80010A78F050003790201622C908C059AB1403416A8C602D958A01B0B84638172A0B09B0C8AC158A0188C058AC558A0988C058ACD58A0188D058AD558A0988D058ADD58A0188E058AE55820198C0592C55820998C0592CD5820198D0592D55820998D0592DD5820198E0592E558A0198C059AC558A0998C059ACD58A0198D059AD500
AT+CMGS=43
pdu part 2 =
0051000B916998775706F80010A72105000379020258A0998D1593CD6839582E3683E564331C2C17C3C96630
Is there something wrong with the UDH? I'm able to send concatenated SMS, but not Flash messages.
How can I fix this?

+CMS ERROR 41 on Telit Modem

I am a developer, working on "Telit" GE865-Quad using AT commands.
I am planning an application, witch sends SMS when certain condition occurs. When the application does not send SMS the modem is shut-down (Therefore every time I want to send SMS I have to turn on the modem). This application sends 3 SMS to different numbers one after the other.
The application is working just fine. The problem apear after a while (after sending certain amount of SMS), when I give the command to send SMS I get "+CMS ERROR 41" ("Temporary failure"). Once this message appear, every time I try to send SMS I get the same ERROR - It is like the SIM card is stuck. The only way I have found to get rid of this error is to enter the SIM card to my privet phone and send SMS.
I have spoken to "Telit" representative and he could not give a satisfying answer other then adding more delay between messages.
This is some of the relevant code :
(Turning on sequence) // From "Telit" GE865-Quad DataSheet
> #QSS: 3 //Before I start working with the modem i wait for this response with means the SIM is ready to use and the registration is to cellular network is complete*/
AT+CMGF=1 // Text Mode
OK
AT+CMGS=+xxxxxxxxxxxx // My number.
"This is the message i want to send" //Preparing the desired message require some coding But I think this is irrelevant to the subject.
//Delay for 3 secs//
And again : AT+CMGS=+xxxxxxxxxxxx // My number.
"This is the message I want to send"
//Delay for 3 secs//
(The same thing one more time)
The questions are:
Why does it happen, what am I doing wrong??
How can I unblock the SIM? What does the phone do so I can keep sending SMS?
The purpose is the keep sending SMS automatically.
This is the first time I publish a message in this website so if something is unclear please let me know. :)
Thanks for all the helpers.
Itay.
today i encountered this +CMS ERROR: 41 error, many times.
There was about 40 unread messages in the receiving modem.
After i deleted all received messages error disappeared.
I think may be operator is protecting customers from spam.
Dmitri
It is due Either SMS service on your SIM is not available or your SMS subscription is expired.

Long Concatenated WAP PUSH over SMS

Can anyone kindly explain how to send a concatenated WAP PUSH SMS? I can send an SI that spans just one message, but I haven't figured out how to send one that spans multiple messages
If you send a WAP Push message with a SMS Bearer, you've got a SMS with a User Data Header. This User Data Header looks like 0605040B8423F0 and contains so to say source and destination port for the WAP Push App in your phone. 0B84 is the destination port number (2948), 23F0 is the source port number (9200).
To send a WAP Push longer than 133 Bytes you have to add a Concatenation Header to the UDH, the UDH will then look like
0B00033F020105040B8423F0 for the first SMS and
0B00033F020205040B8423F0 for the second SMS
Split the remaining Wap-Push data in 128 Byte Chunks and append them to the UDH.
The glory details are part of the 3GPP Specification 23.040 found at http://www.3gpp.org/ftp/Specs/html-info/23040.htm
hth cheerio
Steve

Resources