From: Austin S. <te...@of...> - 2007-06-12 20:27:06
|
On Tue, Jun 12, 2007 at 12:41:25PM -0700, Juan Pablo Feria Gomez wrote: > Hello, I'm trying to expect an modem with cu session but i never got > answer from the modem . > > Here is my ugly code > > my $command = "cu -s 9600 -l ttyS0"; > if ($_[5] eq 'ROOT') { > print "Iniciando conexion telnet como ROOTEXPECT \n " > if ($debug eq "1"); > $rootexpect=Expect->spawn($command, @params) or die > "$command: $! FALLO\n"; > if ($_[9] eq "MODEM") { > my $timeout = "8"; > > $rootexpect->exp_internal('2'); > $rootexpect->expect($timeout, "nnected"); > $rootexpect->send("\n"); > $rootexpect->send("AT\n"); ^^ I suspect you need to send cu \r instead of \n. Austin |