problem with 'chat' scripts and ppp connection

problem with 'chat' scripts and ppp connection

Post by ea.. » Wed, 22 Dec 1999 04:00:00



hi,

i've been having trouble with linux and connecting it to my ISP
through PPP for some times now, and now i'm so close to solving it.  

i've configured all the files i know thats needed for ppp connection.
the scripts below i've taken from the ppp-howto but the
'ppp-on-dialer'
dosent work, the modem dosen't seem to repond correctly, it just comes
back with 'alarm' when it should be 'OK -- got it' or something.  I
think
my modem is not a winmodem as it dialed before but did not connect to
ISP.

What i did was to make the two scripts below excutable by root them i
ran ppp-on which automaticly ran ppp-on-dialer that's where the
problem
is.

could you take a look at it and tell me what i need to do to make it
work.
muck apercialated!

This is the ppp-on-dialer chat script:

#!/bin/sh
exec /usr/sbin/chat -v          \
        TIMEOUT         3       \
        ABORT   BUSY    \
        ABORT   'NO ANSWER'     \
        ''      ATZ             \
        'OK-+++\c-OK'   ATH0    \
        TIMEOUT 30              \
        OK              ATDT$TELEPHONE  \
        CONNECT ''              \
        ogin:--ogin:    $ACCOUNT        \
        assword:        $PASSWORD

This is the ppp-on shell script:

#!/bin/sh
#
# Script to initiate a PPP connection.  This is the first part of the
# pair of scripts.  This is not a secure pair of scripts as the codes
# are visible with the 'ps' command.  However, it is simple.
#
# These are the parameters.  Change as needed.
TELEPHONE=12345678      # The telephone number for the connection
ACCOUNT=user            # The account name for logon
PASSWORD=password       # The password for this account
LOCAL_IP=0.0.0.0        # Local IP address if know.  Dynamic = 0.0.0.0
REMOTE_IP=0.0.0.0       # Remote IP address if desired.  Normally
0.0.0.0
NETMASK=255.255.255.0   # The proper netmask if needed
# Export them so that they will be available to 'ppp-on-dialer'
export TELEPHONE ACCOUNT PASSWORD
#
DIALER_SCRIPT=/usr/sbin/ppp-on-dialer
# Initiate the connection
exec /usr/sbin/pppd debug /dev/ttyS2 38400 \
        $LOCAL_IP:$REMOTE_IP \
        connect $DIALER_SCRIPT

This is result from the syslog (/var/log/messages):

Dec 21 01:07:51 earth kernel: PPP: version 2.2.0 (dynamic channel
allocation)
Dec 21 01:07:51 earth kernel: PPP Dynamic channel allocation code
copyright 1995 Caldera, Inc.
Dec 21 01:07:51 earth kernel: PPP line discipline registered.
Dec 21 01:07:51 earth kernel: registered device ppp0
Dec 21 01:07:54 earth pppd[255]: pppd 2.2.0 started by root, uid 0
Dec 21 01:07:56 earth chat[258]: timeout set to 3 seconds
Dec 21 01:07:56 earth chat[258]: abort on (BUSY)
Dec 21 01:07:56 earth chat[258]: abort on (NO ANSWER)
Dec 21 01:07:56 earth chat[258]: send (ATZ^M)
Dec 21 01:07:56 earth chat[258]: expect (OK)
Dec 21 01:07:59 earth chat[258]: alarm                  ( This is
beginning of the problem, it
should read ... [...]: OK -- got it, i think it might have something
to do with my serial
setting for the modem or something 'cos i checked the chat script
(ppp-on-dialer) over and
over again and it seemed perfectly ok acording to the man page on
chat.)
Dec 21 01:07:59 earth chat[258]: send (+++)
Dec 21 01:07:59 earth chat[258]: expect (OK)
Dec 21 01:08:02 earth chat[258]: alarm
Dec 21 01:08:02 earth pppd[255]: Connect script failed
Dec 21 01:08:02 earth chat[258]: Failed
Dec 21 01:08:04 earth pppd[255]: Exit.
Dec 21 01:09:47 earth kernel: PPP: ppp line discipline successfully
unregistered

from

chris

 
 
 

problem with 'chat' scripts and ppp connection

Post by Claudiu Cismar » Wed, 22 Dec 1999 04:00:00



> hi,

> i've been having trouble with linux and connecting it to my ISP
> through PPP for some times now, and now i'm so close to solving it.

> i've configured all the files i know thats needed for ppp connection.
> the scripts below i've taken from the ppp-howto but the
> 'ppp-on-dialer'
> dosent work, the modem dosen't seem to repond correctly, it just comes
> back with 'alarm' when it should be 'OK -- got it' or something.  I
> think
> my modem is not a winmodem as it dialed before but did not connect to
> ISP.

> What i did was to make the two scripts below excutable by root them i
> ran ppp-on which automaticly ran ppp-on-dialer that's where the
> problem
> is.

> could you take a look at it and tell me what i need to do to make it
> work.
> muck apercialated!

> This is the ppp-on-dialer chat script:

> #!/bin/sh
> exec /usr/sbin/chat -v          \
>         TIMEOUT         3       \
>         ABORT   BUSY    \
>         ABORT   'NO ANSWER'     \
>         ''      ATZ             \
>         'OK-+++\c-OK'   ATH0    \
>         TIMEOUT 30              \
>         OK              ATDT$TELEPHONE  \
>         CONNECT ''              \
>         ogin:--ogin:    $ACCOUNT        \
>         assword:        $PASSWORD

> exec /usr/sbin/pppd debug /dev/ttyS2 38400 \
>         $LOCAL_IP:$REMOTE_IP \
>         connect $DIALER_SCRIPT

    Your modem is on com3 installed ? if no, ajust /dev/ttySx where x=0
for com1, 1 for com2, ....

    If is correct,

    # minicom -s

    Then configure at Serial port settings:
    change at A in /dev/modem, then:

    # rm -f /dev/modem
    # ln -s /dev/ttySx /dev/modem
    # minicom

    Now, if your modem respond, must have an init string and OK
    Try to type: AT and he must respond: OK. Press CTRL+A and Z

    Now, you are in prompter.

    #
    Run the script of ppp again
    If he can't get OK, then:

#!/bin/sh
exec /usr/sbin/chat -v          \
        TIMEOUT         3       \
        ABORT   BUSY    \
        ABORT   'NO ANSWER'     \
        ''      ATZ             \
        'OK-+++\c-OK'   ATH0    \
        TIMEOUT 30              \
        OK              ATDT$TELEPHONE  \ - modify this line with: OK
\dATDT$TELEPHONE
        CONNECT ''              \
        ogin:--ogin:    $ACCOUNT        \
        assword:        $PASSWORD

    And see if it work.

    Claudiu

 
 
 

problem with 'chat' scripts and ppp connection

Post by Claudiu Cismar » Wed, 22 Dec 1999 04:00:00


    Correction to previous: You must change:

Quote:

> #!/bin/sh
> exec /usr/sbin/chat -v          \
>         TIMEOUT         3       \
>         ABORT   BUSY    \
>         ABORT   'NO ANSWER'     \
>         ''      ATZ             \ - change in: ''    \dATZ
>         'OK-+++\c-OK'   ATH0    \
>         TIMEOUT 30              \
>         OK              ATDT$TELEPHONE  \
>         CONNECT ''              \
>         ogin:--ogin:    $ACCOUNT        \
>         assword:        $PASSWORD

 
 
 

problem with 'chat' scripts and ppp connection

Post by Clifford Ki » Wed, 22 Dec 1999 04:00:00



> i've been having trouble with linux and connecting it to my ISP
> through PPP for some times now, and now i'm so close to solving it.  
> i've configured all the files i know thats needed for ppp connection.
> the scripts below i've taken from the ppp-howto but the
> 'ppp-on-dialer'
> dosent work, the modem dosen't seem to repond correctly, it just comes
> back with 'alarm' when it should be 'OK -- got it' or something.  I

Yes, the modem isn't responding or isn't responding within the timeout
allowed.

Quote:> think my modem is not a winmodem as it dialed before but did not
> connect to ISP.

Dialed before *what*?

Quote:> What i did was to make the two scripts below excutable by root them i
> ran ppp-on which automaticly ran ppp-on-dialer that's where the
> problem is.

Not before this since doing that won't affect anything.

Quote:> could you take a look at it and tell me what i need to do to make it
> work.

There was nothing in the chat script that would cause the problem.

I'd guess that the IRQ configured for the modem device file /dev/ttyS2
is incorrect.  It must be the same as the IRQ that the modem's serial
port actually uses.  "setserial /dev/ttyS2" shows the configured IRQ.

The serial port IRQ is set by jumpers/switches, a MS DOS configuration
program, or, in the case of PnP, by using the isapnp and pnpdump
programs.

--

/* Need to post debug logs under a MS OS?  Change the *nix EOL to
   MSDOS EOL with "sed s/\$/^M/g logfile > foo", where ^M is a CR
   created with control-v control-m.  Copy foo to an DOS formatted
   floppy, read it under MS. */

 
 
 

problem with 'chat' scripts and ppp connection

Post by Bill Unr » Wed, 22 Dec 1999 04:00:00



>#!/bin/sh
>exec /usr/sbin/chat -v              \
>    TIMEOUT         3       \

Increase this to 30. If you find that you do get the OK after say 10
sec, you have irq mismatch. Use setserial to set your irq to the one
that the modem is actually using (and make sure it is not in conflict
with anything else-- like the onboard serial ports).
 
 
 

problem with 'chat' scripts and ppp connection

Post by ea.. » Wed, 22 Dec 1999 04:00:00


Quote:>Increase this to 30. If you find that you do get the OK after say 10
>sec, you have irq mismatch. Use setserial to set your irq to the one
>that the modem is actually using (and make sure it is not in conflict
>with anything else-- like the onboard serial ports).

ya, i did what you said and it worked so how do i use setserial to
change the irq and to what.

thanx a lot

 
 
 

problem with 'chat' scripts and ppp connection

Post by ea.. » Thu, 23 Dec 1999 04:00:00


Hi

i just got the thing working, the thing i done wrong was that irq on
my modem was wrong, so changed it from 4 to 3 and it works fine
now.

Thanx to everyone who repleyed:-)

chris