25. Sending SMS
Messages from a Computer / PC Using AT Commands (AT+CMGS, AT+CMSS)
of the AT commands +CMGS (command name in text: Send Message) and
+CMSS (command name in text: Send Message from Storage) can be used
to send SMS messages from a computer / PC. The key difference between
them is that the +CMGS AT command takes the SMS message to be sent as
a parameter, while the +CMSS AT command takes the index number that
specifies the location of the SMS message in the message storage area
as a parameter. Following is an example for illustrating the
difference. Suppose you want to send the text message "Sending
text messages is easy." from a computer / PC to the mobile phone
number 91234567 using the +CMGS AT command in SMS text mode. Here is
the command line to be used:
text messages is easy.<Ctrl+z>
send the same text message using the +CMSS AT command, first you have
to use the AT command +CMGW
(command name in text: Write Message to Memory) to write the text
message to the message storage area. In SMS text mode, the command
line should be:
text messages is easy.<Ctrl+z>
say the SMS text message is now located at index 3 of the message
storage area. You can use the +CMSS AT command to send the text
message to the message center by the following command line:
storage space is limited, if every SMS text message sent is left in
the message storage area, there will come a time when no more SMS
text messages can be written. To free some storage space, you can use
the AT command +CMGD (command
name in text: Delete Message) to delete the SMS text message from the
message storage area, like this:
you can see above, sending an SMS message by the +CMSS AT command is
a bit cumbersome, since it involves more steps and AT commands.
However, a copy of the sent SMS message can be saved in the message
storage area. This is not achievable with the +CMGS AT command.
some situations, it is more convenient to send SMS messages by the
+CMSS AT command than the +CMGS AT command. For example, if you have
to send the same SMS message to multiple recipients, using the +CMSS
AT command is more convenient:
To keep things simple in the above examples, we assume that the same
message storage area is used by the AT commands +CMSS, +CMGW, +CMGD
and for receiving SMS messages. But this may not be true in real
situations. To learn how to set the message storage areas to be used
by different SMS operations, please refer to the earlier section
"Preferred Message Storage
(AT+CPMS)" of this SMS tutorial.
Table of the AT Commands +CMGS and +CMSS
comparison table below summarizes the differences between the AT
commands +CMGS and +CMSS that are discussed in the previous section.
takes the SMS message to be sent as a parameter.
takes the index number that specifies the location of the SMS
message in the message storage area as a parameter.
new SMS messages
+CMGS is more convenient. +CMGS can be used to send new SMS
messages without the help of other AT commands.
no copy of the SMS message sent is saved in the message storage
has to be used together with +CMGW and +CMGD for sending new SMS
messages. As a result, the process involves more steps and is a
a copy of the SMS message sent can be saved in the message
the same SMS message to multiple recipients
+CMGS is less convenient.
+CMSS is more convenient.
Feedback Form (ExpandCollapse)