How to show output from a modem? - Mandrake

This is a discussion on How to show output from a modem? - Mandrake ; All: How does one show the output from a modem onto the screen? I am using bourne-again shell and want to write a script which shows the output from a modem based upon my input to said modem. Here is ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: How to show output from a modem?

  1. How to show output from a modem?

    All:
    How does one show the output from a modem onto the screen? I am using bourne-again shell and want to
    write a script which shows the output from a modem based upon my input to said modem.
    Here is the first line:

    echo 'ATZ' < /dev/modem

    How would I print out the output to the screen? Thank you.

    Keith

  2. Re: How to show output from a modem?

    On Thu, 27 Mar 2008 07:28:52 -0400, Keith Lee wrote:

    > How would I print out the output to the screen? Thank you.


    Output is quite messy. Make sure nothing else is using the modem, and no other
    cat processes are running (trap the pid of the cat command, and use thatin the
    kill, if other cat processes are running).

    #!/bin/bash
    cat /dev/modem &
    echo "AT&F" > /dev/modem
    sleep 2
    echo "ATS11=50" > /dev/modem
    sleep 2
    echo "AT%C0%E1E1W4&S0S0=0S7=60S11=60S30=0C1+DS=3,0;&V+DS44=3,0;+VCID=1;+ES=3,0,2" > /dev/modem
    sleep 2
    killall cat

    Note the commands I'm sending to the modem are the same as I use in the kppp
    initialization of the modem.

    Regards, Dave Hodgins

    --
    Change nomail.afraid.org to ody.ca to reply by email.
    (nomail.afraid.org has been set up specifically for
    use in usenet. Feel free to use it yourself.)

  3. Re: How to show output from a modem?

    On Thu, 27 Mar 2008 06:28:52 -0500, Keith Lee wrote:

    > All:
    > How does one show the output from a modem onto the screen? I am using
    > bourne-again shell and want to
    > write a script which shows the output from a modem based upon my input
    > to said modem.
    > Here is the first line:
    >
    > echo 'ATZ' < /dev/modem
    >
    > How would I print out the output to the screen? Thank you.
    >
    > Keith


    Assuming you are wanting the response strings, use a term program like
    minicom or the one in kppp.

    BTW, I don't think the above will send ATZ to the modem. Change < to >. To
    test, send ata, and see if it goes into answer mode.

    echo ata > /dev/ttySx
    where x is the port the modem is on, or /dev/modem if you are sure that
    the symlink is correct, and really there. Of course verbose responses need
    to be enabled in the modem. Usually e1 and normally default iirc.

    --
    Want the ultimate in free OTA SD/HDTV Recorder? http://mythtv.org
    My Tivo Experience http://wesnewell.no-ip.com/tivo.htm
    Tivo HD/S3 compared http://wesnewell.no-ip.com/mythtivo.htm
    AMD cpu help http://wesnewell.no-ip.com/cpu.php

  4. Re: How to show output from a modem?

    David W. Hodgins wrote:

    > On Thu, 27 Mar 2008 07:28:52 -0400, Keith Lee wrote:
    >
    >> How would I print out the output to the screen? Thank you.

    >
    > Output is quite messy. Make sure nothing else is using the modem, and no
    > other cat processes are running (trap the pid of the cat command, and use
    > that in the kill, if other cat processes are running).
    >
    > #!/bin/bash
    > cat /dev/modem &
    > echo "AT&F" > /dev/modem
    > sleep 2
    > echo "ATS11=50" > /dev/modem
    > sleep 2
    > echo
    > "AT%C0%E1E1W4&S0S0=0S7=60S11=60S30=0C1+DS=3,0;&V+DS44=3,0;+VCID=1;+ES=3,0,2"
    > > /dev/modem sleep 2 killall cat

    >
    > Note the commands I'm sending to the modem are the same as I use in the kppp
    > initialization of the modem.
    >
    > Regards, Dave Hodgins
    >


    I was thinking about what you wrote there... what if you replaced
    cat /dev/modem &
    with
    tail -f /dev/modem &

    would it work? I'm thinking that cat would only show the 1st response but tail
    would continue to show the next and the next etc.
    I dont have a modem or I'd try it, i always found serial port/modem stuff to
    be fun to mess with. I wrote a complete, from scratch, modem com program for
    dos once, with loopback capabilities, file output etc, very enjoyable
    project.
    Eric


  5. Re: How to show output from a modem?

    On Thu, 27 Mar 2008 15:14:51 -0400, Eric wrote:

    > I was thinking about what you wrote there... what if you replaced
    > cat /dev/modem &
    > with
    > tail -f /dev/modem &


    I actually tried both, before I posted. The tail doesn't work, as it is
    looking for a change in the location of the end of file, which it never
    finds. The cat does work, but seems to generate a lot of blank line
    output, hence the comment about it being messy. Obviously a proper
    terminal program that handles interrupts is the best way to go, but
    for quick & dirty access from a script, the cat & echo commands do
    work, provided the sleep commands in between the echo commands are
    long enough.

    Regards, Dave Hodgins


    --
    Change nomail.afraid.org to ody.ca to reply by email.
    (nomail.afraid.org has been set up specifically for
    use in usenet. Feel free to use it yourself.)

  6. Re: How to show output from a modem?

    Keith Lee writes:

    >All:
    > How does one show the output from a modem onto the screen? I am using bourne-again shell and want to
    >write a script which shows the output from a modem based upon my input to said modem.
    > Here is the first line:


    >echo 'ATZ' < /dev/modem


    Since that tell echo to read its input from the modem, it will not work
    very well

    Anyway why not use minicom, and type in what you want.


    > How would I print out the output to the screen? Thank you.


    >Keith


  7. Re: How to show output from a modem?

    Eric writes:

    >David W. Hodgins wrote:


    >> On Thu, 27 Mar 2008 07:28:52 -0400, Keith Lee wrote:
    >>
    >>> How would I print out the output to the screen? Thank you.

    >>
    >> Output is quite messy. Make sure nothing else is using the modem, and no
    >> other cat processes are running (trap the pid of the cat command, and use
    >> that in the kill, if other cat processes are running).
    >>
    >> #!/bin/bash
    >> cat /dev/modem &
    >> echo "AT&F" > /dev/modem
    >> sleep 2
    >> echo "ATS11=50" > /dev/modem
    >> sleep 2
    >> echo
    >> "AT%C0%E1E1W4&S0S0=0S7=60S11=60S30=0C1+DS=3,0;&V+DS44=3,0;+VCID=1;+ES=3,0,2"
    >> > /dev/modem sleep 2 killall cat

    >>
    >> Note the commands I'm sending to the modem are the same as I use in the kppp
    >> initialization of the modem.
    >>
    >> Regards, Dave Hodgins
    >>


    >I was thinking about what you wrote there... what if you replaced
    >cat /dev/modem &
    >with
    >tail -f /dev/modem &


    Nope cat is teh right command.

    >would it work? I'm thinking that cat would only show the 1st response but tail


    You think wrongly.

    >would continue to show the next and the next etc.
    >I dont have a modem or I'd try it, i always found serial port/modem stuff to
    >be fun to mess with. I wrote a complete, from scratch, modem com program for
    >dos once, with loopback capabilities, file output etc, very enjoyable
    >project.
    >Eric



+ Reply to Thread