AT Command

Description

AT+CMGSEX command is used to send SMS messages.


Support

Module Tutorial

Examples

KeywordsAT+CMGSEX syntax, examples, parameters, error, input, response.

Try the below script in the AT Command Tester tool

//Script-at_cmgsex.at
//Send SMS message

//List of supported responses
AT+CMGF=?

//WAIT for 1 sec
WAIT=1

//Get the current SMS Mode
// 0 - PDU Mode, 1- Text Mode,
AT+CMGF?

//WAIT for 1 sec
WAIT=1

//Check whether device is registered
//If device is not registered, SMS cannot be sent
AT+CREG?

//First let us send SMS in text mode
AT+CMGF=1

//WAIT for 1 sec
WAIT=1

//Format for AT+CMGSEX
//AT+CMGSEX=[,][,, , ]
//Text is entered. 
//da - destination address
//toda  destination address Type
//mr - messag reference
//msg_seq - The segment number for long SMS
//msg_total - The total number of the segments for long SMS

//Send the message. Set your To number below
AT+CMGSEX="8545579983", 190, 1, 2

//Wait for the > prompt
WAIT=2

//Type the SMS text below
This is my SMS message

//Send the CTRL+Z character. ^z is special command of AT Command Script engine.
^z


Output of the above script in the AT Command Tester tool tool.

AT+CMGF=?

+CMGF: (0-1)

OK
AT+CMGF?

+CMGF: 1

OK
SMS message for is configured for Text mode
AT+CREG?

+CREG: 0,1

OK
The device is registered in home network.

AT+CMGF=1

OK
AT+CMGSEX="8545579983", 190, 1, 2

> 
> This is my SMS message

+CMGSEX: 190

OK