At instruction Introduction

Source: Internet
Author: User
Tags cmss

At command
At refers to attention. The AT Instruction Set is from the terminal device (terminal equipment, Te) or data terminal device (data terminal equipment, DTE) to the terminal adapter (terminal adapter, Ta) or sent by data circuit terminal equipment (DCE. Send AT commands via TA and te to control the functions of Mobile Station (MS) and interact with GSM network services. You can use AT commands to control calls, text messages, phone books, data services, and faxes. In early 1990s, the AT command was only used for modem operations. There is no precedent for controlling mobile phone text messages. Only one protocol called SMS blockmode is developed, which can be fully controlled by terminal devices (TE) or computers.
SMS. Several years later, major mobile phone manufacturers Nokia, Ericsson, Motorola, and HP jointly developed a complete set of AT commands for GSM, including SMS control. On this basis, the AT command evolved and was added to the GSM 07.05 standard and the current GSM 07.07 standard, which is fully standardized and sound. For example, there are three ways to control SMS: initial block mode, text mode based on AT command, and PDU Mode Based on at command. Till now, the PDU mode has replaced blockmode, and the latter gradually fades out. The communication protocol between the GSM module and the computer is some AT commands.
Set. The at command starts with at and ends with the character. The response packet of the AT command is in progress. If each command is successfully executed, a corresponding response is returned. For other unexpected information (such as dialing in, line without signal), the module will have corresponding information prompts, and the receiving end can process it accordingly.
Example: CDMA modem DTE
At <CR>
<LF> OK <LF>
Attest <CR>
<CR> error <LF>
If the AT command is successfully executed, the "OK" string is returned;
If the AT command syntax is incorrect or the AT command execution fails,
The "error" string is returned.

1. Related GSM at commands
The GSM at commands (from gsm07.05) related to SMS are shown in table 1:
Table 1 related GSM at commands

At command
Merit

At + cmgc
Send an SMS command (send a short message command)

At + cmgd
Delete SMS message (Short Message for deleting SIM card memory)

At + cmgf
Select SMS message formate (select the Short Message format: 0-pdu; 1-text)

 

At + cmgl
List SMS message from preferred store (list the short message PDU/Text: 0/"rec unread"-unread, 1/"rec read"-read, 2/"Sto unsent"-to be sent, 3/"Sto sent"-sent, 4/"all"-All)

At + cmgr
Read SMS message)

At + cmgs
Send SMS message)

At + cmgw
Write SMS message to memory (write a short message to the sim memory)

At + CMSS
Send SMS message from storage (send short messages from sin | M memory)

At + cnmi
New SMS message indications (displays new short messages)

At + CPMS
Preferred SMS message storage (select Short Message Memory)

At + csca
SMS service center address (Short Message Center address)

At + CSCB
Select Cell Broadcast messages (select cellular broadcast message)

At + CSMP
Set SMS text mode parameters (Set Short Message text mode parameters)

At + CSMs
Select Message Service (select short message service)

There are three modes to control short messages:
Block Mode

PDU Mode Based on at command

Text mode based on AT command

To use the block mode, the mobile phone manufacturer must provide driver support. Currently, the PDU mode has replaced the block mode, and the text mode is relatively simple. This article focuses on the Mode PDU mode, taking the Siemens product tc35t as an example.
2. Communication between the computer and tc35t
(1) RS232 serial port connection
Since tc35t comes with RS232 serial cable, you only need to connect it to the computer serial port. Open the Super Terminal, select the corresponding serial port, set the port parameters to: Speed-4800, parity bit-None, data bit-8, stop bit-1, traffic control-hardware.
(2) connection test
Enter "at" and press Enter. "OK" is returned on the screen, indicating that the computer and tc35t have been connected successfully, and tc35t can work properly. Then you can test various AT commands.
When the test command "at + cmgs = ?" If "OK" is returned, it indicates tc35t supports this command. The complete Syntax of this command is as follows:
If tc35t is in PDU mode (that is, "At + cmgf ?" Return "0 ")

at + cmgs = PDU is given <^ Z/esc>
If the short message is sent successfully, "OK" is returned and the message number is displayed:
+ cmgs: [,]
If the short message fails to be sent, the following message number is returned:
+ CMS error:
If tc35t is in text mode (that is, "At + cmgf?" Returns "1")

At + cmgs = [, toda] text is entered <^ Z/esc>
If the short message is sent successfully, "OK" is returned and the message number is displayed:
+ Cmgs: [,]
If the short message fails to be sent, the following message number is returned:
+ CMS error:
In addition, because tc35t is used, when a new short message arrives, tc35t is required to generate a prompt and use the command "at + cnmi ". The complete Syntax of this command is as follows:
At + cnmi = [] [,] [,] [,] [,]
If a new short message arrives, the tc35t will automatically return the following prompt:
+ Cmti: "SM ",
At this time, read the short message content using the "at + cmgr" command.
3. Analysis of PDU data format:
For example, we want to send the character "hi" to the destination "13677328099"
PDU string:
08 91 683104701305f0 11 00 0d 91 3176378290f9 00 00 00 02 c834
(1) 08-length of the SMS center address. The length of (91) + (683104701305f0.
(2) 91-message center number type. 91 indicates that ton/NPI complies with the international/e.164 standard and requires the plus sign (+) before the number. In addition, there are other values, but 91 is the most commonly used.
91-10010001
Bit No.
7
6
5
4
3
2
1
0

Name
1
Value Type
Number Identification

Type of number: 000-unknown, 001-International, 010-domestic, 111-reserved for extension;
Numbering Plan identification: 0000-unknown, 0001-isdn/telephone number (e.164/e.163), 1111-reserved for extension;
(3) 683104701305f0-SMS center number. The actual number should be 8613800731500 (the letter F indicates the length minus 1) because the location is slightly processed ). This needs to be modified based on different regions.
(1), (2), and (3) are collectively referred to as the address of the SMSC ).
(4) 11-File Header bytes.
11 & H = 00010001 & B
Bit No.
7
6
5
4
3
2
1
0

Name
TP-RP
TP-UDHI
TP-SPR
TP-VFP
TP-RD
TP-MTI

Value
0
0
0
1
0
0
0
1

response path-TP-RP (TP-reply-path): 0-not set; 1-set
User Data header ID-TP-UDHL (TP-user-data-header-indicator): 0-No header information; 1-header information
Status Report requirements-TP-SPR (TP-status-report-Request): 0-report required; 1-no need to report
validity period format-TP-VPF (TP-validity-period-format): 00-not supplied (not present); 10-INTEGER (standard ); 01-reserved; 11-provide half of the 8-bit bytes (semi-octet represented)
reject replication-TP-RD (TP-reject-duplicates): 0-accept replication; 1-reject replication
Message Type tip-TP-MTI (TP-message-type-indicator): 00-read (deliver ); 01-submit
000000-message-reference
length of the 0b-callednumber.
91-callednumber type (same as ② ).
20173176378290f9-called number. After displacement, the actual number is "13677328099 ".
the destination address (TP-destination-address) of region, region, and region ).
protocol 00-Protocol identifier TP-PID (TP-Protocol-identifier)
bit No.
7
6
5
4
3
2
1
0

bit No. 7 and bit No. 6: 00-for example, the allocation of bit no.0-bit No. 5 as defined below; 01-refer to full definition of gsm03.40 protocol logo; 10-reserved; 11-assign bit no.0-bit No. 5 to the service center (SC) for special purposes.
generally, these two locations are 00.
bit No. 5: 0-No remote network is used, but the protocol between Short Message devices. 1-remote network is used.
bit no.0-bits No. 4: 00000-implied; 00001-telex; 00010-group 3 Telefax; 00100-voice; 00101-European wireless Information System (ERMES ); 00110-domestic system; 10001-any x.400-based public information processing system; 10010-email.
000000-data encoding scheme TP-DCS (TP-data-coding-Scheme)
bit No.
7
6
5
4
3
2
1
0

Bit No. 7 and bit No. 6: generally set to 00; bit No. 5: 0-the text is not compressed; 1-the text is compressed using the GSM standardAlgorithmCompress; bit No. 4: 0-indicates that bit No.1 and bit no.0 are reserved bits, excluding information type information. 1-indicates that bit No.1 and bit no.0 contain information type information; bit No. 3 and bit No. 2: 00-default alphabet, 01-8bit, 10-usc2 (16bit), 11-reserved; bit No.1 and bit no.0: 00-class-Class 2 (SIM card-specific information), 11-Class 3.
Expires 00-validity period TP-VP (TP-valid-period)
VP value (& H)
Effective Period

00 to 8f
(VP + 1) * 5 minutes

90 to A7
12 hours + (VP-143) * 30 minutes

A8 to C4
(VP-166) * 1 day

C5 to FF
(VP-192) * 1 week

201702-User Data Length TP-UDL (TP-user-data-length)
2017c834-user data TP-UD (TP-user-data) "Hi"
4. Short Message Encoding
Set the content of the short message to be sent to "hi", and use the GSM character set to be 7-bit encoded. First, convert the character to a 7-bit binary, and then call the subsequent character to the front to complete the difference. For example, if H is translated into 1001000, And I is translated into 1101001, it is obvious that H's binary code is less than eight bits, then the last bits of I will be added to the front of H. Then it becomes 11001000 (C8), I has the remaining six digits of 110100, and then fill in two zeros in the front to change to 00110100 (34), so "hi" is changed to two eight-digit numbers of C8 34.
5. Sending and receiving of Short Messages
Since TC35 (t) supports the text format, we mainly test this format in the experiment.
(1) set up the short message center
At + csca = "+ 8613800731500" (short message center );
(2) set the short message sending format
At + cmgf = 1 (1-text; 0-pdu );
(3) send Short Messages (the short message content is "test ")
At + cmgs = "13508485560" (destination address)
> Test ^ Z;
(4) set the automatic prompt for Short Message arrival: Set the prompt for Short Message arrival. When the short message is received, the command + cmti: "SM", index (information storage location) will be obtained)
At + cnmi = 1, 1, 0, 0, 1 ();
(5) Get the short message content (once more), assuming Index = 8.
At + cmgr = 8
The returned information is as follows:
+ Cmgr: "rec unread", "+ 8613508485560", "01/07/16, 15: 37: 28 + 32", once more
6. Notes
(1) The short message center will not be changed. If the number of the short message center is changed, remember to restart TC35 when you use the "at + csca" statement, otherwise, TC35 will not work properly (tc35t does not exist ).
(2) Some SIM cards have a password. You need to enter a password when starting.

At command speed query table
I. general commands

At + cgmi
The ID of the module vendor.

At + cgmm
Obtain the module ID. This command is used to obtain the supported bandwidths (GSM900, DCS1800, or pcs1900 ). When a module has multiple frequency bands, the response may be a combination of different frequency bands.

At + cgmr
Obtain the revised software version.

At + cgsn
Obtain the IMEI serial number of the GSM module.

At + CSCs
Select te feature settings. This command reports the status setting me used by te. Me can be used to convert each input or displayed letter. This is used to send, read, or write text messages.

At + WPCs
Set the phone book status. This Special Command reports the status me used through the Te phone book. Me can then convert each input or displayed string letter. This entry is used to read or write the phone book.

At + CIMI
Obtain imsi. This command is used to read or recognize the imsi (International Mobile signatory ID) of the SIM card ). Enter a pin before reading imsi (if pin is needed ).

At + CCID
Obtain the SIM card ID. This command causes the module to read the EF-CCID file on the SIM card.

At + GCAP
Ability table. (Supported functions)

A/
Repeat the previous command. Only the/command cannot be repeated. This command repeats the previous command.

At + cpof
Shut down. This special command stops the GSM software stack and hardware layer. The command at + cfun = 0 has the same function as + cpof.

At + cfun
Set the telephone capacity. This command selects the function level of the mobile site.

At + CPAs
Returns the activity status of the mobile device.

At + cmee
Reports mobile device errors. This command determines whether to allow or not to use the result code "+ cmeerror:" or "+ cmserror:" instead of the simple "error ".

At + ckpd
Keypad control. Simulate the me keypad to execute the command.

At + cclk
Clock management. This command is used to set or obtain the current date and time of the real me clock.

At + Cala
Alarm management. This command is used to set the alert date/time in me. (Alert)

At + crmp
Play the ringtone melody. This command plays a piece of music on the buzzer of the module. There are two kinds of melody available: Arrival voice, data or fax call melody and arrival text message sound.

At + crsl
Set or get the sound level of the incoming phone ringtone.

Ii. Call Control commands

ATD
Dialing command. This command is used to set a call, data, or fax call.
 
ATH
Host Command.
 
ATA
Answer the phone.
 
At + ceer
Extended error reports. This command is used to explain why a call is interrupted when the call setting fails.
 
At + vtd
The DTMF (dual-Tone Multi-frequency) Dual-audio is sent to the user through the GSM network. This command is used to define the length of the dual audio (the default value is 300 milliseconds ).
 
At + VTS
Send DTMF dual-audio over the GSM network. This command allows the transmission of dual audio.
 
Atdl
Redial the last phone number.
 
At % DN
Automatic dialing when the data terminal is ready (DTR.
 
Ats0
Automatic response.
 
At + CICB
Call message.
 
At + CSNs
Single number scheme.
 
At + vgr

At + VGT
Gain control. This command is used to adjust the receiving gain of the Speaker and the transmission gain of the microphone.
 
At + cmut
Microphone mute control.
 
At + speaker
Speaker/microphone selection. This special command is used to select speakers and microphones.
 
At + echo
Cancel echo.
 
At + sidet
Side tone correction.
 
At + VIP
Initialize sound parameters.
 
At + DUI
Dial with additional user information.
 
At + Hui
Hook up with the attached user information.
 
At + Rui
Receive additional user information.
 
Iii. Network Service commands

At + CSQ
Signal Quality.
 
At + cops
Service Provider Selection.
 
At + CREG
Network registration. Obtain the registration status of the mobile phone.
 
At + wopn
Read Operator name.
 
At + cpol
Priority operator list.

Iv. Security commands

At + cpin
Enter the pin.
 
At + cpin2
Enter pin2.
 
At + cpinc
The remaining attempt number of the pin.
 
At + clck
Device lock.
 
At + CPWD
Change the password.

V. Phone Book commands

At + CPBS
Select phone book storage.
 
At + cpbr
Read the phone book table.
 
At + cpbf
Find the phone book table.
 
At + cpbw
Write the phone book table.
 
At + cpbp
Phone Book telephone query.
 
At + cpbn
Mobile phone book action. This special command moves the entries in the phone book forward or backward (in alphabetical order)
 
At + cnum
The signatory number.
 
At + waip
Prevent all phone books from being initialized during the next restart.
 
At + wdcp
Delete the call phone number.
 
At + csvm
Set the voice mail number.

6. Short Message commands

At + CSMs
Select message service. The supported services include GSM-mo, SMS-MT, and SMS-CB.
 
At + cnma
Confirm the response to the new message.
 
At + CPMS
Priority information storage. This command defines the storage area used to read and write information.
 
At + cmgf
Priority information format. The execution formats are text and PDU.
 
At + CSAs
Save settings. Save the + CSAs and + CSMP parameters.
 
At + CRES
Restore settings.
 
At + CSDH
Parameters for displaying text.
 
At + cnmi
New information indication. This command selects how to receive short messages from the network.
 
At + cmgr
Read text messages. Information is read from the memory set by the + CPMS command.
 
At + cmgl
Lists the stored information.
 
At + cmgs
Send information.
 
At + cmgw
Write short messages and store them.
 
At + CMSS
Sends information from the memory.
 
At + CSMP
Set text mode parameters.
 
At + cmgd
Delete short messages. Delete one or more messages.
 
At + csca
The address of the SMS service center.
 
At + CSCB
Select the Unit broadcast information type.
 
At + wcbm
Unit broadcast information identifier.
 
At + wmsc
Information Status (read or not, sent or not.
 
At + wmgo
Overwrite information.
 
At + wuss
Does not change the SMS status. Unread is maintained after execution of + cmgr or + cmgl.

VII. Add service commands

at + ccfc
call continues.
at + clck
the call is forbidden.
at + CPWD
change the append service password.
at + ccwa
call wait.
at + clir
Call Line confirmation restrictions.
at + clip
Call Line confirmation statement.
at + Colp
contact line confirmation statement.
at + caoc
fee report.
at + CACM
cumulative call metering.
at + camm
maximum cumulative call measurement value.
at + cpuc
unit price and currency table.
at + chld
call-related append service.
at + CLCC
list the current call.
at + cssn
append service notification.
at + cusd
unorganized append service data.
at + ccug
disabled user group.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.