10. How to Send SMS Messages from a Computer / PC?
In general, there are two ways to send SMS messages from a computer / PC to a mobile phone:
Connect a mobile phone or GSM/GPRS modem to a computer / PC. Then use the computer / PC and AT commands to instruct the mobile phone or GSM/GPRS modem to send SMS messages.
Connect the computer / PC to the SMS center (SMSC) or SMS gateway of a wireless carrier or SMS service provider. Then send SMS messages using a protocol / interface supported by the SMSC or SMS gateway.
If you do not want to develop SMS software or applications but just want to use your computer / PC to send text messages, you may want to read our Quick Guide for Non-Developers.
10.1. The 1st Way: Sending SMS Messages from a Computer Using a Mobile Phone or GSM/GPRS Modem
The SMS specification has defined a way for a computer to send SMS messages through a mobile phone or GSM/GPRS modem. A GSM/GPRS modem is a wireless modem that works with GSM/GPRS wireless networks. A wireless modem is similar to a dial-up modem. The main difference is that a wireless modem transmits data through a wireless network whereas a dial-up modem transmits data through a copper telephone line. More information about GSM/GPRS modems will be provided in the section "Introduction to GSM / GPRS Wireless Modems". Most mobile phones can be used as a wireless modem. However, some mobile phones have certain limitations comparing to GSM/GPRS modems. This will be discussed in the section "Which is Better: Mobile Phone or GSM / GPRS Modem" later.
To send SMS messages, first place a valid SIM card from a wireless carrier into a mobile phone or GSM/GPRS modem, which is then connected to a computer. There are several ways to connect a mobile phone or GSM/GPRS modem to a computer. For example, they can be connected through a serial cable, a USB cable, a Bluetooth link or an infrared link. The actual way to use depends on the capability of the mobile phone or GSM/GPRS modem. For example, if a mobile phone does not support Bluetooth, it cannot connect to the computer through a Bluetooth link.
After connecting a mobile phone or GSM/GPRS modem to a computer, you can control the mobile phone or GSM/GPRS modem by sending instructions to it. The instructions used for controlling the mobile phone or GSM/GPRS modem are called AT commands. (AT commands are also used to control dial-up modems for wired telephone system.) Dial-up modems, mobile phones and GSM/GPRS modems support a common set of standard AT commands. In addition to this common set of standard AT commands, mobile phones and GSM/GPRS modems support an extended set of AT commands. One use of the extended AT commands is to control the sending and receiving of SMS messages.
The following table lists the AT commands that are related to the writing and sending of SMS messages:
Send message from storage
Write message to memory
More messages to send
One way to send AT commands to a mobile phone or GSM/GPRS modem is to use a terminal program. A terminal program's function is like this: It sends the characters you typed to the mobile phone or GSM/GPRS modem. It then displays the response it receives from the mobile phone or GSM/GPRS modem on the screen. The terminal program on Microsoft Windows is called HyperTerminal. More details about the use of Microsoft HyperTerminal can be found in the "How to Use Microsoft HyperTerminal to Send AT Commands to a Mobile Phone or GSM/GPRS Modem" section of this SMS tutorial.
Below shows a simple example that demonstrates how to use AT commands and the HyperTerminal program of Microsoft Windows to send an SMS text message. The lines in bold type are the command lines that should be entered in HyperTerminal. The other lines are responses returned from the GSM / GPRS modem or mobile phone.
> A simple demo of SMS text messaging.
Here is a description of what is done in the above example:
Line 1: "AT" is sent to the GSM / GPRS modem to test the connection. The GSM / GPRS modem sends back the result code "OK" (line 2), which means the connection between the HyperTerminal program and the GSM / GPRS modem works fine.
Line 3: The AT command +CMGF is used to instruct the GSM / GPRS modem to operate in SMS text mode. The result code "OK" is returned (line 4), which indicates the command line "AT+CMGF=1" has been executed successfully. If the result code "ERROR" is returned, it is likely that the GSM / GPRS modem does not support the SMS text mode. To confirm, type "AT+CMGF=?" in the HyperTerminal program. If the response is "+CMGF: (0,1)" (0=PDU mode and 1=text mode), then SMS text mode is supported. If the response is "+CMGF: (0)", then SMS text mode is not supported.
Line 5 and 6: The AT command +CMGW is used to write an SMS text message to the message storage of the GSM / GPRS modem. "+85291234567" is the recipient mobile phone number. After typing the recipient mobile phone number, you should press the Enter button of the keyboard. The GSM / GPRS modem will then return a prompt "> " and you can start typing the SMS text message "A simple demo of SMS text messaging.". When finished, press Ctrl+z of the keyboard.
Line 7: "+CMGW: 1" tells us that the index assigned to the SMS text message is 1. It indicates the location of the SMS text message in the message storage.
Line 9: The result code "OK" indicates the execution of the AT command +CMGW is successful.
Line 10: The AT command +CMSS is used to send the SMS text message from the message storage of the GSM / GPRS modem. "1" is the index of the SMS text message obtained from line 7.
Line 11: "+CMSS: 20" tells us that the reference number assigned to the SMS text message is 20.
Line 13: The result code "OK" indicates the execution of the AT command +CMSS is successful.
To send SMS messages from an application, you have to write the source code for connecting to and sending AT commands to the mobile phone or GSM/GPRS modem, just like what a terminal program does. You can write the source code in C, C++, Java, Visual Basic, Delphi or other programming languages you like. However, writing your own code has a few disadvantages:
You have to learn how to use AT commands.
You have to learn how to compose the bits and bytes of an SMS message. For example, to specify the character encoding (e.g. 7-bit encoding and 16-bit Unicode encoding) of an SMS message, you need to know which bits in the message header should be modified and what value should be assigned.
Sending SMS messages with a mobile phone or GSM/GPRS modem has a drawback -- the SMS transmission speed is low. As your SMS messaging application becomes more popular, it has to handle a larger amount of SMS traffic and finally the mobile phone or GSM/GPRS modem will not be able to take the load. To obtain a high SMS transmission speed, a direct connection to an SMSC or SMS gateway of a wireless carrier or SMS service provider is needed. However, AT commands are not used for communicating with an SMS center or SMS gateway. This means your have to make a big change to your SMS messaging application in order to move from a wireless-modem-based solution to a SMSC-based solution.
In most cases, instead of writing your own code for interacting with the mobile phone or GSM/GPRS modem via AT commands, a better solution is to use a high-level SMS messaging API (Application programming interface) / SDK (Software development kit) / library. The API / SDK / library encapsulates the low-level details. So, an SMS application developer does not need to know AT commands and the composition of SMS messages in the bit-level. Some SMS messaging APIs / SDKs / libraries support SMSC protocols in addition to AT commands. To move from a wireless-modem-based SMS solution to a SMSC-based SMS solution, usually you just need to modify a configuration file / property file or make a few changes to your SMS messaging application's source code.
The links to some open source and free SMS messaging libraries can be found in the article "Free Libraries/Tools for Sending/Receiving SMS with a Computer".
Another way to hide the low-level AT command layer is to place an SMS gateway between the SMS messaging application and the mobile phone or GSM/GPRS modem. (This has been described in the section "What is an SMS Gateway?" earlier.) Simple protocols such as HTTP / HTTPS can then be used for sending SMS messages in the application. If an SMSC protocol (e.g. SMPP, CIMD, etc) is used for communicating with the SMS gateway instead of HTTP / HTTPS, an SMS messaging API / SDK / library can be very helpful to you since it encapsulates the SMSC protocol's details.
Usually a list of supported / unsupported mobile phones or wireless modems is provided on the web site of an SMS messaging API / SDK / library or an SMS gateway software package. Remember to check the list if you are going to use an SMS messaging API / SDK / library or an SMS gateway software package.
10.1.1. Major Drawback of Sending SMS Messages through a Mobile Phone or GSM/GPRS Modem -- Low SMS Sending Rate
Using a mobile phone or GSM/GPRS modem to send SMS messages has a major drawback, that is the SMS sending rate is too low. Only 6-10 SMS messages can be sent per minute (when the "SMS over GSM" mode is used). The performance is not affected by the connection between the computer and the mobile phone or GSM/GPRS modem (i.e. the SMS sending rate is about the same no matter the mobile phone or GSM/GPRS modem is connected to the computer through a serial cable, USB cable, Bluetooth link or infrared link) and does not depend on whether a mobile phone or GSM/GPRS modem is used (i.e. the SMS sending rate is about the same no matter a mobile phone or a GSM/GPRS modem is used). The determining factor for the SMS sending rate is the wireless network.
|Previous Page||Page 10 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)