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:

SettingValue
PortThe modem’s COM or ttyUSB port
Baud rate115200
Data bits8
ParityNone
Stop bits1
Flow controlNone or hardware
Press Enter after every AT command. An OK response means the modem accepted and executed the command.

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
CommandPurposeExpected result
ATChecks basic serial communicationOK
AT+CMEE=2Enables detailed error codesOK
AT+CPIN?Checks SIM and PIN status+CPIN: READY
AT+CREG?Checks network registration+CREG: 0,1
AT+CSCA?Reads the SMS service centre numberA valid SMSC number
AT+CMGF?Shows the current SMS mode+CMGF: 0 for PDU mode or +CMGF: 1 for text mode
The modem must be registered to the mobile network before it can send an SMS. A response of +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.
Do not press Enter to send the message. The message must be terminated with Ctrl+Z, which sends the ASCII control character 0x1A.

4. Successful response

Expected modem response

AT+CMGS="+36301234567"
>
HyperTerminal SMS test
[Ctrl+Z]

+CMGS: 12

OK
ResponseMeaning
>The modem is waiting for the SMS message body.
+CMGS: 12The SMS was accepted by the modem and submitted to the SMS service centre. The number is the message reference.
OKThe send command completed successfully.
A successful +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

SymptomLikely causeWhat to check
No response to ATWrong COM port, cable, driver or baud rateUse 115200 baud, verify the correct port and cable
AT+CPIN? returns ERRORModem cannot read the SIM, or PIN/PUK is requiredReseat the SIM and check PIN status
+CREG: 0,0Modem is not registered to the networkCheck antenna, SIM activation and AT+COPS=?
AT+CSCA? returns an empty valueMissing SMS service centre numberSet the correct SMSC number for the mobile operator
No > prompt appearsWrong SMS mode or incorrect AT+CMGS syntaxRun AT+CMGF=1, then retry AT+CMGS="+36..."
Message is not sent after EnterWrong end-of-message characterTerminate the message with Ctrl+Z
+CMS ERRORNetwork, SMSC, SIM or modem-side SMS errorRead the detailed error code enabled by AT+CMEE=2

Quick reference

CommandFunction
ATChecks modem communication
AT+CMEE=2Enables 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=1Selects SMS text mode
AT+CMGS="+36301234567"Starts an SMS to the given number
Ctrl+ZSends the entered SMS message
AT+CNMI=2,1,0,0,0Configures incoming message notifications
AT+CMGL="ALL"Lists stored SMS messages
AT+CMGR=1Reads SMS message index 1
AT+CMGF=0Selects SMS PDU mode