Subject: Re: recurring modem problems 8-(
To: SamMaEl <rimsky@teleport.com>
From: David Leonard <leonard@dstc.qut.edu.au>
List: port-mac68k
Date: 02/23/1998 08:58:32
On Sun, 22 Feb 1998, SamMaEl wrote:

> 	Tonight I've been experimenting with getting a dialup shell on my
> NetBSD machine (that is, dialing up my NetBSD machine from another
> machine), and not only have I had problems with that, but now my modem
> does not even respond when I invoke pppd to try to dialup my ISP.
> 
> 	I used cu to edit the modem settings to get it to answer the calls
> like so:
> 
> brahms# cu -p port1
> atz
> at&f1
> atq1
> ate0
> ats0=1
> at&w
> atz
> ~.<enter>
> brahms#
> 
> 	My first problem (besides not being able to find my modem manual
> to find some of the more obscure init strings), was that cu didn't like
> the ~. to exit. When I enterred ~ it added [brahms] right after the ~, and
> when I enterred the period, it said cu: not found and then exitted.
> Strange... or maybe that's how it is supposed to quit?

you can be a teeny bit quicker. Typing '~' then waiting for a moment
will show you the name of the host running the cu that 'saw' the '~'. This is
so you can cu to another machine, and cu from there, and figure out which
cu is hearing your '~' strokes.  Typing '~.' quickly won't show the hostname.

> 	Next... with the dialup shell, I was finally able to get it to
> CONNECT to my modem, but then I couldn't get anything but garbage onto my
> terminal. I ran getty std.9600, getty std.38400 and getty Auto-baud, and
> none were able to do anything more than put a bunch of garbage characters
> on the screen (or nothing at all!) I also tried different modem speeds,
> client-side... and same results. 

have you tried adding 'local' to the /etc/ttys line? I must admit that
on my mac DCD just isn't being recognised any more but I think its a cable
problem.

> 	My first question(s)... what is the best way to go about getting
> the modem to answer the call, and getting NetBSD to send a login prompt
> over the line after connect? 

well.. it should "just work". I use ATQ2E0S0=0 (i think). When someone dials
in, DTR should rise and cause getty to wake up. The Q2 stops the RING and
CONNECT messages from confusing login (I think it's ATQ2 to do that).
I personally dont trust autobauding. Just set it to the maximum speed (38400?)
and let the modem do the speed translation.

There are also hayes commands for fixing the speed as I recall. read your
modem's manual. (AT+MS=38400 ?)

> 	Next, I also tried to get a dialup PPP server going. And, I pretty
> much got it to work. Mac TCP Watcher on the MacOS side (the client) was
> able to get the client's IP, 192.168.2.1 and its domain name,
> ppp0.woo.org, but any other tests, TCP or UDP failed. And, I couldn't
> telnet or ftp to brahms, the NetBSD machine. I checked brahms and it had a
> routing entry for ppp0, but my guess is it was not creating a route to the
> server FROM the client... and since with FreePPP you can't set your router
> manually, I'm not sure how to fix that. I DID try the defaultroute option,
> which didn't help... I spent about an hour going over every option in the
> man page ;-)

try running 'tcpdump -lv -i ppp0' (see the man page) to watch the interface
traffic.  It might give you an idea of what is happening and what isn't.

> 	So, does anyone have any ideas or experiences with getting the PPP
> dialup server under NetBSD? (I did it with FreeBSD like... a year or two
> ago and can't remember a damn thing) I asked about a week ago about
> this... and I think it would be a great candidate for a HOW-TO document.
> Maybe if I ever figure it out I'll take a crack at it ;-)

Yeah... i use ppp nearly every day. it "just works". I use demand dial and
hylafax, but the recent loss of DCD (cable change) has stuffed me up a bit.

> 	And lastly, now that my modems have gone haywire under NetBSD, how
> the heck am I supposed to set them back to their defaults and make it
> STAY? I try using cu to reset them, but first I kept getting a Permission
> Denied error:
> 
> cu: open (/dev/tty00): Permission denied
> cu: All matching ports in use

thats probably a permissions error on /dev/tty00.. cu wants it to be writable
by the dialer group (i think). I just do a 'chmod 666 /dev/tty00' before 
using it. Klunky i admit but it works.

> 	And then when I was finally able to get cu to edit it, running
> pppd again on it set it to recieve a call again, rather than MAKING the
> call to my ISP. I had to plug a modem into my MacOS machine and use a
> dialup shell account to get to my email!
> 
> 	Also, there is a bit of a bug in the /dev/MAKEDEV script.... I
> remade my tty* devices (to get cu to work with tty00), and got this:
> 
> brahms# ./MAKEDEV tty*
> mknod: invalid minor number: p0
> chown: tty0p0: No such file or directory
> mknod: invalid minor number: p1
> chown: tty0p1: No such file or directory
> mknod: invalid minor number: p2
> [etc.... etc....]

Bzzt wrong arguments. Read the MAKEDEV script. Also see the manpage on it.
You don't say 'MAKEDEV tty00', you say 'MAKEDEV tty', or at least the argument
is not the name of the special file(s) created.

> brahms# ls -l tty*
> crw-------  1 uucp  wheel   0, 12 Feb 22 05:37 tty0
> crw-------  1 uucp  wheel  12,  1 Feb 22 05:37 tty001
> crw-------  1 root  wheel  11,  0 Feb 22 05:37 ttye0
> 
> 	No tty, no tty00 or tty01, NO ttyp's at ALL.... and a tty001! ;-)
> A lollipop to whoever has enough serial ports to require using 3 digits to
> identify them! ;-)

evil. maybe MAKEDEV should be a bit more robust.

> 	I don't know how to go about doing a send-pr, so I thought I'd

You just run 'send-pr'. Admittedly, it wants to be able to send mail, so
if your ppp connection isn't working, it won't either :)

> pass that along... and I hadn't heard anything about it. I'm pretty sure I
> have a stock MAKEDEV script... at least, I've not edited it. a ./MAKEDEV
> all installed the correct tty* files. Tho, it took considerably longer
> than a ./MAKEDEV tty* should ;-)
> 
> 	Any help is MUCH appreciated, as I have some friends working on a
> project with me, which requires them to be able to telnet into my
> machine... and until I get my modem to work normally, I can't dialup my
> ISP, except under MacOS 8-( And, I've been trying to fix it all night! I
> better go to bed though, because it's 6am, and my baseball bat is looking
> like it wants to jump in my hands and bash in my monitor... eek!

No pain, no gain!

d
--
David Leonard                           David.Leonard@dstc.edu.au
Distributed Systems Technology Centre   Room:S-1223 Ph:+61 7 3864 4471
Queensland University of Technology     http://www.dstc.edu.au/~leonard/
Q 4001  Australia                       E2A24DC6446E5779D7AFC41AA04E6401
'Bother', said Pooh, as David Paulson ran to him with his pants down