Please tell me how to reply by SMS for a received SMS
My problem is this. I need to send SMS with data from a weighing scale to a given number when a SMS is received by the GSM modem. SMS sending part and data reading from the weighing scale part is ok but responding to SMS is not working in my program.
Can anyone tell me how to send SMS to a given number when SMS is received to the GSM modem. My program is as follows.
include "modedefs.bas"
define OSC 4
DEFINE HSER_SPBRG 25
DEFINE HSER_TXSTA 24h
DEFINE HSER_RCSTA 90h
DEFINE HSER_BAUD 9600
DEFINE HSER_CLROERR 1
comRs232Out var PORTD.0
comRs232in var PORTD.1
weightGet var word
smsGet var word
Initialize:
Start:
HIGH smsRead
HSEROUT ["AT+CMGF=1",13]
PAUSE 500
HSEROUT ["AT+CMGR=1",13]
PAUSE 500
HSERIN [smsGet]
PAUSE 500
IF smsGet = " " THEN
goto Start
ELSE
SERIN comRs232In, T2400, [weightGet]
PAUSE 500
HSEROUT ["AT+CMGS=",34,"0718116393",34,13]
PAUSE 500
HSEROUT [weightGet,26]
PAUSE 500
HSEROUT ["AT+CMGL=1,4",26]
PAUSE 15000
goto Start
ENDIF
I just need to repply to a SMS
I just need to know how to repply when a message received by the GSM Modam. It is great if i can repply only to a message from a specific number:o
Thank You Very much, But I have more probd
I have another problem in reading sms to a variable. Can u please let me know the code sequence to read sms in to a variable. (I am just a beginner to PIC programming). I know how to send AT command to read SMS but my problem is in getting Modem responces in to a variable.:confused:
Another problem in reading data in to a array
I used,
Weight Get var BYTE[20]
and use code to capture string comming via device serial port (The data I should send via SMS).
SERIN comRs232In, T2400, 5000, Start, [weightGet]
but it reads only first character of the string. I got stuck here. :eek:
I did it, Thanks - But more to know
Yes I got it using following code
SERIN2 comRs232In, 396, 1000, Start, [STR wGet\20]:o
Thanks you arrati:o
But I couldnot read message sender number and body of text correctly using
HSERIN 5000, Start,[SKIP 8,WAIT("REC UNREAD"), Skip 3, Str ArrayNum\12, Skip 25, str ArrayTxt\6]
even could not read any text of message even using
HSERIN 5000, Start,[Str ArrayNum\12]
Please help me