Friday, January 17, 2014

How to Send Receive SMS Using a GSM Modem


Send SMS
1. Type 'AT+CMGF=1' and press Enter to put your modem in the mode to send and receive text messages.
2. Type 'AT+CMGS='+12345678'' and press Enter. '+12345678' is the phone number of the recipient in this example.
3. Type the text of the message you'd like to send, and press Ctrl and Z keys. The modem will return '+CMGS: 62', indicating that the message was sent.
Receive SMS
4. Type 'AT+CMGF=1' and press Enter to put your modem in the mode to send and receive text messages.
5. Type 'AT+CMGL='ALL''. This command lists the received messages. For instance:+CMGL: 1,'REC UNREAD','+12345678',,'09/09/10,09:55:16+08'Text of message 1+CMGL: 2,'REC UNREAD','+12345678',,'09/09/10,09:56:03+08'Text of message 2OK'+12345678' is the phone number from which the message was sent. 'REC UNREAD' indicates that the message is currently unread. The date and time shows when the message was delivered to the modem by the mobile operator.
6. Delete the messages by typing 'AT+CMGD=1' and 'AT+CMGD=1'. Numbers 1 and 2 are the indeces of the messages as presented by the CMGL command in the previous step.

No comments:

Post a Comment