Sending AT modem commands from the command line?

I

ironcladlou

Simple question. Through a batch file or a VBScript, I need to send an
ATI1 command to a modem on COM4, then capture the output to a text
file. Can't figure it out for the life of me. Appreciate the help.
 
I

ironcladlou

Try something on the order of

copy "ATS0=1" > COM4 > C:\output.txt

I see where you're going with it, but it doesn't work. That command
doesn't putput anything to the file, and if I try echo ATI1 > COM4 > C:
\output.txt, I just get a file that says ATI1. Thanks, though.
 
B

Bob I

maybe my memory is going to heck

see what you get for screen output from

echo "AT&V" > COM1
 
I

ironcladlou

maybe my memory is going to heck

see what you get for screen output from

echo "AT&V" > COM1

When I put the quotes in, it looks for a file called "AT&V" and can't
find it. When I issue any AT command via echo, I get no output on the
screen.
 
B

Bob I

ironcladlou said:
When I put the quotes in, it looks for a file called "AT&V" and can't
find it. When I issue any AT command via echo, I get no output on the
screen.


What kind of response do you get from the modem if you open
Hyperterminal, and send commands to the modem there?
 
I

ironcladlou

What kind of response do you get from the modem if you open
Hyperterminal, and send commands to the modem there?

If I type an ATI1, I get this:

Manufacturer: NOVATEL WIRELESS INCORPORATED
Model: EXPEDITE EV620

and a few more lines. It's a Verizon Wireless EVDO card, but for some
insane reason, it responds to the standard AT command set.
 
B

Beverly Howard [Ms-MVP/MobileDev]

no quotes... think it should be

echo at&1 > com4:

however, the spoiler is the "&" character which is used in batch files
so that command won't work, so

put the string in a text file, then use

copy test.txt com4:

(the quotes are not necessary if the file doesn't contain spaces)

Beverly Howard [MS MVP-Mobile Devices]
 
I

ironcladlou

no quotes... think it should be

echo at&1 > com4:

however, the spoiler is the "&" character which is used in batch files
so that command won't work, so

put the string in a text file, then use

copy test.txt com4:

(the quotes are not necessary if the file doesn't contain spaces)

Yeah, the command I need to input to the modem is ATI1, so the
ampersand isn't the problem. The problem is getting the modem's
response into a text file.
 
B

Beverly Howard [Ms-MVP/MobileDev]

The problem is getting the modem's response into a text file. <<

don't think you are going to have much success with this from the
command prompt since there are "text buffering" issues...

i.e. the modem is going to send it's response when it wants to, so there
has to be some kind of bucket in place to catch the response, otherwise
it's like water pouring on the ground... it happens, but it's not
retained, and, afaik, without a program running in place to capture
process the data from the comm port, dos alone can't do it.

Beverly Howard [MS MVP-Mobile Devices]
 
V

V Green

Beverly Howard said:
don't think you are going to have much success with this from the
command prompt since there are "text buffering" issues...

i.e. the modem is going to send it's response when it wants to, so there
has to be some kind of bucket in place to catch the response, otherwise
it's like water pouring on the ground... it happens, but it's not
retained, and, afaik, without a program running in place to capture
process the data from the comm port, dos alone can't do it.

Exactly right. Serial data comes in one byte
at a time, you have to read the bytes individually and
then make a string outta them, all the while looking
for a <CR> char. so you know you've reached the
end of the line.

I don't think the command line will ever do what
to do. You need to write a program. Needs to be
able to program the COM: port for the proper baud
rate, bits, parity, etc. before you can even talk to
the modem.

I used Visual Basic to do this several years ago to
dial a pager number, wait for an answer, send a numeric
page, then wait for and interpret the response from the modem.
Beverly Howard [MS MVP-Mobile Devices]
 
B

Bob I

ironcladlou said:
Yeah, the command I need to input to the modem is ATI1, so the
ampersand isn't the problem. The problem is getting the modem's
response into a text file.

in that case see if this gets you a text file

ECHO ATI1 > COM4: > c:\output.txt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top