Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
O wise monks,
I have run into an issue at work where I need to automate the following:
I've accomplished the first (SSH to element and run command) but when it comes to actually sending anything to the interface and retrieve the output, I just cant get it to work.
Relevant part of the code:
$ssh->exec("microcom /tmp/dev/mux1"); $ssh->send("AT+CSQ"); $ssh->waitfor('^\+CSQ', 3) or warn "No output!"; $myOutput = $ssh->match(); print "CSQ result: $myOutput";
I've tried with ssh->exec("AT+CSQ") as well with no success. It simply warns on "No output!"
Anyone done something similar before and can provide me with a hint or two on how to overcome this obstacle?
If only I could pass the AT command directly on the commandline, but alas, thats not possible. :-(
Thanks in advance!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net:SSH::Expect and microcom?
by salva (Canon) on Nov 08, 2011 at 08:37 UTC | |
by Anonymous Monk on Nov 08, 2011 at 12:05 UTC | |
by salva (Canon) on Nov 08, 2011 at 12:13 UTC | |
by Anonymous Monk on Nov 08, 2011 at 12:37 UTC | |
by salva (Canon) on Nov 08, 2011 at 12:52 UTC | |
|
Re: Net:SSH::Expect and microcom?
by williams554 (Sexton) on Nov 07, 2011 at 22:33 UTC | |
|
Re: Net:SSH::Expect and microcom?
by Anonymous Monk on Nov 07, 2011 at 22:15 UTC |