From: kimc@w8hd.org (Kim Culhan)
Subject: Re: dial-in modem setup
Organization: w8hd.org
Distribution: na
Date: Wed, 23 Dec 1992 16:19:54 GMT

>|> >I assume your modem is not set to allways return carrier high?  (I.E. your
>|> >modem is configured &c1&d2, or something similar).  If this is the case, your
>|> >getty line should look something like this (taken from my /etc/gettydefs).
>|>
>|> >modem# B19200 OPOST ONLCR # B19200 HUPCL SANE IXANY TAB3 #login: #96modem
>|>
>|>
>|> >The important thing here is the hupcl.
>|>
 
>My Sparc ELC's also don't have /etc/gettydefs and it is not in the man pages.
>What is the format for this file and who (which program) uses it?
I didn't do anything with gettydefs (doesn't exist on my 4.1.2 system.) 
If you set the modem to 'always return carrier high' then
there is, of courese, no way for the machine to get the message that
a connection has been made. I found I needed it to be high in order to 
communicate with it on outbound calls, however.
If CD is not asserted, you can't see any data coming from it (try it..)
I found the ideal solution to this problem to be this:


&C2 CD action is set with a 'modem init' string when you access
the port. With &C2 the modem always asserts CD but for 2 seconds on disconnect.
This is what lets you talk to the modem to tell it to dial etc., yet
still communicate the the fact that the carrier has been lost.
If you leave it set this way all the time, though, you may note 'getty battles'
when standing by for calls. It needs to be set differently depending on
whether its waiting for calls or being used to dial out.
 
I do this when I use tip (man1) by including this is in remote:
 
        :dv=/dev/cua1:br#9600:hf:cm=at&c2e1\r:el=^C^S^Q^U^D:ie=%$:oe=^D:
                                 ^^^^^^^^^^^^
cm stands for 'connect message' which is sent to the modem when you access
the device associated with this line. The e1 sets the modem to echo characters
in command mode (so you can see what you're doing when entering AT commands.)

Also, note that the carrier detect action should be set for 'normal' (&C1)in the
modem's nvram. When you end the call, DTR is dropped which should cause the
modem to reset itself to the stored values (which means &C1 -CD not always
asserted.)
To set the nvram you will need to issue an AT command which looks something
like this: AT&C1E0&W (You must include the &W write to nvram command in the
same line because the moment its set to &C1 the CD line goes low and the &W
never makes it out the port to the modem. Dont forget to include in that
nvram string the commands for your modem to:
1) Reset to nvram values on loss of DTR (gets you back in &C1 after the call)
2) Not to echo characters in command mode (E0 possibly) to doubly protect
   against getty battles.

I hope you followed this -lemme know if not and I'll try again.. 
This arrangement allows the modem to work for both incoming and outgoing calls.
I use the scheme on both IPC ports, one with a MultiTech 224E and the other
with a Telebit. Both modems allow use of this concept although the & commands
are slighlty different and so is the command to tell the modems to reset to
nvram values on DTR drop. Check the manual.Your mileage may vary...
regards
kim culhan
------
kimc@w8hd.org



Newsgroups: comp.sys.sun.admin