Sending out an SMS in text mode
Posted Under: SMS
- Sending out an SMS in text mode
- Sending out an SMS in PDU mode
- More on the SMS PDU
- Sending a flash SMS message
- What are EMS messages?
- Combining SMS messages
- WAP Push over SMS
- WAP Push SMS encoding
- EMS and WAP Push support
- Another WAP Push over SMS encoding
- SMS based applications
- Text formatting with EMS
- GSM-7 Encoding with the GNU iconv library
- How to pack GSM-7 characters into septets
- References
- Setting Voicemail Waiting Indication via SMS
- SMS via Email
As explained in a prevous post in this series, a GSM modem can let you send SMS messages from a PC. There are two basic ways to do this: text mode and PDU mode.
You can play around with your GSM modem using a terminal program like HyperTerminal (which came with Windows XP, but is no longer there in Windows Vista). The commands I mention can just be entered in the terminal window when connected to the modem. You can try the following basic commands, any modem should support these:
| ATI | Returns general modem identification |
| ATD<phone number> | Dials the phone number you supplied (don’t enter the <> brackets) |
| ATH | Hang-up the phone (useful after the previous command). |
The following commands are specific for GSM modems. If you get an error response (e.g. ‘+ERR’), your modem probably isn’t a GSM modem or it doesn’t support the extensions specific for GSM modems.
| AT+CGMI | Returns the modem’s manufacturer |
| AT+CGMM | Returns the modem’s model |
The command to find out which of the modes are supported by your GSM modem is ‘AT+CMGF=?’. Send this string to your modem (followed by a newline) and the phone will answer ‘0’ for PDU mode and ‘1’ for text mode or ‘0,1’ if it supports both modes.
If you want to send an SMS message in text mode your modem needs to support it and you need to make sure the modem is in text mode first. The command ‘AT+CMGF?’ will tell you which mode is currently active. The command ‘AT+CMGF=1’’ will set the mode in text mode (if supported).
In text mode sending a text message is easy. The command is:
AT+CMGS=<phone-number><CR> Text to be sent<Crtl-Z>
The <CR> and <Ctrl-Z> refer to the enter key and the Control-Z key combination respectively. There are some details regarding character sets, but if you stick to normal alpha-numeric texts (without accents or special characters), it should work as expected.
A followup post will elaborate a little more on text mode.







Reader Comments
hi. does anybody know which models support sending messages in text mode?
very helpful! I tried it on a Siemens TC65 gsm modem and it works. One note: I think you have misspelling error: it should be AT+CMGS and not AT+CNGS
Hope this helps!
Good catch; I fixed it. Thanks.
hi can anybody tell me if an s m s message is the same as a flash message thankx in advance
hi russell here again i meant to say an s m s message on an mobile
phone
Russel,
A regular SMS message is stored in the recipient phone (or SIM) and the phone indicates a new message has arrived with an SMS icon. A flash message is different in 2 ways: first it is displayed directly on the recipients phone, second (and this depends on how it was sent) it may not be stored so that when you dismiss the message it is gone.
Jeroen
Typo:
The command to find out which of the modes are supported by your GSM modem is ‘AT+CMGF=?’.
Not ‘AT+GSMF=?’.
Thanks for your helpful site!!
Thanks, I fixed it.
I sent a flash message from computer using a TC65 gsm/gprs modem to a Sony Ericsson F305 and to my surprise the phone asked if I wanted to save the message.
Standards are not followed by all!!!.
Regards
Franco
P.S. Most phones does not let you save the message!!!.
modem complaining of CMS ERROR 305, invalid text. i am using only normal alpha numeric. whats the problem