The Global Positioning System (GPS) system is widely used in civil application due to excellent performance. It can be used in air traffic management, earth-specific measurement, photogrammetry, monitoring crustal, volcanic activities, field surveys, and exploration positioning, land settlement, land landslides, and for civil as buildings, cars, travel adventures, Hunting, etc. aspect. But how to pass the GPS positioning data to the monitoring center has always been the focus of the corresponding system. At present, the mobile subsystem and monitoring center subsystem tend to transmit data through a short message manner. In this way, the transmission of short messages can be implemented in this manner, which is simple to achieve, high communication cost, high frequency, large system capacity, high service type, good confidentiality, strong anti-interference ability High quality, international automatic roaming, etc. It is currently the most widely used communication solution. Currently, in related systems often use mobile modules (Motorola, Siemens, etc.) to achieve contact with the short message center. The main reason is that the use of mobile modules is beneficial to system integration, low cost, and use mobile phones can also achieve corresponding functions, but require external data cable, cost is quite high. This article mainly introduces the GSM AT command related to short message development.
1. Related GSM AT instructions related to SMS (from GSM07.05) as shown in Table 1: Table 1 related GSM AT instruction
AT command function
AT CMGC Send An SMS Command (issued a short message command)
AT CMGD DELETE SMS Message (Delete SM card memory short message)
AT CMGF SELECT SMS Message Formate: 0-PDU; 1-Text)
AT CMGL List SMS Message from Preferred Store (List short message PDU / text: 0 / "REC Unread" in the SIM card - unread, 1 / "limited" - read, 2 / "STO unsent" - stay Send, 3 / "STO SENT" - has been sent, 4 / "all" - all)
AT CMGR Read SMS Message (read short message)
AT CMGS Send SMS Message (Send Short Message)
AT CMGW Write SMS Message To Memory (write to the short message to be sent) in SIM memory)
AT CMSS Send SMS Message from Storage (send short messages from SIN | M memory)
AT CNMI NEW SMS Message INDICATIONS (Show new short message)
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 Services) A total of three modes: Block Mode
PDU Mode based on AT command
TEXT MODE based on AT command
Using the Block mode requires mobile manufacturer to provide driver support. At present, PDU Mode has replaced Block Mode, and Text Mode is relatively simple. This article focuses on mode PDU Mode, taking Siemens' product TC35t as an example. 2. Communication (1) RS232 serial port connection due to TC35T with RS232 serial port due to the TC35T, which is only necessary to connect it to the computer serial port. Open the hyper terminal, select the corresponding serial port, set the port parameters to: rate -4800, parity bit - no, data bit-8, stop bit -1, traffic control - hardware. (2) Connection test input "AT" and then enter the return, the "OK" on the screen indicates that the computer and TC35T have been successfully connected, and TC35T can work normally. At this time, you can test all kinds of AT commands. When the test command "AT CMGS =?
AT cmgs =
AT cmgs =
3. PDU data format analysis: For example, we have to send characters "hi" characters to destination "13677328099" PDU string is: 08 91 683108701305F0 11 00 0D 91 3176378290F9 00 00 00 02 C834 (1) 08-Short message center address length. Refers to the length of (91) (683108701305F0). (2 )91- Short message center number type. 91 is Ton / NPI complies with the International / E.164 standard, refers to the number of ' ' before the number; there are other values, but 91 is most common. 91-10010001 Bit No. 7 6 5 4 3 2 1 0 Name 1 Numeric Type Number Differential Numeric Types: 000- Unknown, 001- International, 010 - Domestic, 111 - Reselection of the Extension; Numbering PLAN IDENTIFICATION): 0000- Unknown, 0001-ISDN / Phone Number (E.164 / E.163), 1111 - Reserved Level Expansion; CD683108701305F0- Short Message Central Number. The actual number should be: 8613800731500 (letter F means length 1). This requires corresponding modifications according to different geographies. (1), (2), (3) Generally known as the short message center address (Address of the SMSC). ⑷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 0 0 0 1
Answering Path - TP-RP (TP-Reply-Path): 0- Not set; 1 - Set User Data Skand Identifies - TP-UDHL (TP-User-Data-Header-Indicator): 0 - Does not include any header information; 1- Head information status report Requires -tp-SPR (TP-STATUS-REPORT-REQUEST): 0- Need report; 1- does not need to report validity formats -TP-VPF (TP-Validity-Period-Format): 00- Not provided; 10-integer (standard); 01-reserved; 11- SEMI-OCTET REPRESENTED Refuse to replicate -TP-RD (TP-REET-DUPLICATES): 0 - Accept replication; 1-Refuse to copy information Type prompt - TP-MTI (TP-Message-Type-Indicator): 00-Read (Deliver); 01-Submit (Submit) ⑸00-Information type (TP-Message-Reference) ⑹0B-called number length. ⑺91- The called number type (same (2)). ⑻3176378290f9-called number, after displacement processing, the actual number is "13677328099". ⑹, ⑺, ⑻⑻ ⑻称 目 地址 地址 地址 (TP-Destination-Address). ⑼00-protocol identifies TP-PID (TP-Protocol-Identifier) Bit No. 7 6 5 4 3 2 1 0 Bit No. 7 and Bit No. 6: 00 - Assign Bit No.0-bit No. 5; 01- See the GSM03.40 protocol identification is completely defined; 10- Reserved; 11- Assign bit No.0-bit No. 5 for the Service Center (SC) special purpose. These two positions are usually 00. Bit No.5: 0- Do not use the remote network, just the protocol between short message devices; 1-Using the remote network. Bit No.0-Bits No.4: 00000- implied; 00001-electrical; 00010-Group 3 TELEFAX; 00100-speech; 00101-European wireless information system (ERMES); 00110-domestic system; 10001- .400 public information processing system; 10010-email.
⑽00-Data Coding Scheme TP-DCS (TP-DATA-CODING-Scheme) Bit No. 7 6 5 4 3 2 1 0 bit No.7 and Bit No.6: General Set to 00; Bit No. 5: 0- Text is not compressed, 1-text compresses with GSM standard compression algorithm; Bit No. 4: 0- Represents Bit No.1, Bit No.0 is reserved, free of information type information, 1-Represents Bit No.1, Bit NO.0 contains 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 0,01-Class 1, 10-Class 2 (SIM Card Specification), 11-Class 3. ⑾00-Validity TP-VP (TP-Valid-Period) VP Value (& H) corresponding 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