Welcome to Soft32 Forums!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Sending AT modem commands from the command line?

 
   Soft32 Home -> Win4 Arch -> Hardware RSS
Next:  Windows Vista from XP - Worth it?  
Author Message
ironcladlou

External


Since: Aug 03, 2007
Posts: 7



(Msg. 1) Posted: Fri Aug 03, 2007 9:27 am
Post subject: Sending AT modem commands from the command line?
Archived from groups: microsoft>public>windowsxp>hardware (more info?)

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.

--
ironcladlou
Back to top
Login to vote
Bob I

External


Since: Sep 27, 2004
Posts: 1529



(Msg. 2) Posted: Fri Aug 03, 2007 9:27 am
Post subject: Re: Sending AT modem commands from the command line? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Try something on the order of

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


ironcladlou wrote:

> 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.
>
> --
> ironcladlou
>
Back to top
Login to vote
ironcladlou

External


Since: Aug 03, 2007
Posts: 7



(Msg. 3) Posted: Fri Aug 03, 2007 11:28 am
Post subject: Re: Sending AT modem commands from the command line? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Aug 3, 11:40 am, Bob I <bire....RemoveThis@yahoo.com> wrote:
> 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.

--
ironcladlou
Back to top
Login to vote
Bob I

External


Since: Sep 27, 2004
Posts: 1529



(Msg. 4) Posted: Fri Aug 03, 2007 11:28 am
Post subject: Re: Sending AT modem commands from the command line? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

maybe my memory is going to heck

see what you get for screen output from

echo "AT&V" > COM1

ironcladlou wrote:

> On Aug 3, 11:40 am, Bob I <bire....TakeThisOut@yahoo.com> wrote:
>
>>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.
>
> --
> ironcladlou
>
Back to top
Login to vote
ironcladlou

External


Since: Aug 03, 2007
Posts: 7



(Msg. 5) Posted: Fri Aug 03, 2007 12:14 pm
Post subject: Re: Sending AT modem commands from the command line? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Aug 3, 1:03 pm, Bob I <bire... RemoveThis @yahoo.com> wrote:
> 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.

--
ironcladlou
Back to top
Login to vote
Bob I

External


Since: Sep 27, 2004
Posts: 1529



(Msg. 6) Posted: Fri Aug 03, 2007 12:14 pm
Post subject: Re: Sending AT modem commands from the command line? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

ironcladlou wrote:

> On Aug 3, 1:03 pm, Bob I <bire....RemoveThis@yahoo.com> wrote:
>
>>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.
>


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

External


Since: Aug 03, 2007
Posts: 7



(Msg. 7) Posted: Fri Aug 03, 2007 12:37 pm
Post subject: Re: Sending AT modem commands from the command line? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Aug 3, 1:26 pm, Bob I <bire... RemoveThis @yahoo.com> wrote:
> ironcladlou wrote:
> > On Aug 3, 1:03 pm, Bob I <bire... RemoveThis @yahoo.com> wrote:
>
> >>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.
>
> 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.

--
ironcladlou
Back to top
Login to vote
ironcladlou

External


Since: Aug 03, 2007
Posts: 7



(Msg. 8) Posted: Fri Aug 03, 2007 12:37 pm
Post subject: Re: Sending AT modem commands from the command line? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Aug 3, 1:26 pm, Bob I <bire... DeleteThis @yahoo.com> wrote:
> ironcladlou wrote:
> > On Aug 3, 1:03 pm, Bob I <bire... DeleteThis @yahoo.com> wrote:
>
> >>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.
>
> 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.

--
ironcladlou
Back to top
Login to vote
Beverly Howard [Ms-MVP/Mo

External


Since: Jun 29, 2007
Posts: 6



(Msg. 9) Posted: Fri Aug 03, 2007 12:37 pm
Post subject: Re: Sending AT modem commands from the command line? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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]
Back to top
Login to vote
Beverly Howard [Ms-MVP/Mo

External


Since: Jun 29, 2007
Posts: 6



(Msg. 10) Posted: Fri Aug 03, 2007 12:37 pm
Post subject: Re: Sending AT modem commands from the command line? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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]
Back to top
Login to vote
ironcladlou

External


Since: Aug 03, 2007
Posts: 7



(Msg. 11) Posted: Fri Aug 03, 2007 7:44 pm
Post subject: Re: Sending AT modem commands from the command line? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Aug 3, 3:03 pm, "Beverly Howard [Ms-MVP/MobileDev]"
<BevNoSpamBevHoward.com> wrote:
> 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.

--
ironcladlou
Back to top
Login to vote
Beverly Howard [Ms-MVP/Mo

External


Since: Jun 29, 2007
Posts: 6



(Msg. 12) Posted: Fri Aug 03, 2007 7:44 pm
Post subject: Re: Sending AT modem commands from the command line? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

>> 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]
Back to top
Login to vote
V Green

External


Since: Jul 04, 2004
Posts: 112



(Msg. 13) Posted: Fri Aug 03, 2007 7:44 pm
Post subject: Re: Sending AT modem commands from the command line? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Beverly Howard [Ms-MVP/MobileDev]" <BevNoSpamBevHoward.com> wrote in message
news:%236Nvehj1HHA.5740@TK2MSFTNGP04.phx.gbl...
> >> 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.

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]
>
>
Back to top
Login to vote
Bob I

External


Since: Sep 27, 2004
Posts: 1529



(Msg. 14) Posted: Mon Aug 06, 2007 3:19 am
Post subject: Re: Sending AT modem commands from the command line? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

ironcladlou wrote:

> On Aug 3, 3:03 pm, "Beverly Howard [Ms-MVP/MobileDev]"
> <BevNoSpamBevHoward.com> wrote:
>
>>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.
>

in that case see if this gets you a text file

ECHO ATI1 > COM4: > c:\output.txt
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Windows Explorer line commands - I'd appreciate it if anyone could tell me how to do this (or if it can be done). I'd like to add a line command to th...

dos and modem commands in windows XP? - Hi there. (If there is a dos forum or newsgroups please point me in that direction. Thank you.) I am from an old..

Commands in command window - Whenever I open a command window (DOS box) now, and type a command into it (even chkdsk), press the Enter key, I alway...

dos command window commands for del? - Hi there, I am creating a batch file and want to delete everything in a folder using a dos command. I want to do it..

COMMAND LINE NET COMMAND? - I am experimenting with the command-line command 'net'. When I enter 'net view' I get several entries including one..

help with command line - I need to have a scheduled script running at certain time of the day to stop an application (File Maker Pro) from..
       Soft32 Home -> Win4 Arch -> Hardware All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum

Categories:
 Windows
 Linux
 Mac
 PDA


[ Contact us | Terms of Service/Privacy Policy ]