[H-GEN] Retrieving modem statistics

Michael Anthon michael at anthon.net
Tue Jan 16 09:26:32 EST 2001


[ Humbug *General* list - semi-serious discussions about Humbug and  ]
[ Unix-related topics.  Please observe the list's charter.           ]
[ Worthwhile understanding: http://www.humbug.org.au/netiquette.html ]

Greetings,
I have a desire to see how well my modem connections are performing and
would like to retrieve some information from my modem after each
connection is terminated.  AS an example, the modem I am using returns
the following in reponse to "ATI6"

----------------------------------------------------------------------
U.S. Robotics 56K Voice EXT Link Diagnostics...^M
^M
Chars sent                  416      Chars Received              396^M
Chars lost                    0^M
Octets sent                 307      Octets Received             296^M
Blocks sent                  18      Blocks Received              22^M
Blocks resent                 0^M
^M
Retrains Requested            1      Retrains Granted              0^M
Line Reversals                0      Blers                         0^M
Link Timeouts                 0      Link Naks                     0^M
^M
Data Compression       V42BIS 2048/32^M
Equalization           Long^M
Fallback               Enabled^M
Protocol               LAPM^M
Speed                  31200/26400 ^M
Last Call              00:00:14^M
^M
Disconnect Reason is DTR dropped^M
^M
OK^M
----------------------------------------------------------------------

I came up with a solution that used to work for me, but it does not seem
to work any more and I'm not sure why.  There have been a few upgrades
since I last wanted to check this stuff, noteably the kernel has
recently been upgraded.

The Solution:
*************
There is a script that gets called by pppd each time a connection
terminates, /etc/ppp/ip-down.  This script performs a run-parts 
on /etc/ppp/ip-down.d, so I have a script in there that look slike
this...

----------------------------------------------------------------------
#!/bin/bash
logger Trying to determine disconnect reason on $PPP_TTY
chat -v -f /etc/chatscripts/getdisconreason <$PPP_TTY >$PPP_TTY
----------------------------------------------------------------------

PPP_TTY is set in ip-down and is the device that pppd was running on. 
The chat script is this

----------------------------------------------------------------------
"" ATI6
----------------------------------------------------------------------

The result of the chat script would normally end up being logged in
syslog.

The Problem:
************

It does not work any more 8^).  The cause seems to be some issue with
the serial device.  If I kill the modem connection and run the
chatscript manually, then the script simply hangs there indefinitely, it
even seems to be bypassing the default timeout settings for chat (this
also seems to be the case with the script run by pppd).  If, however, I
run minicom (preventing it from resetting the modem) then kill this off,
the chat script runs perfectly.  This would tend to indicate that it's
not an issue of the device being in use, simply that there is something
odd about the state it is in.

I have tried various things in an attempt to reset the serial device but
have run out of ideas.  Any suggestions as to what I am doing wrong or
what I could try would be greatly appreciated.

Cheers
Michael

--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'.



More information about the General mailing list