25. Sending SMS Messages from a Computer / PC Using AT Commands (AT+CMGS, AT+CMSS)
Either 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:
AT+CMGS="91234567"<CR>Sending text messages is easy.<Ctrl+z>
To 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:
AT+CMGW="91234567"<CR>Sending text messages is easy.<Ctrl+z>
Let's 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:
AT+CMSS=3
As 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:
AT+CMGD=3
As 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.
In 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:
AT+CMSS=3,"91234567"
AT+CMSS=3,"97777777"
AT+CMSS=3,"96666666"
...
Note: 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.
25.1. Comparison Table of the AT Commands +CMGS and +CMSS
The comparison table below summarizes the differences between the AT commands +CMGS and +CMSS that are discussed in the previous section.
|
+CMGS AT command |
+CMSS AT command |
---|---|---|
Parameters |
+CMGS takes the SMS message to be sent as a parameter. |
+CMSS takes the index number that specifies the location of the SMS message in the message storage area as a parameter. |
Sending new SMS messages |
Using +CMGS is more convenient. +CMGS can be used to send new SMS messages without the help of other AT commands. However, no copy of the SMS message sent is saved in the message storage area. |
+CMSS 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 bit cumbersome. However, a copy of the SMS message sent can be saved in the message storage area. |
Sending the same SMS message to multiple recipients |
Using +CMGS is less convenient. |
Using +CMSS is more convenient. |
Previous Page | Page 44 of 65 | Next Page |
- 1. Introduction to SMS Messaging
- 2. What Makes SMS Messaging So Successful Worldwide?
- 3. Example Applications of SMS Messaging
- 4. What is an SMS Center / SMSC?
- 5. Basic Concepts of SMS Technology
- 6. Intra-operator SMS Messages
- 7. Inter-operator SMS Messages
- 8. International SMS Messages
- 9. What is an SMS Gateway?
- 10. How to Send SMS Messages from a Computer / PC?
- 11. How to Receive SMS Messages Using a Computer / PC?
- 12. Introduction to GSM / GPRS Wireless Modems
- 13. How to Use Microsoft HyperTerminal to Send AT Commands to a Mobile Phone or GSM/GPRS Modem?
- 14. Introduction to AT Commands
- 15. General Syntax of Extended AT Commands
- 16. Result Codes of AT Commands
- 17. AT Command Operations: Test, Set, Read and Execution
- 18. Testing the Communication between the PC and GSM/GPRS Modem or Mobile Phone
- 19. Checking if the GSM/GPRS Modem or Mobile Phone Supports the Use of AT Commands to Send, Receive and Read SMS Messages
- 20. Operating Mode: SMS Text Mode and SMS PDU Mode
- 21. Setting or Reading the Service Center Address / SMSC Address (AT+CSCA)
- 22. Preferred Message Storage (AT+CPMS)
- 23. Writing SMS Messages to Memory / Message Storage (AT+CMGW)
- 24. Deleting SMS Messages from Message Storage (AT+CMGD)
- 25. Sending SMS Messages from a Computer / PC Using AT Commands (AT+CMGS, AT+CMSS)
- 26. Reading SMS Messages from a Message Storage Area Using AT Commands (AT+CMGR, AT+CMGL)
- 27. Appendix A: How to Choose an SMS Service Provider (SMS Gateway Provider, SMS Reseller, SMS Broker)?
- 28. Appendix B: Comparison Table of SMS Service Providers (SMS Gateway Providers, SMS Resellers, SMS Brokers)
- 29. Appendix C: Free Software/Tools and Libraries for Sending and Receiving SMS Messages with a Computer / PC
- 30. Appendix D: GSM 7-bit Default Alphabet Table (with Character Codes of ISO 8859 Latin 1)