May 13, 2024

Sim900a Chinese and English SMS sending steps

Common at instruction set

First: AT+CNMI, used to set a new message indication. Send: AT+CNMI=2,1, set a new message prompt. When a new message is received and the SIM card is not full, the SIM900A module will return data to the serial port, such as: +CMTI: “SM”, 2, indicating When a new message is received, it is stored in location 2 of the SIM card.

Second: AT+CMGF is used to set the short message mode. SIM900A supports two modes: PDU mode and text (TEXT) mode. Send: AT+CMGF=1, it can be set to text mode.

Third: AT+CSCS, used to set the TE character set. The default is the GSM 7-bit default character set. When sending a plain English short message, send: AT+CSCS=“GSM”, set to the default character set. can. When sending Chinese and English text messages, you need to send: AT+CSCS=“UCS2”, set to 16-bit universal 8-byte multiple coded character set.

Fourth: AT+CSMP is used to set the short message text mode parameter. When using the UCS2 mode to send Chinese text messages, you need to send: AT+CSMP=17,167,2,25, set the text mode parameters. AT+CMGR, used to read SMS messages, such as sending: AT+CMGR=1, you can read the SMS stored in the location 1 of the SIM card.

Fifth: AT+CMGS, used to send SMS messages. Under the “GSM” character set, it can send up to 180 bytes of English characters. Under the “UCS2” character set, it can send up to 70 Chinese characters (including characters/numbers). ). This instruction is described in detail later.

Sixth: AT+CPMS, used to query/set the preferred message memory, by sending: AT+CPMS? You can query how many SMS storages the current SIM card supports and how many SMS messages are currently stored. Such as return: +CPMS:

Sending Chinese and English text messages

We will use the ATK-SIM900A module to send a Chinese and English text message to the specified mobile number. Similarly, we use the AT+CMGS command to send Chinese and English text messages. Or send in text mode, the sending steps are as follows:

First, send: AT+CMGF=1, set to text mode. Then, send: AT + CSMP = 17, 167, 2, 25, set the text mode parameters. Finally send: AT+CSCS=“UCS2”, set to UCS2 coded character set.

At this point, we can send the AT+CMGS command to send Chinese and English text messages, but since the UCS2 character set is used, all characters/numbers/Chinese characters must use UNICODE encoding. Suppose we want to send a Chinese and English text message to the mobile phone number, the content is "ATK-SIM900A Chinese and English SMS sending test". We must first use: Chinese character UNICODE interchange tool .exe,

Sim900a Chinese and English SMS sending steps

This software converts the number and the sent content into a UNICODE string (you need to manually remove the space) to get the converted UNICODE string (after removing the space).

ATK-SIM900A Chinese and English SMS sending test, the converted UNICODE string is B002D00530049004D00390030003000414E2D82F1658777ED4FE153D190016D4B8BD5

Then, send: AT+CMGS=“00310038003100370035003600380034003700390039”, this command, then the module returns: 》, at this point we enter what we need to send: 00410054004B002D00530049004D00390030003000414E2D82F1658777ED4FE153D190016D4B8BD5.

Note that this can be done without sending a carriage return. After sending the content, it will be sent separately in hexadecimal (HEX) format (without adding a carriage return): 1A (ie 0X1A), start a text message transmission, as shown in Figure 2.3.4.4.1:

Sim900a Chinese and English SMS sending steps

Wait until the module is sent, return: +CMGS: 158, indicating that the SMS has been successfully sent. At this point, we can see the Chinese and English text messages sent by the module on the target mobile phone (13922348612).

Sending English text messages

We will use the ATK-SIM900A module to send an English text message to the specified mobile number. Here, we use the AT+CMGS command to send text messages. When sending all English/digital text messages, we first set it to: "GSM" character set (AT+CSCS=“GSM”), text mode (AT+CMGF=1) ).

Suppose we want to give the mobile phone number: 13922348612, send a text message, then send: AT+CMGS=“13922348612”, then the module returns: “, then we input the content we need to send: ATK-SIM900A MSG SEND TEST, note that this You don't have to send a carriage return. After sending the content, it will be sent separately in hexadecimal (HEX) format (not

With the addition of carriage return: 1A (ie 0X1A) 1 , you can start a text message transmission. Note 1: 0X1A, the key value of “CTRL+Z”, is used to tell SIM900A to perform the send operation. In addition, you can also send: 0X1B, the key value of “ESC”, used to tell SIM900A to cancel this operation and not to send.

Wait a moment, after the SMS is successfully sent, the module returns a confirmation message such as: +CMGS: 156, indicating that the short message is successfully sent, of which 156 is the internal SMS counter of the module, and generally ignores it. As shown in Figure 2.3.4.2.1:

Sim900a Chinese and English SMS sending steps

As can be seen from the above figure, at the end of the short message transmission, we input 1A in hexadecimal. After sending this data to the SIM900A module, we start the SMS transmission. After the transmission is successful, the module returns: +CMGS: 156 , indicating that the SMS was sent successfully.

Disposable Vape 8000 Puffs

KENNEDE ELECTRONICS MFG CO.,LTD. , https://www.axavape.com