Sending AT modem commands from the command line?

Discussion in 'Windows XP Hardware' started by ironcladlou, Aug 3, 2007.

  1. ironcladlou

    ironcladlou Guest

    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
     
    ironcladlou, Aug 3, 2007
    #1
    1. Advertisements

  2. ironcladlou

    Bob I Guest

    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
    >
     
    Bob I, Aug 3, 2007
    #2
    1. Advertisements

  3. ironcladlou

    ironcladlou Guest

    On Aug 3, 11:40 am, Bob I <> 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
     
    ironcladlou, Aug 3, 2007
    #3
  4. ironcladlou

    Bob I Guest

    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 <> 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
    >
     
    Bob I, Aug 3, 2007
    #4
  5. ironcladlou

    ironcladlou Guest

    On Aug 3, 1:03 pm, Bob I <> 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
     
    ironcladlou, Aug 3, 2007
    #5
  6. ironcladlou

    Bob I Guest

    ironcladlou wrote:

    > On Aug 3, 1:03 pm, Bob I <> 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?
     
    Bob I, Aug 3, 2007
    #6
  7. ironcladlou

    ironcladlou Guest

    On Aug 3, 1:26 pm, Bob I <> wrote:
    > ironcladlou wrote:
    > > On Aug 3, 1:03 pm, Bob I <> 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
     
    ironcladlou, Aug 3, 2007
    #7
  8. 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]
     
    Beverly Howard [Ms-MVP/MobileDev], Aug 3, 2007
    #8
  9. ironcladlou

    ironcladlou Guest

    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
     
    ironcladlou, Aug 4, 2007
    #9
  10. >> 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]
     
    Beverly Howard [Ms-MVP/MobileDev], Aug 4, 2007
    #10
  11. ironcladlou

    V Green Guest

    "Beverly Howard [Ms-MVP/MobileDev]" <BevNoSpamBevHoward.com> wrote in message
    news:%...
    > >> 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]
    >
    >
     
    V Green, Aug 4, 2007
    #11
  12. ironcladlou

    Bob I Guest

    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
     
    Bob I, Aug 6, 2007
    #12
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. michele

    verifying modem works with cable modem service

    michele, Jul 12, 2003, in forum: Windows XP Hardware
    Replies:
    7
    Views:
    304
    Manda Luyong
    Jul 12, 2003
  2. Henrik
    Replies:
    1
    Views:
    966
    Sharon F
    Aug 29, 2003
  3. chris
    Replies:
    2
    Views:
    414
    Paul B T Hodges
    Oct 19, 2003
  4. RE

    Modem commands from DOS

    RE, Apr 6, 2004, in forum: Windows XP Hardware
    Replies:
    2
    Views:
    1,557
    Mike Powers
    Apr 6, 2004
  5. Adrian
    Replies:
    4
    Views:
    543
    Andrew Murray
    Apr 15, 2005
Loading...

Share This Page