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.

Sending SMS using AT commands in one line

Status
Not open for further replies.

billgates2000

Newbie level 1
Joined
Nov 11, 2010
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,291
Hi,

I'm trying to use a GSM modem to send SMSs using AT commands, through putty or Microsoft's Hyperterminal client. The GSM modem is connected to COM1. I managed to make this work, so there are no problems with the hardware or connectivity. The problem is that I need this to be done in only one line of code (so that I can easily enclose it in batch files etc). So as soon as I connect to the modem using putty, I would like the following to be entered as one command:

AT+CMGW="91234567"<CR>Text of message.<Ctrl+z>

How can this be done? How can I tell putty or the Hyperterminal client to recognise <CR> as a carriage return and <Ctrl+z> as they key combination of Ctrl & Z?
 

did you connect GSM with microcontroller?or u just connect it with hyperterminal and control the AT command from there?
 

hey billgates!!!!
u didnt mention the language u r using....
still i could give u the code in c#...
port.Write("AT+CMGS=\"91234567" "\"" + "\r\n" + "Text of message." + "\r\n");
string W = ("AT+CMGS=\"91234567" "\"" + "\r\n" + "Text of message." + "\r\n");
Thread.Sleep(1000);
string sm = port.ReadExisting().ToString();
byte[] buf = new byte[5];
buf[0] = 0x1A;
port.Write(buf, 0, 5);
Thread.Sleep(1000);
string res = port.ReadExisting().ToString();
Thread.Sleep(2000);

i think u got sum idea frm dis....
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top