How to send long sms | Thales IoT Developer Community
August 15, 2018 - 2:35pm, 17432 views
Dear Gemalto
Have any of You tryed to send a long sms, splitting it up in ex 3 sms?
I have tryed use AT+CMMS=1/2, but when I send a ctrl-Z, the senarie stop.
I have then tryed to send SMS without ctrl-Z,
but then it hang.
I can only use AT+CMGS, not AT+CMGC don't know why?
I other words, how to use AT+CMMS=1/2
Hi,
In text **** you can only send one SMS. For your information: "AT+CMMS controls the continuity of the SMS relay protocol link. If the feature is enabled (and supported by the currently used network) multiple messages can be sent faster as the link is kept open." so it's depend's if your network support it.
To send more message you can check PDU **** { AT+CMGF=0 }. Please check it.
Regards,
Krzysztof
Well, I have tryed to scan the Gemalto site, for pdu setting, but there is no help there. Infact, the only I can found out, is that the AT+CMGC=160 takes a number, but then I am lost.
I can not figure out how and where to put in the phonenumber.
The above AT+CMGC=160 return a > , but if I just put in my "phone number", it returns with an error.
Any help given about using PDU would be appreciated.
What about an example in how to getting started with PDU.
Anybody
Please....
Hi,
Here is a link fot testing with SMS text and PDU ****:
https://m2msupport.net/m2msupport/sms-at-commands/
Best regards,
Antero
Antero Markkula
Communication and Mechatronics
Enkom Active Oy – www.enkom-active.fi
Upseerinkatu 3 A, 02600 Espoo, Finland
Mobile: +358 400 411368
Office: +358 10 204 0000
Fax: +358 10 204 0010
E-mail: antero.markkula@enkom-active.fi
Hi,
You can't write more text than 160 length. If you want to send 3 SMS you have two options.
Let say there will be 3 messages like "test1 test2 test3" where "test" is like 150 characters long.
AT+CMGS="phone number"
>test1
>CTRL-Z (char 26) - to send fist message
repeat it three *****.
>type your message
>CTRL-Z (char 26) - to send fist message
repeat it three *****
There is some links and example:
PDU online generator: http://smstools3.kekekasvi.com/topic.php?id=288
Information about PDU: http://www.spallared.com/old_nokia/nokia/smspdu/smspdu.htm
More information: http://mobiletidings.com/2009/02/11/more-on-the-sms-pdu/
There I will send you PDU example of 450 bytes length of message. Test message:
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla fermentum porta ipsum. Nulla quis diam eu nisl scelerisque placerat. Mauris efficitur nec orci vel egestas. Cras rhoncus suscipit est vel lacinia. Sed condimentum nec sem vitae volutpat. Donec euismod sem ac ex auctor, et facilisis metus suscipit. Sed nec lacus vel ipsum dapibus congue ut at lacus. Etiam in dolor turpis. Sed sit amet eleifend quam. Nunc dignissim urna a tellus nullam." (without quotes)
Number: +48999999999
Generated PDU texts:
AT+CMGF=0
1.AT+CMGS=154 >0051000B918499999999F9000000A0050003010301996F79B90D4AC3E7F53688FC66BFE5A0799A0E0AB7CB741668FC76CFCB637A995E9783C2E4343C3D1FA7DD6750999DA6BB40CE3A9B1D0699CBF276D94DAFB741F0B79C1E06A5E1F37ADB0572D6D9EC30285E4FCF41E474B80D2AD741EEF49C0D9A8FCBECB23C3D8FD7CB20383B3C2ECBC37417A819AECBD37350D96C4E8FD3F4BA1CE42E8F41(CTRL-Z)
2.AT+CMGS=154
>0051000B918499999999F9000000A0050003010302DFF2711A642FB341E573794E0FCF5DA0A13C3C07C9D16FF7B83E07CDEBF3711A9EA683CA733AC85E6683D8E171DA9D0EBB40D33219347EBBC9E976D94DAFB741EEF218342FB741F6343D5C06D9DFEC3A1D1EA6BB40C4B7BB3C0695EBE979FB4D06CDCB6D50780C2AE341E1FA98FE96B340653AC81C1EA7D9E9797A0E6A97E9F539685E9F8FD3(CTRL-Z)
3.AT+CMGS=147
>0051000B918499999999F900000097050003010303E169BA0B342D9341EEF218C40E8FEB7390BDCC06A5E1F37A1B440EC3D3E2FA1C347EBBCFF532A84E0785E92076785C9FBB40457A3ADC06A5DD20F29BFD9683E875393C3D7781A66532689EA683C2ED321D546697D3E6B29B0C8AD7C36D17C859778F41E4F4D99D9ECFD36D505DEE0E83C2207A99CDAECF41EE3A9B1D6EBB00(CTRL-Z)
So as you can see from the las message: 0051000B918499999999F900000097050003010303 there is preambula with my "+489999999999" number, and with the length of the message (97) ant the las one is the message number "3". So please try it by your own research.
Best Regards,
Krzysztof
Yes it works fine with PDU, but nevertheless,
I do get 2 or 3 sms instead of one.
Just for the readability reason...
//------------
for(int i = 0; i < text_sms[].length; i++){
atcmdresponse =
SendCommand("AT+CMGS = "+Integer.parseInt(text_sms[i])+"\r");
i++;
atcmdresponse =
SendCommand( text_sms[i].trim() + (char) 26 + "\r");
}//for...
//------------
I guess that each ^Z send a message.
But it has turned that it is dead herring,
because the listener does not return anymore.
I only get a:
Notify RINGChanged -> true
and nothing more
The sim-card has apparently gone dead.
Pity, pity, pity, do not know what to do.
Br
Hello,
With the provided AT commands you can send only one SMS at a time. You can split the long text into few messages but it will still be delivered as few messages.
You need an additional layer to reach your goal and that would be the concatenated SMS as you can read here https://en.wikipedia.org/wiki/Concatenated_SMS That will in fact involve adding some specific headers to the user data of PDU message.
If your device does not receive messages any more please check if the storage is not full with AT+CPMS? command.
Best regards,
Bartłomiej
It is working again. I think that when I have been naughty, using the above code, the provider hook me off for the next 24 hour or more, until the emi number no longer disturb their server with inadequate codes. I recall a similar action, a year or more back in my history. So, be sure Your code is in order.
I have tryed to decode the information from the above link, but for now I must admit that it is above matematic skill's. Perhaps anothe developer is able to enlighten us with come code, whatever. It is a little pity, that problem shall stay unresolved.
Br
Hello,
I agree that PDU syntax may look complex and complicated. However this User Data Header that you need to add to the begging of user data section in PDU does not add much more complexity. Here's a description from some other site(https://www.clockworksms.com/blog/concatenated-sms):
Bytes Description
05 The UDHL, or length of the UDH. So the following five bytes are UDH
00 This is the IEI. This identifier says this is a concatenated message
03 This is the IEDL. It says that next 3 bytes are the data for this IE.
A6 The reference number of this concatenated message. Each part must have the same reference number.
02 There are two parts to this concatenated message.
01 or 02 This indicates whether the SMS is the first or second part.
I agree that some API would be helpful here.
Best regards,
Bartłomiej
Dear Gemalto.
I can not find out how to send long sms.
I have used thise:
05 00 03 CC 03 01
05 00 03 CC 03 02
05 00 03 CC 03 03
In the PDu generator I have filled in both phone numbers.
Then I have put in the above setings and the text as followes
050003CC0301And the text here.
Each PDU in an array {number,pdu}x3
First PDU = AT+CMGC=95
>
Second PDU = 0691541303000011000A9154829409530000FF5DB01A0C06 etc
But I get an error
+CMS ERROR: operation not supported
//-----------------------------------------------------------------------------
// AT+CMGS AT+CMGC
for(int i = 0; i < pdu_string_array.length ; i++){
sms_response =
SendCommand( "AT+CMGC=" + Integer.parseInt(pdu_string_array[i])+ "\r");
System.out.println("First PDU = "+sms_response);
if(sms_response.indexOf("+CMS ERROR:")!=-1)break;
i++;
sms_response =
SendCommand( pdu_string_array[i].trim() + (char) 26 + "\r");
System.out.println("Second PDU = "+sms_response);
if(sms_response.indexOf("+CMS ERROR:")!=-1)break;
}//for...
//-----------------------------------------------------------------------------
SMS SUBMIT (send)
Receipt requested: no
SMSC: 45***
Receipient: 45***
TOA: 91 international, Numbering Plan: unknown
Validity: Rel 63w
TP-PID: 00
TP-DCS: 00
TP-DCS-desc: Uncompressed Text, No class
Alphabet: Default (7bit)
Hello,
I've done a test. I have never been building concatenated PDU messages before. And indeed it was not as easy as it seemed at the first glance.
Besides UDH which is simple there is some more to be done.
I have generated PDU with some online tool. The result was like below (I have changed the phone number):
AT+CMGS=28
0001000B918466767788F800001154747A0E4ACF41F0B09C0E7ABBCB2E
Then I added UDH (050003A60201) in front of my data:
0001000B918466767788F8000011050003A6020154747A0E4ACF41F0B09C0E7ABBCB2E
Then I have added 6 to CMGS parameter as I have added 6 bytes:
AT+CMGS=34
Then I have added 7 to the data length encoded in the PDU (as according to https://en.wikipedia.org/wiki/Concatenated_SMS#PDU_****_SMS UDH is 7 septets in length):
0001000B918466767788F8000018050003A6020154747A0E4ACF41F0B09C0E7ABBCB2E
Finally I had to set the UDH bit in the first octet of the PDU to let the SMS center know that a UDH is present. I have found this information here http://mobiletidings.com/2009/02/18/combining-sms-messages/
The result was like below:
0041000B918466767788F80000 18 050003A60201 54747A0E4ACF41F0B09C0E7ABBCB2E
I have done the same with the second message.
Then I have sent one after another to my cell phone where both messages arrived as a single message.
But there was one more problem - the text was like garbage.
According to wiki "a single bit of padding has to be prepended to the message" - so the whole user data must be padded.
For this purpose I have prepared a Java method like below:
I cannot guarantee that it will always work fine but for my test it did the job and the whole text was readable on my phone.
I hope that this example will help.
Best regards,
Bartłomiej
Pages