Thanks mainly to your excellent tutorial I have set up a Waveshare SIM7600G-H M.2 HAT on a RPi 4B and can send simple text messages (the ipex adaptor cables are a real fiddle).
For my project I need to send a message about 200 characters in length (ie more than the 160 limit). Don’t want to send the message as two texts. I understand that multipart messaging is the answer but can find next to nothing regarding the required AT commands. Have you any experience or better, a worked example? I’m using Python.
Hi @Martin ,
You are correct re using multipart messaging, rather than multiple messages.
I am not sure at the moment about doing it via AT commands though as I was sending messages for business through a dedicated link to the telco’s Short Message Service Centre (SMSC). This is unfortunately a business level service. You may find that some third party providers can manage that for you.
(We would occasionally generate a message that required 5 messages to transmit. )
I will look up into my original C code to (refresh my memory) see if there is a protocol indicator that you could send within the message(s) to let the recipient know that it has to reassemble the messages into one. I think that you still send multiples, in a stream, and the receiver shows them as one. The 160 character limit is a hard limit per message…
In the interim, you could try splitting your message in 160 and 40 char pieces, and send them one after the other to the receiver to ‘see what happens’.
Our multi message ‘protocol’
When we were sending loooong messages we would scan for a newline character just before the character limit, break there, add our trailer as below, send the chunk, and repeat
We actually chopped the strings off at about 154 chars, as we would then add an indicator as follows to each chunk. NOTE - this was our protocol to indicate that it was a multipart message.
C-style escapes shown
message part a \n1\0
message part b \n2\0
last part \nend\0
i.e. each segment had a trailing <sequential digit || “end”> sequence
The messages were then sent as a unbroken sequence to the SMSC, each one appropriately bundled up in the protocol data unit (PDU) for the SMSC.
These would come out as a sequence of individual messages to the recipient. (not what you want)
But we could ALSO send a message up to 1542 characters (nominally == 10 messages), by ‘just sending it’ via the SMSC connection protocol. but we had to configure the handler to use a set maximum number of ‘messages’ AND set the ‘concatenation’ flag. So there is probably some deep indicator that is used by the SMS systems to do long messages. They really still can only send short ones, but they send a lot that automagiclly turn into one message on the receiver phone.
As 1542 != 10 * 160, I think that the missing character space may be the ‘magic’
This is my best guess for you
The SMPP protocol - this is the protocol between us and the telco SMSC, but has info re the PDU formats
A general background