[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: expect script with ppp and stty forces reboot



On Sun, Nov 29, 1998 at 12:49:35PM -0500, Colin Telmer wrote:

> I recently began using an expect script to connect to my office via ppp
> and have a problem with how I initialize the modem. I talk with the modem
> in the expect script as follows:

Uh, why that?

> system "stty 38400 -echoe -echo raw < /dev/ttyS1 > /dev/ttyS1"
> spawn -noecho -open [open /dev/ttyS1 "r+"]
>
> and at the end of the script I start up pppd as 
> 
> overlay -0 $spawn_id -1 $spawn_id /usr/sbin/pppd /dev/ttyS1 38400

Ahem! If you really start pppd from expect down pass it the already open file.
You should use the -detach option of pppd and pass the fd for /dev/ttyS1 as
stdin/stdout.

> This works fine (as far as I can tell), but after disconnecting using
> poff, I can't reissue the stty command to make a subsequent connection. In
> other words, 

I guess it is still opened somehow because the "double-open" above.

> stty 38400 -echoe -echo raw < /dev/ttyS1 > /dev/ttyS1
> 
> just hangs. I can't figure out how to reset this, so I have to reboot
> (cheap excuse). Does anyone know how I can solve this? Thanks, Colin.

cu
	Torsten

Attachment: pgpNIfIgDezPm.pgp
Description: PGP signature


Reply to: