Shop OBEX P1 Docs P2 Docs Learn Events
Use Basic stamp 2p + GSM/GPRS + AT Command + send SMS — Parallax Forums

Use Basic stamp 2p + GSM/GPRS + AT Command + send SMS

theparak_protheparak_pro Posts: 4
edited 2010-05-19 15:58 in BASIC Stamp
Use Basic stamp 2p + GSM/GPRS + AT Command + send SMS
Hi!··i tryed this program but it not work!! need help thank you.

' {$STAMP BS2p}
' {$PBASIC 2.5}

Baud CON 240 'basic stamp2p

DEBUG "Preparing Flow control status",CR
SEROUT 0,baud,[noparse][[/noparse]"AT+IFC=1,1", 13, 10]
PAUSE 1000

DEBUG "Preparing to send SMS message...",CR
SEROUT 0,baud,[noparse][[/noparse]"AT", 13, 10]
PAUSE 1000

DEBUG "Use TEXT Mode",CR
SEROUT 0,baud,[noparse][[/noparse]"AT+CMGF=1", 13, 10]
PAUSE 500

DEBUG "Prepare the recipent Phone",CR
SEROUT 0,baud,[noparse][[/noparse]"AT+CMGS=", 34, "+66807800869;", 34, 13, 10]
PAUSE 500

DEBUG "The message sent out",CR
SEROUT 0,baud,[noparse][[/noparse]"Test-message", 13, 10]
PAUSE 500
·

Comments

  • theparak_protheparak_pro Posts: 4
    edited 2010-05-10 08:26
    this is my circuit·
    587 x 282 - 57K
    p1.jpg 56.6K
  • stamptrolstamptrol Posts: 1,731
    edited 2010-05-10 12:34
    If your GSM device is expecting "real" serial signals from the Stamp, you may have to use the inverted mode, 16624 instead of 240.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • theparak_protheparak_pro Posts: 4
    edited 2010-05-10 15:28
    Oh!!!thank you ---->TOM· i will try it today.
  • Miguel AngelMiguel Angel Posts: 15
    edited 2010-05-17 20:07
    HI
    was the correct solution that did say stamptrol member??
  • theparak_protheparak_pro Posts: 4
    edited 2010-05-18 18:08
    i tryed this program but it not work at all!!! i think i missed something important......


    ' {$STAMP BS2p}
    ' {$PBASIC 2.5}

    Baud CON 16624 'basic stamp2p

    DEBUG "Preparing Flow control status",CR
    SEROUT 0,baud,[noparse][[/noparse]"AT+IFC=1,1",$0D]
    SERIN 1,Baud,3000,No_Response,[noparse][[/noparse]WAIT("OK")]
    PAUSE 1000

    DEBUG "Preparing to send SMS message...",CR
    SEROUT 0,baud,[noparse][[/noparse]"AT",$0D]
    PAUSE 1000

    DEBUG "Use TEXT Mode",CR
    SEROUT 0,baud,[noparse][[/noparse]"AT+CMGF=1",$0D]
    PAUSE 500

    DEBUG "Prepare the recipent Phone",CR
    SEROUT 0,baud,[noparse][[/noparse]"AT+CMGS=", 34, "+66807800869;", 34,$0D]
    PAUSE 500

    DEBUG "The message sent out",CR
    SEROUT 0,baud,[noparse][[/noparse]"Test-message",$0D]
    PAUSE 500

    No_Response:
    DEBUG "No response: GM862", CR
    GOTO Hang_up

    Hang_up:
    PAUSE 500
    DEBUG "Hanging up phone...", CR
    SEROUT 0,Baud, [noparse][[/noparse]"ATH", CR]
    SERIN 1,Baud, 3000, Hang_up, [noparse][[/noparse]WAIT("OK")]
  • stamptrolstamptrol Posts: 1,731
    edited 2010-05-18 19:46
    You'll have to give more detail!

    After "Preparing Flow control status" shows on the screen, what happens?

    Put a DEBUG after the SERIN statements to show any data that came back.

    You have to carry out smaller tests to prove that you are successfully talking to the device.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • TumblerTumbler Posts: 323
    edited 2010-05-19 15:58
    Take a look at this [noparse]:http:[/noparse]//forums.parallax.com/forums/default.aspx?f=5&m=410935&g=411233#m411233

    You have to create some phonebook entries first, before you can send a sms.
Sign In or Register to comment.