*BSD News Article 77373


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!news.wildstar.net!serv.hinet.net!nctuccca.edu.tw!howland.erols.net!surfnet.nl!swsbe6.switch.ch!news.belnet.be!news.rediris.es!sanson.dit.upm.es!ozono.p7.f14.n341.z2.fidonet.org!javier
From: javier@ozono.p7.f14.n341.z2.fidonet.org (Javier Martín Rueda)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Modem dial-in problem
Date: 3 Sep 1996 22:40:04 GMT
Organization: La ultima pregunta
Lines: 70
Message-ID: <50ic44$s9l@sanson.dit.upm.es>
References: <505hv9$cm3@holodeck.iss.nus.sg>
NNTP-Posting-Host: jmartin.ccupm.upm.es
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Newsreader: TIN [version 1.2 PL2]

> For sometime I have been having problem to configure a modem for dial-in
> purposes to my FreeBSD Pentium 120 Mhz. I have tried the followings;

My modem is in COM1. This is how I enable dial-in access
with it (under FreeBSD 2.1, or 2.1-stable):

In /etc/rc.serial, I add at the end:

... {some stuff here}
# Edit the functions and the examples to suit your system.
#
# maybe		0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v
# mouse		    2
# modem		  1
# terminal	0
#
#
if [ ! -c /dev/modem ]; then
	ln -s cuaa0 /dev/modem
fi
modem 0
(printf "ATZ0\r" > /dev/modem ; sleep 3 ; printf "ATS0=1\r" > /dev/modem ) &


Note: configuration Z0 is:

at&fb0e0q1m0w2&c1&d2\e1%e1s95=3s11=70&w0

Basically, ensure you put atb0e0q1m0w2&c1&d2.


To enable or disable, I use these two shell procedures:

Enable:

activar_modem ()
{
# Inicializa el módem para respuesta automática al primer timbre, sin eco,
# sin cadenas de resultado y sin altavoz.
	printf "at\r" > /dev/modem
	printf "atz0\r" > /dev/modem
	sleep 2
	printf "ats0=1e0q1m0\r" > /dev/modem
# Cambia la línea correspondiente de /etc/ttys
	cp /etc/ttys /tmp/.ttys.$$
	awk '$1 == "ttyd0" {$5="on"} {print $0}' < /tmp/.ttys.$$ > /etc/ttys
	rm /tmp/.ttys.$$
# Se lo comunica a init.
	kill -HUP 1
}


Disable:

desactivar_modem ()
{
# Cambia la línea correspondiente de /etc/ttys.
	cp /etc/ttys /tmp/.ttys.$$
	awk '$1 == "ttyd0" {$5="off"} {print $0}' < /tmp/.ttys.$$ > /etc/ttys
	rm /tmp/.ttys.$$
# Se lo comunica a init.
	kill -HUP 1
# Deja bien los permisos de los dispositivos del módem (por si acaso).
	sleep 5
	chown uucp.dialer /dev/cuaa0
	chmod 660 /dev/cuaa0
}


That´s all!