AT+CMGS returns ERROR

烈酒焚心 提交于 2019-11-30 11:36:52

Command AT+CSCS? will answer You what type of sms-encoding is used. Properly answer is "GSM", and if not, You should set it by command AT+CSCS="GSM".

And remember about "Ctrl+Z" (not "Enter") as a finish of sms text, please.

You aren't passing all the parameters to the command.

The command format is:

AT+CMGS=<number><CR><message><CTRL-Z>

Where:

<CR> = ASCII character 13
<CTRL-Z> = ASCII character 26

You have passed only the number and without the <CR> you won't see the > note for the message.

Example:

AT+CMGS="+9893XXXXXX"
> This is the message.→

The response is:

+CMGS:<mr>
OK

Where <mr> is the message reference.

If AT+CSCS? command returns UCS2, then many arguments need to be encoded as hex string of UTF-16 encoding, so the phone number would become "002B0039003800390033...", and the SMS text would need to be encoded in the same way. If you don't need UCS2 encoding, then the easiest thing to do is to switch to GSM encoding (or another encoding from the available set as shown by AT+CSCS=? command)

Sometimes the issue is the text mode you are in. Enter AT+CMGF? and you should receive +CMGF: 1. If instead you receive +CMGF: 0, enter AT+CMGF=1. This changes the message format from PDU mode to Text mode. I'm not sure what either of those mean exactly, but this fixed my issue.

SIM 800 AT command manual

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!