Hawkins
Hawkins

Reputation: 21

AT+CMGS doesn't work correctly

I have a problem with AT command for sending SMS - AT+CMGS. After sending AT+CMGS=<length of PDU datagram><CR> I wait for response of modem. After reading <CR><LF>><Space> I send <PDU datagram><CTRL-Z> but I don't get any answer from modem. If I send any command after that the response to that command is +CMGS=<reference number> which is exactly the response which I expected later.

But if I wait for about 100ms after reading <CR><LF>><Space> and than send PDU datagram than everything works well and I receive expected answer from modem.

It is really necessary to wait after receiving response from modem? I thought that I can send response immediately after reading <CR><LF>><Space>. Can someone help me to understand where could be a problem?

Thanks a lot

Upvotes: 2

Views: 1178

Answers (1)

hlovdal
hlovdal

Reputation: 28180

You are correct in your assumption, 27.005 states for AT+CMGS:

the TA shall send a four character sequence <CR><LF><greater_than><space> (IRA 13, 10, 62, 32) after command line is terminated with <CR>; after that text can be entered from TE to ME/TA.

(TA (terminal adapter) is modem, TE (terminal equipment) is sender of AT commands)

However, in practice some additional small delay might be needed even in cases where the modem have signalled that it is ready to receive.

Upvotes: 1

Related Questions