Subject: Serial setup.
To: netbsd-help <netbsd-help@NetBSD.ORG>
From: John Maier <JohnAM@datastorm.com>
List: netbsd-help
Date: 02/28/1995 11:17:00
Oh yes, I know this problem well.   Here the problem.
You are undoubtablely using a 9600, 14400 or 28.8k modem.  These modems, 
when turned on, default to either 300, 1200, 2400 (this depends upon the 
minimum baud rate supported) or nothing.  The baud rate will only change 
when you send some sort of data to the port.   I.e. you do a 'echo "at" > 
/dev/tty01',  and in your case, the port speed of the modem will change to 
19200. This is called auto-baud detect.

     Problem,  if you try to do a 'echo "at" > /dev/tty01' when CD (carrier 
detect) is low (off-line), NetBSD will hang until CD raises or you log into 
another port and kill the process.

     My answer...I work for Datastorm (the Procomm guys) so you'll have to 
make allowances if you don't have access to Procomm Plus.

1) Using Procomm+ 11B, 2.01 for DOS or 1.0x or 2.xx for Windows, access
the modem.  Initialize your modem. (If you need more specific
information on how to do this, drop me a note with your modem.)

2) type 'AT&W1' to place the current setting in NVRAM, register 1. This is 
so you can quickly go back to an interactive modem session simply by typing 
'ATZ1'

3) type 'ATE0Q1&CS0=1' to which you should get nothing back.  This turns 
echo off, turns result codes off (keeps the modem from confusing BSD), 
places the modem on-line (CD high) and puts the modem in auto-answer mode (1 
ring, increase S0=? to a higher number to wait for more rings before 
answering, 0 turns auto-answer off).

4) type 'AT&W0' to place the current setting in NVRAM, register 0.

5) type 'AT&Y0' to set the working register to 0.  So when the modem
first turned on, the setting from register 0 is made the active profile.

So in effect, when you first turn on the modem, the default settings from 
register 0 will be loaded, resulting in the modem set to echo off, result 
codes off , the modem on-line (CD high) and the modem in auto-answer mode.

Why CD high?  Because when NetBSD sees CD high, BSD will send a login prompt 
message to the port, in effect setting the modem's port speed (no more 
garbage!)

I realize this is a rather hacked way of doing things, but I could find 
nothing on how to initialize a modem during startup.  Placing
'echo "ATE0Q1&CS0=1" > /dev/tty01' in the /etc/rc doesn't work!

BTW if you have any sort of 'at...' sequence in your login prompt, your 
modem may act funny, so be careful.  I.e. my login prompt is:

NetBSD/i386 (jam.datastorm.com) (tty01)

login:

Notice in datastorm, there is the sequence 'ata', this tell the modem to 
answer the phone, ring or no ring.  So get a nice answer each time
I restart BSD, but after that it's fine.  So I initalized my modem with an 
additional command of 'L1' (low volume, my string is 'ATE0Q1L1&CS0=1').

If anyone has a better way of initializing the modem, please tell me!

thanks and enjoy!
jam
**********************************************************************
*       John A. Maier          * Research Assistant For Datastorm    *
* E-mail: johnam@datastorm.com * Technologies Inc. (Procomm Plus)    *
* AOL:    BigJohnAM@aol.com    * (314) 443-3283                      *
**********************************************************************