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

expect script with ppp and stty forces reboot

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:

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

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, 

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.

Colin Telmer, Ottawa, Ontario, Canada

Reply to: