This tutorial will explain How to receive and read SMS messages via AT commands on a GSM modem or a mobile phone.
Open Microsoft Hyperterminal or Minicom (Linux) after connecting your phone / GSM modem to the PC.
Type this to check if your GSM modem supports the SMS text mode.
AT+CMGF=1 [ENTER]
It should return OK if it does.
Next, type
AT+CPMS=? [ENTER]
This will display the message storage modes your GSM modem / mobile phone supports.
These are the types of message storage modes
SM – SIM Card
ME – Phone Storage
MT – SIM Card + Phone Storage
BM – Broadcast Messages
SR – Status Reports
Next, select the message storage mode.
AT+CPMS=”MT” [ENTER]
This will read the messages from the SIM as well as device memory.
Now you can list the messages in the selected storage.
Type
AT+CMGL=”ALL” [ENTER] to display all the messages.
AT+CMGL=”REC_READ” [ENTER] to display the read messages.
AT+CMGL=”REC_UNREAD” [ENTER] to display the unread messages.
The messages will be listed in this format -
+CMGL: “index”,”status”,”mobile_number”,,”date,time”
text message content
You can also read the message index to read the SMS.
AT+CMGR=5 [ENTER] will read the 5th SMS.
To delete the 5th message, type
AT+CMGD=5 [ENTER]

Recent Comments