how can i detect the modem connection speed when using pppd. 

Newsgroups: uk.comp.os.linux
Date: 1998/11/02
> how can i detect the modem connection speed when using pppd? but i've
> found no reference in howtos, faqs, etc. to how to achive this. I need
> to know the connection speed, eg. 33600, rather than the serial line
> speed which i do know.

In the chat-ppp script add the following lines:

REPORT CONNECT
REPORT CARRIER

(I've added mine after the ABORT lines. This will tell your box-modem speed (CONNECT) and your modem-isp speed (CARRIER).

Gav.

how can i detect the modem connection speed when using pppd. 

>how can i detect the modem connection speed when using pppd? but i've

Make sure you use the correct modem commands to make your modem report connection speed when it connects then adjust your dialing script (the one specified by pppd's connect option) to extract the speed from the connect message. Something like the following should work:

echo ATDT $PHONENUMBER
read CONNECTSTATUS SPEED
if [ "$CONNECTSTATUS" = "CONNECT" ]
then
 #Save the details.  Speed string
 #may need a bit of manipulation
else
 #Abort to error handling routine
fi

Bill Hay

how can i detect the modem connection speed when using pppd. 

In my ppp-on-dialer script, I have:

#!/bin/sh
CONN=1
until [ $CONN -eq 0 ]; do
/usr/sbin/chat -r /var/log/chat                         \
        TIMEOUT         10                              \
        ABORT           '\nBUSY\r'                      \
        ABORT           '\nNO ANSWER\r'                 \
        ABORT           '\nRINGING\r\n\r\nRINGING\r'    \
        ABORT           '\nNO DIALTONE\r'               \
        REPORT          'ATDT'                          \
        REPORT          'CONNECT'                       \
        REPORT          'tele'                          \
        REPORT          'test-finch'                    \
        REPORT          'finch'                         \
        ''              '\rAT&FW1&G2%E3\\N3%C3\\V1'     \
        OK              '\rATS0=0S2=255S6=2S11=50S91=15' \
        ''              '\rAT'                          \
        'OK-+++AT\c-OK' '\rATH0'                        \
        TIMEOUT         90                              \
        OK              ATDT$TELEPHONE                  \
        CONNECT         ''                              \
        ogin:--ogin:    $ACCOUNT                        \
        assword:        $PASSWORD                       \
        ocol:           ppp
CONN=$?
done

which makes any lines with ATDT, CONNECT, tele, test-finch or finch be logged into /var/log/chat. During connection, I can tail -f /var/log/chat and see what my initial connection speed was. You cannot monitor your *current* connection speed as all but professional modems can only do this inline usint at&v1 or similar. You can of course check for re-trains etc. after your connection has terminated.

Alex Butcher