This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf9160 how to send sms it in packages if the content exceeds 160 characters

At present, the SMS is sent normally. The format of nrf9160 is 7bit, and can send a maximum of 160 characters. However, how to send it in packages if the content exceeds 160 characters, and the at manual does not describe how to subpackage. I hope the original factory can help.

this is log

LTE Link Connecting ...
[00:00:00.210,754] <inf> at_cmd: AT%XSYSTEMMODE=1,0,0,0
[00:00:00.218,353] <inf> at_cmd: OK

[00:00:00.222,503] <inf> at_cmd: AT+CEREG=5
[00:00:00.233,581] <inf> at_cmd: OK

[00:00:00.237,792] <inf> at_cmd: AT%XSYSTEMMODE=1,0,0,0
[00:00:00.251,403] <inf> at_cmd: OK

[00:00:00.255,615] <inf> at_cmd: AT+CFUN=1
[00:00:00.298,004] <inf> at_cmd: OK

[00:00:02.014,709] <inf> at_cmd: +CEREG: 2,"0001","01A2D001",7,0,0,"11100000","11100000"

[00:00:02.906,524] <inf> at_cmd: +CEREG: 1,"0001","01A2D001",7,,,"11100000","11100000"

LTE Link Connected!
[00:00:02.917,327] <dbg> main_.main: Press Button 1 to start the FOTA download

[00:00:02.925,140] <inf> at_cmd: AT+CNMI?
[00:00:02.929,901] <inf> at_cmd: +CNMI: 0,0,0,0,1
OK

[00:00:02.935,729] <inf> at_cmd: AT+CNMI=3,2,0,1
[00:00:02.941,345] <inf> at_cmd: OK

[00:00:02.945,495] <inf> sms: SMS client successfully registered
sms len 177 buf 0031000B812103000100F5000000B974747A0E4ACF41F4F29C9E769F416432994C2693C96432994C2693C96432994C2693C96432994C2693C96432994C2693C96432994C2693C96432994C2693C96432994C2693C96432994C2693C96432994C2693C96432994C2693C96432994C2693C96432994C2693C96432994C2693C96432994C2693C90031000B812103000100F5000000B974747A0E4ACF41F4F29C9E769F416432994C2693C96432994C2693C96432994C2693C96432994C2693C96432994C2693C96432994C2693C96432994C2693C96432994C2693C96432994C2693C96432994C2693C96432994C2693C96432994C2693C96432994C2693C96432994C2693C96432994C2693C96432994C2693C964329
[00:00:20.279,022] <inf> at_cmd: >

[00:01:20.280,914] <inf> at_cmd: ERROR

  • Hi,

     

    At present, the SMS is sent normally. The format of nrf9160 is 7bit, and can send a maximum of 160 characters. However, how to send it in packages if the content exceeds 160 characters, and the at manual does not describe how to subpackage. I hope the original factory can help.

    I am checking internally if we support segmentation and re-assembly of sms pdu, and I'll get back to you with details soon.

     

    Kind regards,

    Håkon

  • Hi,

     

    Modem does not have "direct" support to send these over lengthen SMS, so segmentation will not be done by automatically.

    So client must send so many AT commands as needed with each having one part of concatenated message (so f.ex. if total length would be 200 chars, there would need to use two AT commands where the first one can send 153 chars (with UDH of part 1 in the begin of data part and the second one then has the rest of char data, which means that TP-Data has UDH for part 2 + 47 chars content data).

    Client needs to construct by self a correctly decoded AT commands where SMS PDU data has these UDH (User data header) blocks for each concatenated message, like this smpp webpage also describes in that User Data Header section.

    Customer/client could take a look into 3GPP spec 23-040 that describes how to use User Data Header and how to use/make concatenation.

    Adding here for example one multipart/concatenated SMS message (has 2 parts) decoded for AT commands (have bolded and used colors to separate some fields):

    AT+CMGS=154

    +00+7100*0c91180993569390*0000ffa00500030102016031d98c56b3dd7039584c36a3d56c375c0e1693cd6835db0d9783c564335acd76c3e56031d98c56b3dd7039584c36a3d56c375c0e1693cd6835db0d9783c564335acd76c3e56031d98c56b3dd7039584c36a3d56c375c0e1693cd6835db0d9783c564335acd76c3e56031d98c56b3dd7039584c36a3d56c375c0e1693cd6835db0d9783c564

    (After OK response then 2nd part)

    AT+CMGS=32

    +00+7100*0c91180993569390*0000ff1405000301020266b49aed86cbc162b219ad06

     

    And Decoded as below:

    SCA: 00 (the first byte)

    PDU Type: 71 (UDHI is set, look for 3GPP spec)

    MR: 00

    DA: 0c91180993569390 (destination address = recipient 819039653909, 0c = len, 91 = international type, then the actual number)

    TP-PID: 00

    TP-DCS: 00 (GSM-7)

    TP-VP: 0xFF (validity period of message)

    TP-UDL: 0x0a (160) and 0x14 (20)

     Then starts the actual SMS TP-Data part ->

    User Data Header 1: 050003+01+0201

    User data Header 2: 050003+01+0202

     And User data header data opened ->

     IEI: 00 (concatenated message indication, first byte)

     IEDL: 03 (3 bytes, next 2 bytes)

     Reference Number of the concatenated message: 01 (same for all in "one over lengthed SMS")

     Total parts of the concatenated message: 02

     Index of this part of the concatenated message: 01 and 02 (the last byte of UDH)

    After UDH parts is then the actual message char data (need to take care use of correct padding like described in 3GPP spec).

    SMS content / "char data" used here is just a dummy (166 bytes of total) decoded to 7 bit format:

    0123456789012345678901234567890123456789

    0123456789012345678901234567890123456789

    0123456789012345678901234567890123456789

    0123456789012345678901234567890123456789012345

     

    With google can be found many pages explaining this same issue, like;

    https://techsofar.com/combining-sms-messages/

    https://shekharbiradar.wordpress.com/send-and-receive-concatenated-sms-in-pdu-mode/

     

    Kind regards,

    Håkon

Related