Configuring a SUN Sparc Station serial port to dial-in and dial-out with a modem

It's easy to set up a serial port for dial-in access only. If the same port was to be use for dialing out also, it is a little more complicated. First, a serial port must be allocated for the modem. In our example we have chosen ttyb. Here is the procedure to configure a serial port for dial-in and dial-out access.

The problem stems from the getty process taking control of the serial port at boot time. It does not allow other processes to open the port even when it is not in use.

This can be overcome by creating a device file with the high bit of its minor number set. This will allow other process to access the serial port while getty is still running on that port.

	
prompt# rm /dev/cua0 (if it exist)
prompt# mknod /dev/cua0 c 12 129 (128 for ttya)
prompt# chmod 666 /dev/cua0 
prompt# chown uucp /dev/cua0 
prompt# mknod /dev/ttyd0 c 12 1  (c 12 0 for ttya)
prompt# chmod 666 /dev/ttyd0 

Now that the devices has been created, /etc/ttytab has to be modify. The line for ttyd0 and cua0 should look like this:

   
#
# The following two entries represent the same physical modem
ttyd0   "/usr/etc/getty 8bit.Fix.38400" dialup          on      # dialin entry
cua0    none                            unknown         off     # dialout entry

The 8bit.Fix.38400 is an entry in the /etc/gettytab file that was added for 8 bit hardware flow control, 38400 baud serial connection from the Sparc to the modem. Here is the /etc/gettytab entries:

	
#
# Fixed speed 8bit with hardware flow control
#
8bit.Fix.38400:\
        :p8:ms=crtscts:lm=\r\n%h 38400 login\72 :sp#38400:
8bit.Fix.19200:\
        :p8:ms=crtscts:lm=\r\n%h 19200 login\72 :sp#19200:
8bit.Fix.9600:\
        :p8:ms=crtscts:lm=\r\n%h 9600 login\72 :sp#9600:
8bit.Fix.2400:\
        :p8:ms=crtscts:lm=\r\n%h 2400 login\72 :sp#2400:
8bit.Fix.1200:\
        :p8:ms=crtscts:lm=\r\n%h 1200 login\72 :sp#1200:
#


The eeprom setting has to be changed for hardware flow control:

 
prompt# eeprom ttyb-rts-dtr-off=false
prompt# eeprom ttyb-ignore-cd=true
prompt# eeprom ttyb-mode=38400,8,n,1,h

Enable hardware carrier detect; this has to be done with the getty process on ttyd0 off. Therefore edit the /etc/ttytab so the ttyd0 entry looks like this:
ttyd0   "/usr/etc/getty 8bit.Fix.38400" dialup          off      # dialin entry
Restart getty and set hardware carrier detect:

 
prompt# kill -1 1
prompt# ttysoftcar -n ttyd0

The only thing left now is to restart ttyd0 by editing /etc/ttytab .

ttyd0   "/usr/etc/getty 8bit.Fix.38400" dialup          on      # dialin entry
And restart getty for ttyd0.

prompt# kill -1 1

For dialing out, the following entries were added to /etc/remote .

out384:\
        :p8:dv=/dev/cua0:br#38400:el=^C^S^Q^U^D:ie=%$:oe=^D:
out192:\
        :p8:dv=/dev/cua0:br#19200:el=^C^S^Q^U^D:ie=%$:oe=^D:
out|out96:\
        :p8:dv=/dev/cua0:br#9600:el=^C^S^Q^U^D:ie=%$:oe=^D:
out24:\
        :p8:dv=/dev/cua0:br#2400:el=^C^S^Q^U^D:ie=%$:oe=^D:

You can connect to the modem at 38400 baud for dialing out with the following command:

tip out384

Once connection has been established with the modem you can use AT commands to dial out(ie. atdt5551234).


To allow the ZyXEL modem to operate above 9600 baud at a fixed speed the S register 38 bit 3 (38.3) must be set to 1.

AT&FS0=1S38.3=1S18=2&W

&F	Factory default settings
S0=1	Answer on first ring
S38.3=1	Fixed DCE/DTE speed ("Unix mode")
S18=2	DCE/DTE speed of 38.4kbps

For ZyXEL Omni 288 modem use the following string.

AT&FS0=1S38.3=1S18=4&W

For USR Courier modems the following must be set.

AT&F&B1&H1&W

&F	Factory default settings
&B1	Communicate with the computer at a fixed rate regardless of
        connection speed.
&H1	Hardware flow control

Fore Motorola V.34R modem try the following settings:

AT&F&W (Reset to factory default and save)

ATS0=1 (Enables Auto-Answer Mode 1=answeron first ring)

AT*SM3 (Enables automatic MNP error correction)

AT*DC0 (Disables data compression)

AT*FL0 (Disables XON/XOFF flow control)

AT&S1 (Sets DSR to "normal")

AT&W (Saves current configuration settings)

You can also try this site: Unix Serial Port Resources Contents


Back to Dave's home page
Concordia University Electrical and Computer Engineering 1455 De Maisonneuve O. H851 Montreal, Quebec, Canada H3G 1M8 Telephone: (514) 848-3115 Fax: (514) 848-2802 Email: dave@ece.concordia.ca