Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

AT commands through matlab to my mobile

Status
Not open for further replies.

Rufiorocks

Newbie level 5
Joined
May 17, 2010
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,331
its working fine with the hyper-terminal.i can send msg and get "ok" command when i type "at" at hyper terminal.

but in matlab:-

s = serial('COM12');
set(s,'BaudRate',9600);
fopen(s);
tx='AT';
fprintf(s,'%s',tx);
out = fscanf(s)
fclose(s)

as suggested by one of the members in previous posts i tried the above code
it is not working
either i get 'out= AT'
or ' out = " ' (i.e. Warning: A timeout occurred before the Terminator was reached. )

what should i do plz guide me

i also tried with tx='AT\n' even this doesnot work
 

Try this then we will see:

s = serial('COM3');
set(s,'BaudRate',9600);
fopen(s);
tx='AT+CMGS="xxxxxxxxx"';
// where xxxxxxxx mobile number and AT+CMGS protocol to send sms by mobile
fprintf(s,'%s',tx);
a = 'ss';
fprintf(s,'%s',a);
fclose(s)
delete(s)
clear s
 

i tried what u gave me to try....
also i tried to follow the same steps as i did in hyperterminal

s = serial('COM16');
fopen(s);
set(s,'BaudRate',9600);
tx='AT+CMGS="xxxxxxxxx"';%mobile nunmber
tz='AT+CMGF=?';% wanted to do exactly as i did in hyper terminal
tq='AT+CMGF=1';% so took followed these steps
a='ss';
fprintf(s,'%s',tz);
fprintf(s,'%s',tq);
fprintf(s,'%s',tx);
fprintf(s,'%s',a);
fclose(s);
delete(s);
clear s;

but neither matlab is showing any error nor any msg is being sent...no reaction
i tried to use fscanf(s,'%s') and fscanf(s) but its giving a warning as "Warning: A timeout occurred before the Terminator was reached."
 

does anyone know a different method...

---------- Post added at 17:09 ---------- Previous post was at 17:02 ----------

@tpetar just for the thought .. when we use a hyper terminal we press ctrl+z at the end...but while programming the port from matlab we dont send ctrl+z..is there any connection??
 

i have one more doubt.....we are using command "serial" for accessing my mobile but my mobile is actually connected by a USB to my cell phone..so how will it work for s=serial('com12');
plz help..
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top