The serial port is used to communicate with the GSM module for data transmission (because the current notebook does not have a serial port, you can also use USB to serial port ). The GSM module uses the AT command. The At Command sends Text messages in three ways: Block, Text, and PDU. Block: Text is rarely used. It is generally used to send English (Chinese can also be sent, but some work needs to be done) PDU: used to send Chinese, which is generally used in China. (Most mobile phones Support) PDU used by the Project
The serial port is used to communicate with the GSM module for data transmission (because the current notebook does not have a serial port, you can also use USB to serial port ).
The GSM module uses the AT command.
The At Command sends Text messages in three ways: Block, Text, and PDU.
Block: rarely used
Text: generally used for sending English letters (Chinese characters can also be sent, but some work is required)
PDU: used to send Chinese characters. This mode is generally used in China. (Supported by most mobile phones)
The project uses the PDU mode to send text messages.
PDU format:
Step 1: AT + CMGF = 0/r
Step 2: AT + CMGS = number of bytes of the sent content
Step 3: Send content
For example, if you want to send a text message "hello" to a person whose mobile phone number is 15853288251
0011000D91685158238852F1000800044F60597D
Because it is in China, 0011000D91 is fixed.
685158238852F1 is the mobile phone number 15853288251.
00 08 00 is the set of the sending flag based on your own situation
04 indicates the number of bytes to be sent.
The content sent by 4F60597D is 'hao'
Note that after completing step 2, you need to wait for a while before proceeding to step 3. Otherwise, the message may fail. Waiting for a while is a preparation time for the serial port.
Pay attention to the operating system platform.
There is a difference between Windows and Liunx. When encoding the sent content, note that the memory storage methods of these two systems are different.
Windows: high to high, low to low
Liunx is the opposite. Otherwise, garbled content will be sent.