My goal now is to be able to send sms using a gsm modem through serial port.
The following hardware setup has been used:
Debian sarge kernel 2.6
WaveCom M1306B GSM/GPRS-Modem Fastrack Modem
Using minicom, you can try the following to test the modem
AT
OK
AT+CMGF=1
OK
AT+CMGW="+639221234567"
> A simple demo of SMS text messaging.
> CTRL-Z
+CMGW: 1
OK
AT+CMSS=1
+CMSS: 20
OK
Line by line explanation:
Line 1: "AT" is sent to the GSM / GPRS modem to test the connection. The GSM / GPRS modem sends back the result code "OK" (line 2), which means the connection between the HyperTerminal program and the GSM / GPRS modem works fine.
Line 3: The AT command +CMGF is used to instruct the GSM / GPRS modem to operate in SMS text mode. The result code "OK" is returned (line 4), which indicates the command line "AT+CMGF=1" has been executed successfully. If the result code "ERROR" is returned, it is likely that the GSM / GPRS modem does not support the SMS text mode. To confirm, type "AT+CMGF=?" in the HyperTerminal program. If the response is "+CMGF: (0,1)" (0=PDU mode and 1=text mode), then SMS text mode is supported. If the response is "+CMGF: (0)", then SMS text mode is not supported.
Line 5 and 6: The AT command +CMGW is used to write an SMS text message to the message storage of the GSM / GPRS modem. "+639221234567" is the recipient mobile phone number. After typing the recipient mobile phone number, you should press the Enter button of the keyboard. The GSM / GPRS modem will then return a prompt "> " and you can start typing the SMS text message "A simple demo of SMS text messaging.". When finished, press Ctrl+z of the keyboard.
Line 7: "+CMGW: 1" tells us that the index assigned to the SMS text message is 1. It indicates the location of the SMS text message in the message storage.
Line 9: The result code "OK" indicates the execution of the AT command +CMGW is successful.
Line 10: The AT command +CMSS is used to send the SMS text message from the message storage of the GSM / GPRS modem. "1" is the index of the SMS text message obtained from line 7.
Line 11: "+CMSS: 20" tells us that the reference number assigned to the SMS text message is 20.
Line 13: The result code "OK" indicates the execution of the AT command +CMSS is successful
Got this from:
http://www.developershome.com/sms/howToSendSMSFromPC.asp
2 comments:
Hi,
Was very interested by this post. My question if you can send, then how do you receive an SMS?
Try to search in google hayes AT commands and you will find the Command you need to send to the modem/gsm phone that would return you if you have any new incoming sms
Post a Comment