Sie sind auf Seite 1von 6

Tutorial: How to Send and Receive SMS using GSM Modem Introduction It is very easy to incorporate SMS capability

to any PC or Embedded Controller using Serial Port and any of your favourite programing language (C,C#,Basic,Pascal) Enfora !SM Modem provide a standard "PI set for communicating #it$ Modem and setup for send and receive SMS %o understand and try out t$e varioius "% Command to send and receive SMS so t$at you can incorporate t$ese into your o#n soft#are pro&ect you #ill need a serial port ('I()P $as built in $yperterminal or else for vista you can do#nload t$ird party serial terminal program from #eb) PC t$at does not $ave any serial Commport can buy standard off t$e s$elves *SB to serial converter from any computer perip$eral s$ops (suc$ as "%E( *C+,-,") Equipment Needed " PC #it$ serial comm Port (or a *SB to Serial "daptor) " Serial %erminal Program (in t$is case, #e $ad c$osen to use t$e free .ypterminal t$at is present on 'I(/01'I()P) Setting Up Hypterminal 2) 3un Start +4 "ll Program +4 "ccessories +4 Communication +4 .ypterminal ,) In a dialog Bo0, it as5 for a connection name 6ust type a description (for e0ample %2278) Select a Comport #$ere t$e C9M0 is t$e communication port t$at t$e Enfora !SM Modem is p$yscically conneted to Clic5 98

! (e0t in t$e configure button, clic5 on it to set up t$e comport property Set up t$e C9Mport for 227 ,8bps, : ;atabit, (o Parity, 2 stop bit and (on <lo# Control (or .ard#are <lo# Control) "pply and Save Pls note t$at if you install a *SB to serial ComPort "daptor, typically t$e C9MP93% #ill be in a different C9M0 (umber Ma5e sure t$at you select t$e correct C9M0 (umber, and also ensure t$e *SB to Serial Port "aptor is al#ays connected to t$e same comport t$at you installed t$e driver initially

"! (o# clic5 on t$e icon to connect t$e ComPort by using t$e Connect

7) (o# folllo#ing t$e follo#ing steps by typing on t$e .ypterminal


2) %ype #T and press $ENTER% t$e modem s$ould respond #it$ &' %$is #ill verify t$at you are communicating #it$ t$e modem If you cannot see c$aracters entered on t$e screen, enter #TE()( ,) %$e follo#ing e0amples provide t$e "% commands and responses for setting modem parameters <or more information about t$e commands and response codes, see t$e GSM0107AT001 Enfora Enabler IIG AT Command Set -) Please refer to #pplication Note GSM****#N**+ , Ena-ler,G #utomated Networ. /onnection /on0iguration and Use, to set t$e appropriate net#or5 connection =) %o be able to send SMS te0t messages, t$e Enfora Enabler+! module must be initiali>ed #it$ t$e proper SMS mode %$e follo#ing e0amples provide t$e "% commands and responses for initiali>ing t$e SMS mode 7) %$e follo#ing command initiali>es t$e Enfora Enabler+! module by setting t$e te0t mode parameters #T1/SM23(45(645*5* Set te0t mode parameters? "%@CSMPABfo4,Bvp4,Bpid4,Bdcs4

$0o%3(4 Sets reply pat, user data $eader, status report reCuest, validity period format, re&ect duplicates and message type $vp%3(64 Sets validity period $pid%3* .ig$er layer protocol indicator $dcs%3* Information encode format &' Modem 3esponse D) "fter initiali>ing t$e module #it$ t$e proper SMS mode, Cuery t$e module for t$e correct service center %$e service center is reCuired fro proper routing of an SMS t$roug$ t$e net#or5 %$e service center is programmed into t$e SIM by t$e net#or5 service provider %$e follo#ing command Cueries t$e service center #T1/S/#7 Euery service center 1/S/#: 81(9*6 ( ***"8 Modem 3esponse (FoiceStream G *S") H) If no service center is entered, t$en contact your service provider for correct service center %o enter t$e correct service center, enter t$e follo#ing command? #T1/S/#381(9*6 ( ***"8 Sets t$e service center (FoiceStream G *S") &' Modem 3esponse :) %$e follo#ing command selects %E)% mode for SMS messages #T1/MG:3( Set message format to %E)% mode &' Modem 3esponse /) %$e follo#ing command sets t$e indicators for receiving an SMS message #T1/NMI3(5(5*5*5* Set t$e ne# message indicators "%@C(MIABmode4,Bmt4,Bbm4,Bds4,Bbfr4 $mode%3( discard unsolicited result codes indication #$en %" G %E lin5 is reserved $mt%3( SMS+;EIIFE3s are delivered to t$e SIM and routed using unsolicited code $-m%3* no CBM indications are routed to t$e %E $ds%3* no SMS+S%"%*S+3EP93%s are routed $-0r%3* %" buffer of unsolicited result codes defined #it$in t$is command is flus$ed to t$e %E &' Modem 3esponse

2J) %$e follo#ing command saves t$e SMS settings 9nce t$e SMS commands $ave been saved, t$e initiali>ation commands do not need to be sent again until t$ey are c$anged #T1/S#S Save SMS settings %$is may ta5e up to 2J seconds &' Modem 3esponse 22) <or more advanced SMS options, see t$e GSM0107AT001 Enfora Enabler IIG AT Command Set for t$e follo#ing "% commands? #T1/S/S C$aracter set #T1/SMS Select message service #T1/2MS Preferred storage #T1/S;H S$o# te0t mode parameters 2,) "fter t$e Enfora Enabler+! module $as been initiali>ed, t$e follo#ing commands demonstrate t$e transmission of an SMS message to a !SM mobile number #T1/MGS38(9*(4+4964 8 Send a message to t$e telep$one number % 3eady to enter a message
T<is is a test message=> Enter

t$e te0t message End t$e message #it$ Control K

1/MGS: ( Successful transmission %$e number #ill increment #it$ eac$ SMS sent &' Modem 3esponse 2-) <or an incoming SMS #it$ t$e above initiali>ation settings, t$e follo#ing indication #ill be displayed over t$e serial port? 1/MTI: 8SM85( Incoming message indication stored in message location 2 GSM0000AN004 Page 3 2=) %o read t$e above message, enter t$e follo#ing? #T1/MGR3( 3ead SMS message in SIM location 2 1/MGR: (58RE/ RE#;858(9("+++(9(98558*9?*@?*(5(":9":"(1*@85 ("+5"5*5*58(9*6 ( ***"85("+5+
T<is is a test message

&' Modem response See GSM0107AT001 Enfora Enabler IIG AT Command Set for parameter details 27) %o store an SMS message on t$e SIM for later retrieval, enter t$e follo#ing? #T1/MGA38(9*(4+4964 8 Store a message on t$e SIM

% 3eady to enter a message


T<is is a stored message=> Enter

t$e te0t message End t$e message #it$ Control K

1/MGA: 9 Successfully stored in memory location , &' Modem 3esponse 2D) %o send a message previously stored on t$e SIM, enter t$e follo#ing? #T1/MSS39 Send message from memory location , 1/MSS:9 Successful transmission %$e number #ill increment #it$ eac$ SMS sent &' Modem 3esponse 2H) %o list all of t$e messages stored on t$e SIM, enter t$e follo#ing? #T1/MGB38#BB8 Iist messages on t$e SIM 1/MGB: (58RE/ UNRE#;858(9("+++(9(98558*9?*@?*(5(":9":"(1*@85("+5+ T<is is a test message 1/MGB: 958ST& SENT858(4(C9 966*98555(9C599 T<is is a stored message &' Modem response See Enfora Enabler IIG AT Command Set for parameter details 2:) %$e follo#ing command deletes a message from t$e SIM location specified #T1/MG;3( ;elete SMS message in SIM location 2 &' Modem response upon successful delete

Das könnte Ihnen auch gefallen