Please tell me how to reply by SMS for a received SMS


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    May 2009
    Posts
    13

    Unhappy 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

  2. #2
    Join Date
    May 2008
    Location
    Italy
    Posts
    825

    Default

    but responding to SMS is not working in my program.
    This is quite simple providing that your modem is capable to hand text format (if you have only PDU format then you need to convert text to PDU first)

    Code:
    AT+CMGS=+39xxxxxxxxxxxx,13
    where +39 = international prefix for Italy (you will change as needed)
    xxxxxxxxxxxx = phone number you will send the sms.

    Immediatly after having sent this AT command you go listening the modem :

    answer should be: ">"

    When you receive this character then you sent your text (max 160 chars) terminating with 26

    HSEROUT ["This is my test",26] and you have sent your message.

    If you don't receive ">" within 5 seconds you must abort the command sending: HSEROUT [27] and repeat the command.

    Hope it will help you.

    Al.
    All progress began with an idea

  3. #3
    Join Date
    May 2009
    Posts
    13

    Thumbs up thanks

    Thank You im now testing it

    Quote Originally Posted by aratti View Post
    This is quite simple providing that your modem is capable to hand text format (if you have only PDU format then you need to convert text to PDU first)

    Code:
    AT+CMGS=+39xxxxxxxxxxxx,13
    where +39 = international prefix for Italy (you will change as needed)
    xxxxxxxxxxxx = phone number you will send the sms.

    Immediatly after having sent this AT command you go listening the modem :

    answer should be: ">"

    When you receive this character then you sent your text (max 160 chars) terminating with 26

    HSEROUT ["This is my test",26] and you have sent your message.

    If you don't receive ">" within 5 seconds you must abort the command sending: HSEROUT [27] and repeat the command.

    Hope it will help you.

    Al.

  4. #4
    Join Date
    May 2009
    Posts
    13

    Unhappy 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

  5. #5
    Join Date
    May 2008
    Location
    Italy
    Posts
    825

    Default

    If you want to answer to a received sms, then decode the message and grab the number of the sender, use it to reply with the same method as per previuos post.

    Al.
    All progress began with an idea

  6. #6
    Join Date
    May 2009
    Posts
    13

    Exclamation 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.

Similar Threads

  1. Problem with SMS IO Controller
    By dario.costa in forum GSM
    Replies: 4
    Last Post: - 30th November 2009, 07:04
  2. Replies: 288
    Last Post: - 25th August 2008, 16:53
  3. Reading a SMS to an array
    By KA5MAL in forum GSM
    Replies: 3
    Last Post: - 17th June 2008, 17:24
  4. Rs485 Using Hserin/hserout
    By koossa in forum mel PIC BASIC Pro
    Replies: 27
    Last Post: - 31st January 2008, 09:42

Members who have read this thread : 1

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts