Send a Test SMS Using AT Commands
This guide explains how to send a test SMS from an LTE modem using HyperTerminal or another serial terminal. It uses SMS Text Mode, which is the simplest method for manual testing.
Download: hyperterminal.zip
Before you start
Connect the modem to the computer and open its serial port in HyperTerminal. Use the following connection settings:
| Setting | Value |
|---|---|
| Port | The modem’s COM or ttyUSB port |
| Baud rate | 115200 |
| Data bits | 8 |
| Parity | None |
| Stop bits | 1 |
| Flow control | None or hardware |
1. Check modem readiness
Recommended initial commands
AT OK AT+CMEE=2 OK AT+CPIN? +CPIN: READY OK AT+CREG? +CREG: 0,1 OK AT+CSCA? +CSCA: "+36209300099" OK AT+CMGF? +CMGF: 0 OK
| Command | Purpose | Expected result |
|---|---|---|
AT | Checks basic serial communication | OK |
AT+CMEE=2 | Enables detailed error codes | OK |
AT+CPIN? | Checks SIM and PIN status | +CPIN: READY |
AT+CREG? | Checks network registration | +CREG: 0,1 |
AT+CSCA? | Reads the SMS service centre number | A valid SMSC number |
AT+CMGF? | Shows the current SMS mode | +CMGF: 0 for PDU mode or +CMGF: 1 for text mode |
+CREG: 0,1 means that it is registered to its home network.
2. Switch to SMS text mode
AT+CMGF=1
AT+CMGF=1 OK
What it does: switches the modem from PDU mode to SMS Text Mode.
Why use it: in text mode you can enter the recipient phone number and message body as readable text. This is much easier for manual testing than PDU mode.
Result: OK means the modem is now ready to send SMS messages in text mode.
3. Send the test SMS
AT+CMGS
AT+CMGS="+36301234567" > HyperTerminal SMS test [Ctrl+Z]
What it does: starts a new outgoing SMS message to the specified phone number.
How to use it:
- Enter the recipient number in international format, for example
+36301234567. - Put the phone number between quotation marks.
- After pressing Enter, the modem displays the
>prompt. - Type the message text.
- Press Ctrl+Z to send the message.
0x1A.
4. Successful response
Expected modem response
AT+CMGS="+36301234567" > HyperTerminal SMS test [Ctrl+Z] +CMGS: 12 OK
| Response | Meaning |
|---|---|
> | The modem is waiting for the SMS message body. |
+CMGS: 12 | The SMS was accepted by the modem and submitted to the SMS service centre. The number is the message reference. |
OK | The send command completed successfully. |
+CMGS response means that the modem handed the message to the mobile network. It does not necessarily prove that the message has already been delivered to the recipient’s phone.
5. Complete test sequence
Copy-paste sequence
AT AT+CMEE=2 AT+CPIN? AT+CREG? AT+CSCA? AT+CMGF=1 AT+CMGS="+36301234567" > HyperTerminal SMS test [Ctrl+Z]
Replace +36301234567 with your own mobile number. Use the international format, including the leading +.
6. Enable delivery reports
AT+CNMI
AT+CNMI=2,1,0,0,0 OK
What it does: configures how the modem reports incoming SMS messages and status reports to the connected computer.
Result: after this command, incoming messages or delivery reports may appear directly in the terminal, depending on the modem configuration and mobile network.
List stored messages
AT+CMGL="ALL"
Lists SMS messages stored in the selected message storage area.
Read one message
AT+CMGR=1
Reads the SMS message stored at index 1.
7. Return to PDU mode
AT+CMGF=0
AT+CMGF=0 OK
What it does: switches the modem back to PDU mode.
When to use it: PDU mode is commonly used by SMS gateway software because it supports international character sets, multipart messages and more reliable encoding.
Note: in PDU mode, AT+CMGS requires the length of the PDU message instead of a phone number.
Troubleshooting
| Symptom | Likely cause | What to check |
|---|---|---|
No response to AT | Wrong COM port, cable, driver or baud rate | Use 115200 baud, verify the correct port and cable |
AT+CPIN? returns ERROR | Modem cannot read the SIM, or PIN/PUK is required | Reseat the SIM and check PIN status |
+CREG: 0,0 | Modem is not registered to the network | Check antenna, SIM activation and AT+COPS=? |
AT+CSCA? returns an empty value | Missing SMS service centre number | Set the correct SMSC number for the mobile operator |
No > prompt appears | Wrong SMS mode or incorrect AT+CMGS syntax | Run AT+CMGF=1, then retry AT+CMGS="+36..." |
| Message is not sent after Enter | Wrong end-of-message character | Terminate the message with Ctrl+Z |
+CMS ERROR | Network, SMSC, SIM or modem-side SMS error | Read the detailed error code enabled by AT+CMEE=2 |
Quick reference
| Command | Function |
|---|---|
AT | Checks modem communication |
AT+CMEE=2 | Enables detailed error reporting |
AT+CPIN? | Checks SIM and PIN status |
AT+CREG? | Checks network registration |
AT+CSCA? | Reads the SMS service centre number |
AT+CMGF=1 | Selects SMS text mode |
AT+CMGS="+36301234567" | Starts an SMS to the given number |
Ctrl+Z | Sends the entered SMS message |
AT+CNMI=2,1,0,0,0 | Configures incoming message notifications |
AT+CMGL="ALL" | Lists stored SMS messages |
AT+CMGR=1 | Reads SMS message index 1 |
AT+CMGF=0 | Selects SMS PDU mode |