Find the answer to your Linux question:
Results 1 to 5 of 5
Hi all. I'm attempting to communicate with a remote modem using a serial modem on a local Linux machine. I'm ultimately aiming to integrate functionality with some basic PHP for ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2010
    Posts
    3

    Modem to modem communications from terminal


    Hi all. I'm attempting to communicate with a remote modem using a serial modem on a local Linux machine. I'm ultimately aiming to integrate functionality with some basic PHP for a web interface, but first need to identify a solution for controlling my serial modem and successfully dialing out & interfacing.

    So far I've tried wvdial, but have run into the simple problem that it's a PPP dialer - and from my understanding I don't require a PPP connection. All I want from the remote machine is a command line - which wvdial actually provides, before filling the output with failed attempts to start pppd.

    I've seen mentioned the other method of echoing arguments directly to the tty (echo "ATZ" > /dev/ttyS0). This does work (my modem makes all the right noises ), but I don't know of a way to listen for responses from the remote modem (such as the CONNECT signal).

    It'd be nice if I could handle a basic connection using a bash script with no additional binaries such as wvdial, but am open to any suggestions or corrections. The aim of the entire operation is to download a text file from a remote server that can be only accessed through phoneline + modem.

  2. #2
    Linux Engineer rcgreen's Avatar
    Join Date
    May 2006
    Location
    the hills
    Posts
    1,134
    You probably want a program like minicom It is
    the usual way to talk to your modem, issue AT
    commands and so forth.

    minicom(1) - Linux man page

  3. #3
    Just Joined!
    Join Date
    Jul 2010
    Posts
    3
    Quote Originally Posted by rcgreen View Post
    You probably want a program like minicom It is
    the usual way to talk to your modem, issue AT
    commands and so forth.
    Thanks for the tip - am going to use minicom with PHP-generated runscripts (linux.die.net/man/1/runscript) - in which I can use "! killall minicom" to safely exit minicom once my commands are complete. Hopefully this will serve as a reliable solution.

  4. #4
    Just Joined!
    Join Date
    Jul 2010
    Posts
    6
    Back in da days.

    ATDT ########(phone number) - was the function to dial
    ATA - Was used to answer on the receiver end
    ATZ - Terminate connection

  5. #5
    Just Joined!
    Join Date
    Jul 2010
    Posts
    3
    Somewhat related further problem. I'm now using minicom & runscript to run the necessary commands on the remote server. Part of my runscript is this:

    Code:
    send "sz /path/to/file"
    expect {
        "READY: press any key to continue..."
    }
    send "\r"
    This should work, since manually connecting to the server and entering the sz command results in "**B00* being printed to the output, then a box appearing with a progress bar for the download, finally ending in the text starting 'READY:' as shown above.

    However, running this via the script results in "**B000000000000" being sent to the output, and the progress bar dialogue never appears, and my script never gets the opportunity to continue after the 'READY:' text.

    Can anyone explain the difference in the behaviours here? I was under the impression runscript emulated input, but this looks like it's doing something else.

    Edit: Further analysis shows more data being passed to the line that contains the **B000000000000 string. Pressing the right-arrow on the keyboard reveals the following, all confined to one line, repeating approx 11 times:

    ��07-10.pay5346 11425117522 100660 0 1 5346*�o�07-10.pay5346 11425117522 100660 0 1 5346*�o

    '07-10.pay' is the name of the file I'm trying to download.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •