Fred Ramsing wrote:
> I installed RedHat 5.1 for the first time a month ago. At first I
> couldn't get minicom to work, but the problem went away un-explicably and
> I was able to use it. Un-explicably, the problem came back. When I start
> minicom as myself I get the following error:
> minicom: cannot open /dev/modem: Device or resource is busy
> When I start minicom as root, it runs, but I can't dial out and it won't
> give me an AT command line. I have /dev/modem linked to /dev/cua1 (COM2)
> which is root/uucp writable while /usr/bin/minicom is executable by all
> with group ownership and GID bit on. I can't find any lock files
> anywhere. I can't find any processes that are using /dev/modem or
> /dev/cua1 either.
> I tried Seyon, too, but of course it wouldn't work. It responded with:
> no modem device is specified
> modem device is locked
> failure to open modem device
> I tried "echo ATDT > /dev/modem", but that didn't work either.
> Would someone like to explicate a solution? TIA,
> Fred
Fred,
I,too,have Redhat 5.1. Attached is just ONE combination of settings that
work. Enjoy!
Timothy Buckelew
[
notes 7K ]
It took me a long time to get ppp to work. In the end,
I was making one small error in sensing the strings being
sent out by my internet service provider. The tipoff was
an "alarm" message from chat, the dialing program.
Included below are tips and one set of files with settings that work
with RedHat5.1. Note this is just one way to go about it.
There may be setup programs that work better for you,
like netcfg and wvdial. Advice often comes in the form,
"Just do this...", and beginners are stuck not knowing what happened
if it doesn't work. The examples below may give some
depth of understanding.
You can modify files with an editor. I like "joe", because it is
simple and self-explanatory; and you can move around with the
arrow keys. Real programmers use vi.
==============================================================
First use a simple communications program to see how your
modem is responding and how your ISP performs:
minicom is helpful in ISP setup. I use this string to
start it, so that ALT commands will work: minicom -M
Initialize your modem with a simple command like AT&D2.
Your modem should respond with "OK".
Then call your ISP, with a command like, ATDT5551212
Using minicom I could see that this is what my modem says:
CONNECT 57600
After about 3 seconds my ISP outputs the following two lines:
** Ascend TNT Terminal Server **
login:
Then of course after I enter my name, it comes back with this:
Password:
Then I enter my password, exit Minicom with ALT-Z, Q, Yes
(just ALT-Q works, too.)
Next launch pppd with the script,
"pppd -d -detach /dev/modem 57600 &"
I have named it "pup" for "ppp up". In other works, put the
script in a file called "pup" in /usr/bin. Give pup executable
permissions with the command, "chmod +x /usr/bin/pup")
==================================================================
/dev/modem should be a link to your proper ttySn. It should look
like this in the directory, /dev:
lrwxrwxrwx 1 root tty 10 Nov 7 23:29 modem -> /dev/ttyS1
You create it like this:
ln -s /dev/ttyS1 modem
==================================================================
You can watch the results of your attempts to connect,
on another xterm that is running
"tail -f /var/log//messages".
==================================================================
Then I launch netscape, telnet, ping, or whatever, and it works fine.
The connect speed, 57600, seems to be OK. I get consistent
40000+ (sometimes 50000) bps transfer rates with a ThunderLink
(a WHAT?) v.90 modem. Nice.
=================================================================
This is the output from
tail -f /var/log/messages upon SUCCESSFUL minicom login:
Nov 28 11:40:18 localhost pppd[744]: pppd 2.3.3 started by root, uid 0
Nov 28 11:40:18 localhost pppd[744]: Using interface ppp0
Nov 28 11:40:18 localhost pppd[744]: Connect: ppp0 <--> /dev/modem
Nov 28 11:40:21 localhost pppd[744]: local IP address 209.6.64.43
Nov 28 11:40:21 localhost pppd[744]: remote IP address 10.220.10.116
==================================================
Now for the automatic way.
Here are the successful ppp files:
=====================================================
Here is my ppp-on. Put it in /usr/sbin so that it can be executed
from any directory. Give it permissions as follows:
chmod 755 /usr/sbin/ppp-on
#!/bin/sh
#
TELEPHONE=555-1212 #fake
ACCOUNT=aqua #Use your own
PASSWORD=xxxxxxxx #fake; put your real password here
LOCAL_IP=0.0.0.0 #
REMOTE_IP=0.0.0.0 #
NETMASK=255.255.255.0 #
#
export TELEPHONE ACCOUNT PASSWORD
#
DIALER_SCRIPT=/etc/ppp/ppp-on-dialer
#
exec /usr/sbin/pppd debug lock modem crtscts /dev/ttyS1 57600 \
asyncmap 20A0000 escape FF kdebug 0 $LOCAL_IP:$REMOTE_IP \
noipdefault netmask $NETMASK defaultroute connect $DIALER_SCRIPT &
==========================================================
Here is MY ppp-on-dialer. Leave it in /etc/ppp and give it the
same executable permissions (i.e., chmod 755 /etc/ppp/ppp-on-dialer)
The ISP strings you will be sensing will be different from mine.
#!/bin/sh
exec chat -v \
TIMEOUT 3 \
ABORT '\nBUSY\r' \
ABORT '\nNO ANSWER\r' \
ABORT '\nRINGING\r\n\r\nRINGING\r' \
'' \rAT \
'OK-+++\c-OK' ATH0 \
TIMEOUT 30 \
OK ATDT$TELEPHONE \
"CONNECT 57600" '' \
"ver **" '' \
ogin:--ogin: $ACCOUNT \
assword: $PASSWORD
=========================================================
Note that "ver **". That is to sense the last few characters
of the line sent by the ISP, that reads
"** Ascend TNT Terminal Server **" If your ISP is sending
lines other than "Login:" and "Password:", you may have
to deal with them similarly.
=========================================================
Here is the output from tail -f /var/log/messages for
the SUCCESSFUL ppp-on login:
Nov 28 13:02:19 localhost chat[1093]: expect (CONNECT 57600)
Nov 28 13:02:19 localhost chat[1093]: ^M
Nov 28 13:02:53 localhost chat[1093]: ATDT555-1212^M^M [fake again]
Nov 28 13:02:53 localhost chat[1093]: CONNECT 57600
Nov 28 13:02:53 localhost chat[1093]: -- got it
Nov 28 13:02:53 localhost chat[1093]: send (^M)
Nov 28 13:02:53 localhost chat[1093]: expect (ver **)
Nov 28 13:02:53 localhost chat[1093]: ^M
Nov 28 13:02:57 localhost chat[1093]: ^M
Nov 28 13:02:57 localhost chat[1093]:
Nov 28 13:02:57 localhost last message repeated 23 times
Nov 28 13:02:57 localhost chat[1093]: ** Ascend TNT Terminal Server **
Nov 28 13:02:57 localhost chat[1093]: -- got it
Nov 28 13:02:57 localhost chat[1093]: send (^M)
Nov 28 13:02:57 localhost chat[1093]: expect (ogin:)
Nov 28 13:02:57 localhost chat[1093]: ^M
Nov 28 13:02:57 localhost last message repeated 2 times
Nov 28 13:02:57 localhost chat[1093]: login:
Nov 28 13:02:57 localhost chat[1093]: -- got it
Nov 28 13:02:57 localhost chat[1093]: send (aqua^M)
Nov 28 13:02:57 localhost chat[1093]: expect (assword:)
Nov 28 13:02:57 localhost chat[1093]: aqua^M
Nov 28 13:02:57 localhost chat[1093]: Password:
Nov 28 13:02:57 localhost chat[1093]: -- got it
Nov 28 13:02:57 localhost chat[1093]: send (########^M) [fake again]
Nov 28 13:02:57 localhost pppd[1092]: Serial connection established.
Nov 28 13:02:58 localhost pppd[1092]: Using interface ppp0
Nov 28 13:02:58 localhost pppd[1092]: Connect: ppp0 <--> /dev/ttyS1
Nov 28 13:03:02 localhost pppd[1092]: local IP address 209.6.67.152
Nov 28 13:03:02 localhost pppd[1092]: remote IP address 10.220.10.119
==================================================
Here are the contents of my /etc/resolv.conf:
domain ultranet.com
nameserver 146.115.8.20
nameserver 146.115.8.19
==================================================
And here are the contents of my /etc/ppp/options:
0.0.0.0:
/dev/modem
lock
crtscts
defaultroute
asyncmap 0
mtu 576
mru 576
==================================================
To end the session, enter "ps ax" on an xterm, look for the
PID of the pppd, and kill it with "kill nnnn", where nnnn
is the PID.
(Alternatively, you can enter "killall pppd", or use the
furnished script, ppp-off.)
==================================================
Hope this helps somebody. I know I have been helped many times
by newsgroup contributions.
Sincerely yours,
Timothy Buckelew