Subject: | Parameters passed to 'cu' on Linux prevent serial connection |
Date: | Tue, 31 Mar 2015 14:30:26 +0000 |
To: | "bug-Net-CLI-Interact [...] rt.cpan.org" <bug-Net-CLI-Interact [...] rt.cpan.org> |
From: | Steve Kersley <steve.kersley [...] keble.ox.ac.uk> |
Hi Oliver,
The 'serial' transport is failing to connect to serial ports from Linux [using Ubuntu 14.04, with the distribution package of 'cu' - also using the distribution packages for net-appliance-session (v 4.131260); net-cli-interact (v 2.133420) etc which are a few minor versions behind, but have checked and the specific code looks the same in current version]
I'm calling Net::Appliance::Session->new() passing in:
{
transport => 'Serial',
personality => 'ios',
do_login => 0,
connect_options => {
device => '/dev/ttyUSB0'
}
}
..but it fails to connect:
[ 0.048308] tr creating Net::Telnet wrapper for cu
[ 0.055333] tr connecting with: cu --parity=none '-l /dev/ttyUSB0' '-s 9600'
[ 0.196861] du SEEN:
cu: open (/dev/ /dev/ttyUSB0): No such file or directory
From testing on the command line cu fails with the above error if there is a space between -l and /dev/..., and if the parameter is enclosed in quotes (as seen in the debug log). Serial.pm does explicitly put a space between -l and whatever device has been specified - if I remove that space then it appears to connect (my script then fails for other reasons not yet investigated, but never mind...). Cannot say whether this change would break on other OSes however.
All the best,
Steve.