This text message problem has been entangled in the author for almost two months, and some strange problems have arisen. Here I will summarize and explain some points of special attention when using this module, we hope that our friends who sent text messages using this module can get reference and improve the development progress.
1. Unlike mc8331a, mc8630 sends text messages in interactive mode. What does it mean?
Mc8331a is a direct at command. In the past, it included the number, content, and length of the text message, but 8630 was not like this. It is like this:
At ^ hcmgs = "15868152889" CR // Cr is press enter> //> NO. Is the hello // returned by the module. This is the data you want to send.
0x1a // Terminator
^ Hcmgs: 1 // The following is the OK ^ hcmgss returned by the module: 1
It is interactive. First, enter the number to be sent, then wait for the module to respond: ">", and then enter the data to be sent to complete the text message sending.
2. the first problem is not difficult, but the most tangled issue is the Terminator. People who have read the manual know that if an english user wants to send the terminator 0x1a, for Chinese characters, 0xaa 0x1a must be sent.
Do you think this is easy? Yes, I thought it was very simple at first, so the value for constructing the last character of the AT command is:
CMD [end] = 0x1a
Let's get it done. It's been a long time.ProgramIt has been blocked in this place. After checking, the problem cannot be found. Why? In fact, it means:
CMD [end] = "\ x1a"
Pay special attention to this. It is estimated that most people are dead in this place!
3. At command "\ r"
You may have encountered this error. Maybe you didn't, but you must add "\ r" to the AT command to send the command. If it is not found on the PDF file, it is not specified. Therefore, the AT command must have a carriage return character, to ensure that the command starts with the header. For example:
Atcmdsend ("at \ r ");
This is a small detail, but if programming is dizzy, you may not pay attention to it, and it will be puzzling.